I hereby claim:
- I am thomascrepain on github.
- I am thomascrepain (https://keybase.io/thomascrepain) on keybase.
- I have a public key ASA0GbIhixMs46JzyUDRonhn3bu7tqUzZqn1aBTv6-SVvwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| source: http://adbshell.com/commands | |
| # Link to phone | |
| adb devices | |
| adb shell | |
| # Download file from phone | |
| adb pull /sdcard/path/to/file | |
| # Download multiple files from phone |
| #!/bin/bash | |
| # Installs the bare minimum to start a docker container on a Raspberry Pi. Make sure you start from a fresh copy of Raspbian (light) | |
| # See: https://www.raspberrypi.org/downloads/raspbian/ | |
| # | |
| # Run this script as sudo | |
| # Install docker | |
| curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh |
Calculate distance, bearing and more between Latitude/Longitude points http://www.movable-type.co.uk/scripts/latlong.html
-- Spherical Law of Cosines: calculate distance to other points
SET @lat = 51.053283, @lon = 3.720359;
SELECT *
FROM (
SELECT
*,
| wget --spider -w 1 -r -p http://www.example.com 2>&1 | grep -B 2 -E '\.\.\. [45]\d{2}' | |
| Use access log on the webserver to check for the referrer on the broken links: | |
| tail -f access.log | grep -E 'HTTP/1.1" [45]\d{2}' |
| <?php | |
| /** | |
| * Class Timer | |
| */ | |
| class Timer | |
| { | |
| /** | |
| * @var float|null | |
| */ | |
| protected $startTime; |
Install Cygwin (http://www.cygwin.com/)
Download the RubyGems tarball from Ruby Forge (https://rubygems.org/pages/download)
In a bash terminal, navigate to the unpacked directory and run:
| # Search & replace over multiple files (Linux) | |
| find . -type f -print0 | xargs -0 sed -i 's/foo/bar/g' | |
| # Search & replace over multiple files (Mac OS X) | |
| find . -type f -print0 | xargs -0 sed -i '' -e 's/foo/bar/g' | |
| # remove empty files in a directory | |
| find /tmp -size 0 -print0 |xargs -0 rm | |
| # Run command in multiple directories | |
| for dir in ./*; do (cd "$dir" && echo "$dir" && cowsay "boo"); done |
| # Ignore everything in this directory | |
| * | |
| # Except this file | |
| !.gitignore |
| # refresh remote branches | |
| git fetch -p | |
| # checkout remote branch | |
| git checkout -t origin/branchname | |
| # delete local branch | |
| git branch -d branchname | |
| # list remote branch |