Skip to content

Instantly share code, notes, and snippets.

View tisseurdetoile's full-sized avatar
🏠
confiné

tisseurdetoile tisseurdetoile

🏠
confiné
View GitHub Profile
#
# Example of a user's .screenrc file
#
# This is how one can set a reattach password:
# password ODSJQf.4IJN7E # "1234"
# no annoying audible bell, please
vbell on
"Set Mapleader
let mapleader = ","
let g:mapleader = ","
"Theme
colo zenburn
"NERDTree
map <Leader>, :NERDTreeToggle<cr>
@tisseurdetoile
tisseurdetoile / sqlitetojson.awk
Created March 14, 2013 13:19
json output fromage sqlite select
# sqlitetojson.awk
# convert SQL SELECT Result from sqlite to json
# usage : sqlite3 -header dbfilename 'SELECT * FROM database' | awk -f sqlitetojson.awk
# nota : -header is mandatory
BEGIN {
FS="|";
nh = 0;
printf "[";
}
NR==1 {
#!/bin/sh
# btsync service
# Replace with linux users you want to run BTSync clients for
BTSYNC_USERS="mendel"
DAEMON=/usr/bin/btsync
start() {
for btsuser in $BTSYNC_USERS; do
HOMEDIR=`getent passwd $btsuser | cut -d: -f6`
config=$HOMEDIR/.sync/config.json
@tisseurdetoile
tisseurdetoile / BACKUP.SH
Last active January 23, 2018 01:37
backup my PI to my NAS with rsync
#!/bin/bash
HOSTNAME=`hostname`
SERVER="SRVHOST"
USERNAME="USER"
export RSYNC_PASSWORD="password"
PREFIX="/backup"
AREXCLUDE=( "/dev/*" "/proc/*" "/sys/*" "tmp/*" "/run/*" "/mnt/*" "/media/*" "lost+found" "/usr/share/*" "/lib/*" "/var/lib/*" "/usr/lib/*" "/var/swap" "/var/cache/*" "/var/lock/*" "/var/run/*")
START=$(date +%s)
DAYNUM=`date '+%u'`
@tisseurdetoile
tisseurdetoile / post-receive
Created April 12, 2015 10:52
Hook in git repo for jekyll auto publish
#!/bin/bash -l
GIT_REPO=/opt/git/blog.git
TMP_GIT_CLONE=/tmp/awesomeblog
PUBLIC_WWW=/usr/share/nginx/www/jekyll/
git clone $GIT_REPO $TMP_GIT_CLONE
jekyll build -s $TMP_GIT_CLONE -d $PUBLIC_WWW
rm -Rf $TMP_GIT_CLONE
exit
@tisseurdetoile
tisseurdetoile / git-shell-commands
Last active August 29, 2015 14:19
git-shell-commands example
# git-shell-commands
------------------------------------------------------------------------------
--
-- Copyright © 2016 Le TisseurDeToile <webmaster@tisseurdetoile.net> and released under
-- the GNU General Public License, v2 or later.
-- NOTA : don't forget to create variable
--
-- Installation :
-- Créer les variables Utilisateurs suivantes : CONSO_LAST, CONSO_LAST_HC, CONSO_LAST_HP
-- Créer deux capteur virtuel : Capteur electrique ent noter leur index
------------------------------------------------------------------------------
@tisseurdetoile
tisseurdetoile / config_my_git
Last active September 28, 2016 14:21
Git configuration
git config --global user.name yourName
git config --global user.email yourMail@yourdomain.net
git config --global color.diff always
git config --global color.diff.frag magenta bold
git config --global color.diff.meta yellow bold
git config --global color.diff.whitespace red reverse
git config --global core.whitespace '-trailing'
git config --global diff.mnemonicPrefix true
git config --global diff.renames true
@tisseurdetoile
tisseurdetoile / fetch_files.sh
Created January 22, 2017 19:26
fetch file ending with the alphet letter with curl pretending to firefox 3 on windows xp
#!/bin/bash
# fetch file ending with the alphet letter
# with curl pretending to firefox 3 on windows xp
#
for x in {a..z}
do
echo "http://www.website.com/letter_$x.pdf"
curl -silent -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3" --remote-name http://www.website.com/letter_$x.pdf
done