Skip to content

Instantly share code, notes, and snippets.

<!--
_____ _ _ _ _ _ _ _ _ __ ____ ____ ___ ____ __ __
|_ _| |__ ___ _ __ ___ (_)___ __ _ _ __ __ _(_)_ __ | |__ _____ __ __ _| |_ | |_| |__ ___ ___ _ __ __| | ___ / _| _____ _____ _ __ _ _ | _ \ | _ \ |_ _| / ___| | \/ |
| | | '_ \ / _ \ '__/ _ \ | / __| / _` | | '__/ _` | | '_ \| '_ \ / _ \ \ /\ / / / _` | __| | __| '_ \ / _ \ / _ \ '_ \ / _` | / _ \| |_ / _ \ \ / / _ \ '__| | | | | |_) |____| |_) |____| |____\___ \ _____| |\/| |
| | | | | | __/ | | __/ | \__ \ | (_| | | | | (_| | | | | | |_) | (_) \ V V / | (_| | |_ | |_| | | | __/ | __/ | | | (_| | | (_) | _| | __/\ V / __/ | | |_| | | __/_____| _ <_____| |_____|__) |_____| | | |
|_| |_| |_|\___|_| \___| |_|___/ \__,_| |_| \__,_|_|_| |_|_.__/ \___/ \_/\_/ \__,_|\__| \__|_| |_|\___| \___|_| |_|\
@aerth
aerth / fix-chmod
Created May 14, 2015 05:59
Fix permissions after migrating a bolt installation
chmod -R 777 files/ app/database/ app/cache/ app/config/ theme/ extensions/
# change 777 if desired
php app/nut cache:clear
rm cache/* -R
touch cache/index.html
echo "# Contributors" > CONTRIBUTORS.md && git log --pretty=tformat:"* %an <%ae>" | tac | awk ' !x[$0]++' >> CONTRIBUTORS.md
@aerth
aerth / listings.txt
Last active March 4, 2016 03:53
Bolt.cm Template: listings
{% setcontent links = "services/latest/6" allowpaging %}
{% for link in links %}
<a href="/services/{{ link.slug }}">{{ link.title }}</a> &bull;
{% endfor %}
<a href="/products">View Products</a>
@aerth
aerth / ufw-secure.sh
Created January 12, 2016 22:02
Hardened UFW rules (you customize)
#!/bin/bash
# this lil script was created by aerth at Earthbot.net
# run this to clear your ufw rules and replace with this default medium-high security!
# reset firewall
ufw reset
@aerth
aerth / ufw-china.sh
Last active March 21, 2016 20:00
ufw block china (RGFW)
#!/bin/sh
cat <<XXX>>china-ip.txt
223.0.0.0/12
223.20.0.0/15
223.27.184.0/22
223.64.0.0/10
223.128.0.0/15
223.144.0.0/12
223.160.0.0/14
223.166.0.0/15
Remove all un-tagged images
for i in $(docker images | grep "<none>" | awk '{print $3}' - ); do echo docker rmi $i; done
@aerth
aerth / keybase.md
Created February 3, 2017 09:14
all rights reserved

Keybase proof

I hereby claim:

  • I am aerth on github.
  • I am aerth (https://keybase.io/aerth) on keybase.
  • I have a public key whose fingerprint is 8295 3CFA 6F4F 49D0 2B6A 082F EBC4 61F6 8638 5D5C

To claim this, I am signing this object:

@aerth
aerth / 10-evdev.conf
Last active May 9, 2017 20:21
Disable Laptop Keyboard && Use USB Keyboard Instead ( good for broken laptop keys )
## /etc/X11/xorg.conf.d/10-evdev.conf
## Disable laptop's built-in keyboard (in X session)
## Does not disable on the kernel level
## Does not disable while ctrl+alt+f1 etc
## Useful for placing a USB keyboard on top of laptop's (broken) keyboard as to not accidentally input keys.
## <aerth@riseup.net>
##
## You may have to create the xorg.conf.d directory.
## Something like:
## mkdir-p /etc/X11/xorg.conf.d
@aerth
aerth / k9-passwd.sh
Created May 9, 2017 20:18
extract password from k9 mail client android
adb into android, grab /data/data/com.fsck.k9/databases/preferences_storage
this is easier with sqlitebrowser
i had to remove some chars off the beginning of each string,
STRINGS=$(strings preferences_storage | grep "==")
for i in $STRINGS; do
echo $i | base64 -d
done