Skip to content

Instantly share code, notes, and snippets.

View ahasverus's full-sized avatar

Nicolas Casajus ahasverus

View GitHub Profile
@ahasverus
ahasverus / setup-zorinos.md
Last active December 18, 2025 15:23
Setup Zorin OS

What do you need?

  1. An external disk to back up your data
  2. A USB drive to install Zorin OS

Back up your data

  1. Format an external disk to exFAT format
  2. Back up your data to this external disk
  3. Don't forget to back up your config files (.gitconfig, .ssh/, .Renviron, .Rprofile, etc.)
orthomap <- function(lon, lat) {
  g <- as_s2_geography(TRUE)
  co <- s2_data_countries()
  oc <- s2_difference(g, s2_union_agg(co)) # oceans
  co <- s2_difference(co, s2_union_agg(oc)) # land
  
  # visible half
  b <- s2_buffer_cells(as_s2_geography(paste0("POINT(", lon, " ", lat,")")),
                       distance = 9800000)
@ahasverus
ahasverus / montpellier_OSM_city_map.R
Created July 16, 2024 08:38 — forked from oliviergimenez/montpellier_OSM_city_map.R
Make a map of Montpellier with R and openstreetmap data
# code from https://gist.github.com/d-qn/4f1c4ed80a4fd6a76cd1153c89f56134
library(tidyverse)
library(sf)
library(osmdata) # to get openstreetmap geo data
# settings
# olivier: get data on Montpellier
bb <- getbb('Montpellier, France') # define the bbox, will be used to fetch OSM data within that box
dest_proj <- 2056
@ahasverus
ahasverus / kobo-tips.md
Last active September 24, 2020 12:42
Tips for Kobo Reader

Tips for Kobo Reader

Use the software Calibre to manager and transfer epubs.

Add Book Cover on Screensaver

  1. On a PC:
nano .kobo/affiliate.conf
@ahasverus
ahasverus / setup-ubuntu-jammy-jellyfish.md
Last active December 8, 2022 14:52
Setup Ubuntu 20.04 on Lenovo X1 Carbon 7th Gen

Setup Ubuntu 22.04 on Lenovo X1 Carbon 7th Gen

SYSTEM SECURITY

Update System

@ahasverus
ahasverus / setup-debian-buster.sh
Last active September 20, 2020 18:57
Setup Debian Buster on Lenovo X1 Carbon 7th Gen
## Switch to Admin
su -
## Remove GRUB Menu
cd /etc/default
cp grub grub-OLD

PostgreSQL Command Lines

$ brew install postgresql                                     # Install PostgreSQL

$ /usr/local/opt/postgres/bin/createuser -s postgres          # Create postgres role
$ psql -U postgres                                            # Connect to PostgreSQL
postgres=# \password postgres                                 # Set/change password for postgres

$ brew services start postgresql # Start PostgreSQL server

Setting up OpenVPN under Unix

This tutorial shows the installation and configuration of OpenVPN on both macOS and Ubuntu.

1. Preamble (macOS only)

The easiest way to install OpenVPN on macOS is by using the package manager for macOS Homebrew. But first, you need to install the Xcode Command Line Tools for macOS.

### [.] ALWAYS OPEN CHROMIUM IN PRIVATE MODE
###-----------------------------------------
# N.B. | First install { AdBlock }, { Adblock Plus } and { Adblock for Youtube } extensions and
# | Allow them to be run in private mode
$ defaults write org.chromium.Chromium IncognitoModeAvailability -integer 2 # / 0
$ defaults write com.brave.Browser IncognitoModeAvailability -integer 2
@ahasverus
ahasverus / macos-settings.sh
Last active April 8, 2021 14:30
Shell Script to reinstall macOS X system
#!/bin/sh
# chmod a+x ./macos-settings.sh
# sh ./macos-settings.sh
## [.] Install Command Line Tools ----
sudo xcode-select --install