Skip to content

Instantly share code, notes, and snippets.

View odarriba's full-sized avatar
🚀

Óscar de Arriba odarriba

🚀
View GitHub Profile
brew tap homebrew/cask-fonts
brew install --cask font-cascadia-code
brew install --cask font-cascadia-code-pl
brew install --cask font-cascadia-mono
brew install --cask font-cascadia-mono-pl
@odarriba
odarriba / moonobject.js
Created May 2, 2020 07:33 — forked from L-A/moonobject.js
Moon phase calculation
var MoonInfo = function(day, month, year) {
var n0 = parseInt( "0" );
var f0 = parseFloat( "0.0" );
var AG = f0; // Moon's age
var DI = f0; // Moon's distance in earth radii
var LA = f0; // Moon's ecliptic latitude
var LO = f0; // Moon's ecliptic longitude
var Phase = " ";
var Zodiac = " ";
@odarriba
odarriba / HowTo.md
Last active June 15, 2020 04:10
How to install ruby-opencv on OSX

First of all, install OpenCV v2:

$ brew install opencv@2

Then, set build configuration for build (changing OpenCVversion number for the current one):

$ bundle config build.ruby-opencv --with-opencv-lib=/usr/local/Cellar/opencv@2/2.4.13.6_2/lib \

Keybase proof

I hereby claim:

  • I am odarriba on github.
  • I am odearriba (https://keybase.io/odearriba) on keybase.
  • I have a public key ASBhoTV6vzDRt3kIh3_TGsmbSVyEkqeUHVVdBj6poVd_hQo

To claim this, I am signing this object:

@odarriba
odarriba / map_dev_somains_ubuntu.md
Last active November 11, 2020 01:46
How to map all *.dev DNS entries to localhost under Ubuntu

We create an entry on dnsmasq.d directory (used to solve domains):

$ sudo mkdir /etc/NetworkManager/dnsmasq.d
$ echo 'address=/dev/127.0.0.1' | sudo tee /etc/NetworkManager/dnsmasq.d/dev-tld

And we restart NetworkManager service (you will losse internet connection for a bit):

$ sudo service network-manager restart
@odarriba
odarriba / OpenVPN on Docker and Raspberry Pi.md
Last active March 12, 2024 15:13
How to install OpenVPN with Docker on Raspberry Pi

First of all, we are going to store all the data in a Docker shared volume, called openvpn_data.

To initialise the OpenVPN configuration and CA:

$ docker run -v openvpn_data:/etc/openvpn --rm evolvedm/openvpn-rpi ovpn_genconfig -u udp://your-vpn.address.com
$ docker run -v openvpn_data:/etc/openvpn --rm -it evolvedm/openvpn-rpi ovpn_initpki

To start daemon (and auto-restart it):

@odarriba
odarriba / circle.yml
Created August 12, 2016 17:15
CircleCI configuration for Elixir/Phoenix
machine:
environment:
PATH: "$HOME/.asdf/bin:$HOME/.asdf/shims:$PATH"
MIX_ENV: "test"
dependencies:
cache_directories:
- ~/.asdf
pre:
- if ! asdf | grep version; then git clone https://github.com/HashNuke/asdf.git ~/.asdf; fi
- if ! asdf plugin-list | grep erlang; then asdf plugin-add erlang https://github.com/HashNuke/asdf-erlang.git; fi
@odarriba
odarriba / xargs.md
Last active April 14, 2016 11:16 — forked from porras/xargs.md

This is my best try at transcribing of the lightning talk I gave at RUG::B on April 2016. Due to poor time management (LOL) the delivery was rushed and some examples were skipped, I hope having them posted here makes them more useful.

xargs

xargs is a small but very useful program that is installed in most if not all of your computers¹. Many of you probably know it. Those who don't will learn something really useful, but those who do will learn a couple of cool tricks, too.

Why xargs

You might have heard about the Unix philosophy:

@odarriba
odarriba / ghost_backup.md
Last active July 17, 2018 08:50
Script to backup a ghost installation to Dropbox

Ghost backup script

This script allows you to automatically archive and upload a backup of your existing Ghost data to your Dropbox account.

How to use it

You'll need to follow this tutorial.

Then, you must create an executable script using the code of ghost_backup.sh in this gist (but modifying your blog's path and prefix).