$ git init mystore
$ cd mystore
$ git store set foo "this is foo"
$ git store get foo
this is foo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_complete_ssh_hosts () | |
{ | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \ | |
cut -f 1 -d ' ' | \ | |
sed -e s/,.*//g | \ | |
grep -v ^# | \ | |
uniq | \ | |
grep -v "\[" ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim: set ft=sshconfig cc=0 fdm=marker: | |
host * | |
controlmaster auto | |
controlpath ~/.ssh/connections/%r_%h_%p | |
controlpersist 4h | |
host laleh# {{{ | |
user scp1 | |
hostname 192.168.1.128 | |
port 19217 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script disables execution of commands and echoes messages to the user, to disable type: "wat" | |
# | |
# To install this, you need to have access to the user's home directory. | |
# sudo -u <user> -i sh -c 'cp /path/to/evil ~/.evil && cp ~/.bashrc ~/.bashrc.ebak && echo ". ~/.evil" >> ~/.bashrc' | |
shopt -s extdebug | |
function disable_evil() { | |
rm ~/.evil | |
rm ~/.bashrc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See docs in http://git-annex.branchable.com/internals/hashing/ and implementation in http://sources.debian.net/src/git-annex/5.20140227/Locations.hs/?hl=408#L408 | |
import hashlib | |
import struct | |
def hashdirlower(key): | |
hasher = hashlib.md5() | |
hasher.update(key) | |
digest = hasher.hexdigest() | |
return "%s/%s/" % (digest[:3], digest[3:6]) |
This repository contains the database of password-store used by our Team to store passwords (mostly to be used in emergencies).
The database is encrypted for the PGP keys of all members, and can be read and written by any standard PGP implementation.
The preferred tool to manage these passwords is
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# | |
# Set/check SHA256 file checksum stored in the file's extended attributes | |
# | |
csum_attr="user.sha256sum" | |
check_path="." | |
action="" | |
usage() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List of subreddits with 50,000+ subscribers, compiled by /u/roastedlasagna, in alphabetical order. Latest update Feb 4. Note that these are not necessarily marked NSFW! | |
/r/100yearsago | |
/r/1200isplenty | |
/r/2007scape | |
/r/2meirl4meirl | |
/r/3amjokes | |
/r/3Dprinting | |
/r/3DS | |
/r/4chan |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
aria2c -j5 -i list.txt -c --save-session out.txt | |
has_error=`wc -l < out.txt` | |
while [ $has_error -gt 0 ] | |
do | |
echo "still has $has_error errors, rerun aria2 to download ..." | |
aria2c -j5 -i list.txt -c --save-session out.txt | |
has_error=`wc -l < out.txt` | |
sleep 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The initial version | |
if [ ! -f .env ] | |
then | |
export $(cat .env | xargs) | |
fi | |
# My favorite from the comments. Thanks @richarddewit & others! | |
set -a && source .env && set +a |
OlderNewer