Skip to content

Instantly share code, notes, and snippets.

View cristianrasch's full-sized avatar
💭
I may be slow to respond.

Cristian Rasch cristianrasch

💭
I may be slow to respond.
View GitHub Profile
@cristianrasch
cristianrasch / rsyncrypto.sh
Last active April 11, 2026 08:54
rsyncrypto tutorial
# Generate your backup private key and certificate
openssl req -nodes -newkey rsa:1536 -x509 -keyout backup.key -out backup.crt
# Encrypt your data to a temporary folder
rsyncrypto --verbose --ne-nesting=2 --trim=2 --name-encrypt=/tmp/rsyncrypto-map --delete-keys --changed --recurse /home/cristian/Dropbox/ /tmp/Dropbox/ /tmp/rsyncrypto-keys ~/Dropbox/backups/laptop/crypto/rsyncrypto/backup.crt
# Send it over the network
rsync --verbose --archive --compress --delete /tmp/Dropbox/ pi:~/backups/laptop
# Decryption time!
@cristianrasch
cristianrasch / user.js
Created April 3, 2026 13:12
user.js overrides for LibreWolf
user_pref("browser.tabs.closeWindowWithLastTab", false);
user_pref("browser.tabs.loadDivertedInBackground", true);
user_pref("identity.fxaccounts.enabled", true);
user_pref("geo.enabled", false);
user_pref("dom.webnotifications.enabled", false);
user_pref("dom.vr.enabled", false);
user_pref("dom.webmidi.enabled", false);
user_pref("browser.sessionstore.restore_pinned_tabs_on_demand", true);
user_pref("signon.rememberSignons", false);
// controls whether Firefox will autofill login forms when it can
@cristianrasch
cristianrasch / gist:f5e9fe0d1920e663fa8ab178c80386ce
Created July 28, 2025 18:06
Personal overrides on top of yokoffing/Betterfox
// append/write to /path/to/your/profile/user.js
user_pref("browser.tabs.closeWindowWithLastTab", false);
user_pref("browser.tabs.loadDivertedInBackground", true);
user_pref("identity.fxaccounts.enabled", true);
user_pref("geo.enabled", false);
user_pref("dom.webnotifications.enabled", false);
user_pref("dom.vr.enabled", false);
user_pref("dom.webmidi.enabled", false);
user_pref("browser.sessionstore.restore_pinned_tabs_on_demand", true);
@cristianrasch
cristianrasch / gitlab.sh
Created April 22, 2012 01:50
Install Gitlab on Debian Squeeze/Wheezy
aptitude install -y git curl python-dev python-pip redis-server ruby1.9.1-full rubygems1.9.1
aptitude install -y mysql-server libmysqlclient-dev
adduser --system --shell /bin/sh --gecos 'git version control' --group --disabled-password --home /home/git git
adduser --disabled-login --gecos 'gitlab system' gitlab
usermod -a -G git gitlab
su - gitlab
ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa
aptitude install gitolite
cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub
su - git
module ArrayUtils
def self.flatten(array)
array.inject([]) { |accu, elem|
if elem.kind_of?(Array)
accu.concat(flatten(elem))
else
accu << elem
end
}
end
@cristianrasch
cristianrasch / pgp-encryption-guide.md
Last active May 9, 2019 11:28
PGP Encryption Guide

PGP encryption guide

Generating your key pair

gpg --gen-key

echo "export GPGKEY=01086FDA" > ~/.bashrc

#!/usr/bin/env ruby
# sed 's/https:\/\/www.twitter.com\///' -i ~/Downloads/twitter_accounts.csv
require "csv"
require "English"
require "logger"
require "pathname"
require "set"
require "English"
require "logger"
require "pathname"
# kill me with kill -INT PID
script_path = Pathname(__FILE__)
pid_file = script_path.sub_ext(".pid")
pid_file.write(String(Process.pid))
from itertools import cycle, chain, islice, repeat
fizzes = cycle(chain(islice(repeat(''), 2), ('fizz' for _ in range(1))))
buzzes = cycle(chain(islice(repeat(''), 4), ('buzz' for _ in range(1))))
fizzes_buzzes = zip(range(1, 101), fizzes, buzzes)
fizz_buzz = (str(i) if not(fizz) and not(buzz) else f'{fizz}{buzz}' for i, fizz, buzz in fizzes_buzzes)
for line in fizz_buzz:
print(line)
use std::iter::{once, repeat};
fn main() {
let fizzes = repeat("").take(2).chain(once("fizz")).cycle();
let buzzes = repeat("").take(4).chain(once("buzz")).cycle();
let fizzes_buzzes = fizzes.zip(buzzes);
let fizz_buzz = (1..=100).zip(fizzes_buzzes).map(|tuple| match tuple {
(i, ("", "")) => i.to_string(),
(_, (fizz, buzz)) => format!("{}{}", fizz, buzz),