23
Mar
2019

search lost info

23 Mar 2019
git reflog --all | grep something git fsck --full --no-reflogs --unreachable --lost-found | grep commit | cut -d\ -f3 | xargs -n 1 git log -n 1 --pretty=oneline > .git/lost-found.txt
26
Feb
2018

List git branches that can safely be deleted

26 Feb 2018
git branch --no-merged git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d
6
Sep
2017

Message reminder

06 Sep 2017
vi /path/to/message.sh #!/bin/bash PID=$(pgrep gnome-session) dbus=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-) export DBUS_SESSION_BUS_ADDRESS=$dbus notify-send -u critical "$1" crontab: `0 * * * * /path/to/message.sh "my message"`
12
Jul
2017

screen

12 Jul 2017
screen -ls screen -dmS mytabname php artisan dosomething screen -r mytabname detach: ctrl+a , d ls -laR /var/run/screen/
17
May
2017

After Hacking

17 May 2017
tail /var/log/auth.log find . -type f -newermt 2017-01-01 ! -newermt 2017-01-31 grep -lr --include=*.php "base64_decode" grep -lr --include=*.php "@require"
13
Mar
2017

Git snippets

13 Mar 2017
git config receive.denycurrentbranch ignore vi .git/hooks/post-receive #!/bin/bash cd ../ env -i git reset --hard chmod +x .git/hooks/post-receive git diff --name-status SHA1 SHA2 | cut -f2