Skip to content

Instantly share code, notes, and snippets.

View vaijab's full-sized avatar

Vaidas Jablonskis vaijab

View GitHub Profile
#cloud-config
users:
- name: foo
passwd: $6$5s2u6/jR$un0AvWnqilcgaNB3Mkxd5yYv6mTlWfOoCYHZmfi3LDKVltj.E8XNKE
groups:
- sudo
- docker
ssh-authorized-keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0g+ZTxC7weoIJLUafOgrm+
@vaijab
vaijab / btwifi-autologin.service
Last active August 29, 2015 14:24
BTWifi auto login
[Unit]
Description=BT Wifi auto login hack
After=network.target
[Service]
Restart=always
RestartSec=30
ExecStart=/home/vaijab/bin/btwifi_autologin.sh
[Install]
### Keybase proof
I hereby claim:
* I am vaijab on github.
* I am vaijab (https://keybase.io/vaijab) on keybase.
* I have a public key whose fingerprint is 8B85 568C BB82 3F47 9866 7A8C DCA0 ECDC FC69 7983
To claim this, I am signing this object:
#!/usr/bin/bash
files="*.service"
for fname in ${files}; do
[[ -e ${fname} ]] || continue
read -r h f <<< $(md5sum ${fname})
echo ""${f/%.service/@${h}.service}""
done
for n in $(docker ps -a | awk '/Exited \([0-9]*/ {print $1}'); do docker rm -f -v ${n}; done
docker rmi $(docker images | awk '/^<none>/ {print $3}')
wget -q https://github.com/chadoe/docker-cleanup-volumes/raw/master/docker-cleanup-volumes.sh
bash docker-cleanup-volumes.sh -v
# shows git branch if any
function git_branch {
if [[ -x /usr/bin/git ]]; then
git branch &> /dev/null
if [[ $? == 0 ]]; then
branch=$(git branch | awk '/^\* / {print $2}')
echo -n "($branch) "
fi
fi
}
CGI::Lite - built "libcgi-lite-perl"
Mail::Mailer - in repo "libmailtools-perl"
Data::GUID - backported "libdata-guid-perl"
Text::CSV - in repo "libtext-csv-perl"
JSON - in repo "libjson-perl"
Proc::ProcessTable - in repo "libproc-processtable-perl"
Authen::SASL - in repo "libauthen-sasl-perl"
URI::Escape::XS - in repo "liburi-escape-xs-perl"
YAML - in repo "libyaml-perl"
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAyQjhtz0tZyJSztECvRixSZNSRg89Cog25z5bZNEYzHWwzAM/Jr0Rm1+0J3VI+AFazS2spEeMLYUcxw9HcHceZeY/DaSleomwRGGsc5pAiOldcVMEBH8e6FhPymxVqNyICXIkSCiS5T/5zGtC25FCi/uCnyf+PMZyQWucoM6Hs4RI63A5TFaQFA4qCnVx2N6RTg9ETIqGaMRQSv+Sc4mT0+mXtGi1u9+QHT2poUPP1SsYBCx00GbjKYYRt9KfbZgpQs5h5exsPIGPAlBwhibF0R4PWZ/WwIWJ2cB/83nUPSz8VK0rWjb0ZW0dWO8n6dQIVNTQoQW3j4sl8pM2HxI1hw== zooz@personal
@vaijab
vaijab / dir2indexhtml.sh
Created December 28, 2015 21:26
Create index.html file listing from a given directory
#!/usr/bin/bash
if [[ -d ${1} ]]; then
path="${1}/"
files="${path}*"
elif [[ -f ${1} ]]; then
files="${1}"
# Else fallback to finding files in current directory
elif [[ ${#} -eq 0 ]]; then
files="*"
@vaijab
vaijab / etcd2-restore.sh
Created January 7, 2016 22:21
etcd2 data restore script
#!/usr/bin/bash
: ${1?"etcd2 protocol has not been set. Specify http or https as first argument."}
: ${2?"etcd2 data dir has not been set. Specify as second argument."}
source /etc/environment
sudo systemctl stop etcd2.service
sudo rm -rf ${2}/member