Skip to content

Instantly share code, notes, and snippets.

INFO global: Vagrant version: 2.3.3
INFO global: Ruby version: 2.7.6
INFO global: RubyGems version: 3.1.6
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/bin/vagrant"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_LOG="debug"
WARN global: resolv replacement has not been enabled!
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/plugins/kernel_v1/plugin.rb
# Add SSH keys
ssh-add -L >/dev/null 2>&1
if [ $? -eq 1 ]; then
find ~/.ssh -maxdepth 1 -type f -regex '~/.ssh/id_[^.]*' -print0 | xargs -0 ssh-add
fi
@matlink
matlink / sum_under.sh
Created February 14, 2019 13:24
print SUM until threshold
awk '{ if ($1<=1e7){SUM+=$3} else{print SUM; exit}}'
@matlink
matlink / default_value.py
Created March 12, 2018 14:03
Default value for missing value of python dict
from collections import defaultdict as ddict
dic = ddict(lambda: '<my_default_value>')
@matlink
matlink / max_column.sh
Created February 17, 2018 19:04
print max of 2nd column
awk '{ if(max<$2) {max=$2} } END { print max }'
@matlink
matlink / hashcat_crackpos.sh
Created February 17, 2018 13:18
hashcat get cracking positions
hashcat -m99999 -o ${BASENAME}.hc.ranks --outfile-format=10 --potfile-disable --markov-hcstat=${BASENAME}.hcstat2 --session=${BASENAME} --increment -a3 -1?l?u?d ${BASENAME} ?1?1?1?1?1?1?1?1?1?1
@matlink
matlink / hashcat_markov.sh
Last active February 17, 2018 13:15
hashcat use markov stat
hashcat --markov-hcstat=${FILEBASE}.hcstat2 --session=${FILEBASE} --increment --stdout -a3 -1?l?u?d ?1?1?1?1?1?1?1?1?1?1
@matlink
matlink / runtime.txt
Created February 16, 2018 14:29
measure run time
#include <time.h>
clock_t begin = clock();
/* here, do your time-consuming job */
clock_t end = clock();
double time_spent = (double)(end - begin) / CLOCKS_PER_SEC;
@matlink
matlink / hcstat.sh
Created February 16, 2018 13:48
create hcstat2 file
hcstat2gen < inputfile 2>/dev/null | xz --compress --format=raw --stdout -9e 2>/dev/null > output.hcstat2
@matlink
matlink / print_lower.sh
Last active February 16, 2018 09:47
print lines having 1st column lower than
NUMBER=2880000000
awk '{ if ($1 < '"$NUMBER"') {print $0} }'