gpg --gen-key
echo "export GPGKEY=01086FDA" > ~/.bashrc
| # 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! |
| 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 |
| // 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); |
| 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 |
| #!/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), |