Skip to content

Instantly share code, notes, and snippets.

View whoo's full-sized avatar

Dominique DERRIER whoo

  • Transition
  • Montreal
View GitHub Profile
@whoo
whoo / README.md
Created July 19, 2020 13:43 — forked from magnetikonline/README.md
Extract all files at every commit of a Git repository.

Extract all files at every commit of a Git repository

Bash script to iterate all commits of a given Git repository and extract all files within each commit.

Example

With a Git repository at /path/to/repository and an empty directory at /path/to/output we can run:

./export.sh /path/to/repository /path/to/output

Export 1d9048853b8073e43e43e3250300a82f93d2f431 -> /path/to/output/1d9048853b8073e43e43e3250300a82f93d2f431
import json
config = {}
with open('fortigate.cfg') as fh:
for line in fh:
args = line.split()
action = args.pop(0)
# python3: action, *args = line.split()
@whoo
whoo / ReInit.sh
Last active March 15, 2020 00:08
Pass | Password manager cmdline
#!/bin/bash
echo -e "\033[1;32m [ReInit Vault with keys : (gpg.id)] \033[0m"
for a in $(cat ~/.password-store/.gpg-id)
do
echo -ne "\033[1;33m * \033[0m"
gpg --list-keys $a | grep uid | grep @ | head -n 1 | cut -c 26-
done
@whoo
whoo / scann
Created October 10, 2019 00:45
test
# wget "https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz"
#
import geoip2.database
reader = geoip2.database.Reader('./GeoLite2-City.mmdb')
listtt="""
8.8.8.8
123.12.12.12
23.23.2.2
#!/bin/sh
# script generated by ./play.it 2.11.0~dev - http://wiki.dotslashplay.it/
set -o errexit
# Set executable file
APP_EXE='lba2.exe'
APP_OPTIONS=""
LD_LIBRARY_PATH=":/usr/$(portageq envvar LIBDIR_x86)/debiancompat:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH
@whoo
whoo / gist:5f642f3e399380ec8085f23ae62cecc0
Created June 18, 2018 00:23
Montage | photocollage imagemagick
montage -gravity center *JPG -tile 5x6 -thumbnail 250x250 -sharpen 10 -bordercolor grey20 +polaroid -geometry '1x1-60-60<' -tile 5x6 out.jpg
wget -q -O- ftp://ftp.ripe.net/ripe/stats/delegated-ripencc-latest | egrep '^ripencc\|..\|ipv4\|.*\|.*\|(assigned|allocated)$' > $tmp_ripe_file
wget -q -O- ftp://ftp.apnic.net/pub/stats/apnic/delegated-apnic-latest | egrep '^apnic\|..\|ipv4\|.*\|.*\|(assigned|allocated)$' >> $tmp_ripe_file
wget -q -O- ftp://ftp.arin.net/pub/stats/afrinic/delegated-afrinic-latest | egrep '^afrinic\|..\|ipv4\|.*\|.*\|(assigned|allocated)$' >> $tmp_ripe_file
wget -q -O- ftp://ftp.arin.net/pub/stats/lacnic/delegated-lacnic-latest | egrep '^lacnic\|..\|ipv4\|.*\|.*\|(assigned|allocated)$' >> $tmp_ripe_file
#!/bin/bash
PATH=${GZIP_BINDIR-'/bin'}:$PATH
exec 7z e -so -bd "$@" 2>/dev/null | cat
#!/bin/bash
KEY="$1"
NAME="key"
gpg --armor --export $KEY > $NAME.pub
gpg --armor --export-secret-keys $KEY > $NAME.priv
gpg --armor --gen-revoke $KEY > $NAME.rev
GET /_cat/indices?v
POST /_reindex?refresh&wait_for_completion=false
{
"source": {
"index": "logstash-2017.03.*"
},
"dest": {
"index": "logstash-2017-q1"
}
}