-
download & install go in your home dir
mkdir ~/src wget "https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz" tar -xvf go1.4.2.linux-amd64.tar.gz export GOROOT="$HOME/src/go" export PATH="$PATH:$GOROOT/bin"
-
create a directory where go would download & install packages using
go get
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# vim: sw=4 ts=4 et tw=100 cc=+1 | |
# | |
#################################################################################################### | |
# DESCRIPTION # | |
#################################################################################################### | |
# | |
# Decompressor/compressor for files in Mozilla's "mozLz4" format. Firefox uses this file format to | |
# compress e. g. bookmark backups (*.jsonlz4). | |
# |
jq will sort (-S
) the whole file (.
) and compare STDOUT (<()
) with diff
diff <(jq -S . A.json) <(jq -S . B.json)
Note: This gist may be outdated, thanks to all contributors in comments.
adb
is the Android CLI tool with which you can interact with your android device, from your PC
You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.
Don't hesitate to read comments, there is useful tips, thanks guys for this !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adb exec-out 'tar --dereference --create --exclude=sdcard/Android/data/com.spotify.music/ \ | |
sdcard/ 2>/sdcard/backup-errors.txt' | \ | |
dd of=backup-$(date +%Y%m%d).tar && \ | |
adb shell cat /sdcard/backup-errors.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function string:contains(sub) | |
return self:find(sub, 1, true) ~= nil | |
end | |
function string:startswith(start) | |
return self:sub(1, #start) == start | |
end | |
function string:endswith(ending) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
version=`git diff HEAD^..HEAD -- "$(git rev-parse --show-toplevel)"/package.json | grep -m 1 '^\+.*version' | sed -s 's/[^A-Z0-9\.\-]//g'` | |
if [[ ! $version =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)(\-[A-Z]+\.[0-9]+)?$ ]]; then | |
echo -e "Skip tag: invalid version '$version'" | |
exit 1 | |
fi | |
git tag -a "v$version" -m "`git log -1 --format=%s`" | |
echo "Created a new tag, v$version" |