Skip to content

Instantly share code, notes, and snippets.

View brancz's full-sized avatar
❄️
Something something Polar Signals

Frederic Branczyk brancz

❄️
Something something Polar Signals
View GitHub Profile
@brancz
brancz / gist:9209241
Last active August 29, 2015 13:56
copy changeset since given git commit without java class files
#!/bin/sh
git --no-pager diff --name-only $1 | grep -v class | xargs -i cp --parents -p "{}" $2
@brancz
brancz / gist:9629955
Created March 18, 2014 21:22
I recently wanted to check my config in all my git repositories. Since I keep them all in ~/git I could easily use the following few lines of shell.
#!/bin/sh
CWD=`pwd`
for i in `find . -type d -maxdepth 1`; do
cd $i
git config user.user
git config user.email
cd $CWD
done
@brancz
brancz / gist:9995624
Created April 5, 2014 18:04
command to ssh into vagrant machine and tunnel port 1080 for mailcatcher
ssh -p 2222 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=ERROR -o IdentitiesOnly=yes -i ~/.vagrant.d/insecure_private_key vagrant@127.0.0.1 -L 1080:127.0.0.1:1080
@brancz
brancz / gist:9fb3e28ad02f96bce7de
Created July 14, 2014 16:31
expand tabs to 4 spaces for all js files in directory
find . -name '*.js' ! -type d -exec bash -c 'expand -t 4 "$0" > /tmp/e && mv /tmp/e "$0"' {} \;
@brancz
brancz / gist:9665603a62f0057bf596
Created April 15, 2015 11:29
boot2docker reconfigure dns
sudo udhcpc

Keybase proof

I hereby claim:

  • I am flower-pot on github.
  • I am flowerpot (https://keybase.io/flowerpot) on keybase.
  • I have a public key whose fingerprint is 8D36 44B7 F750 109B 8D95 868D 5437 E27D 05D2 D484

To claim this, I am signing this object:

@brancz
brancz / gist:527697ed71255933bc84
Created July 11, 2015 14:13
build osx .dmg for jruby application
jar:
rvm jruby
rm Gemfile.lock
bundle install --without test
mkdir -p pkg/dist
warble
osx: jar
javapackager -deploy -native dmg -outdir pkg -outfile duse -srcdir pkg/dist -srcfiles duse.rb.jar -appclass JarMain -name "duse" -title "duse"
@brancz
brancz / gist:0ec12891b6bbe809f72c
Created August 5, 2015 17:35
single host rancher setup
docker run --name rancher-mysql -v /data/docker/rancher/mysql:/var/lib/mysql --restart=always -d \
-e MYSQL_ROOT_PASSWORD=my-secret-pw \
-e MYSQL_USER=rancher \
-e MYSQL_PASSWORD=my-secret-pw \
-e MYSQL_DATABASE=rancher \
mysql
docker run --name rancher-server -d --restart=always --link rancher-mysql:mysql -p 80:8080 \
-e CATTLE_DB_CATTLE_MYSQL_HOST=$MYSQL_PORT_3306_TCP_ADDR \
-e CATTLE_DB_CATTLE_MYSQL_PORT=3306 \
### Keybase proof
I hereby claim:
* I am flower-pot on github.
* I am flowerpot (https://keybase.io/flowerpot) on keybase.
* I have a public key whose fingerprint is 0010 24B2 4B55 88EE CEBD A645 2585 556B 0604 C640
To claim this, I am signing this object:
@brancz
brancz / gist:2a7a1a65d5e0d66ece99
Created December 14, 2015 13:45
git accumulated stats
git diff --numstat --pretty="%H" master | awk 'NF==3 {plus+=$1; minus+=$2} END {printf("+%d, -%d\n", plus, minus)}'