Skip to content

Instantly share code, notes, and snippets.

View mount.sh
# mount overlay filesystem
sudo mount -t aufs -o br=/var/rsapi-test-photos:/media/peter/Backup/railway-stations.org/fotos none /tmp/railway-station-photos
# mount webdav
sudo mount -t davfs davs://cloud.railway-stations.org/remote.php/webdav/RSAPI-Test /home/peter/rsapi-test
@pstorch
pstorch / rsapi.sql
Created Jan 12, 2020
RSAPI DB Queries
View rsapi.sql
-- photographers by number of countries
SELECT u.name, count(distinct countrycode) as countries FROM `photos` p join users u on u.id = p.photographerid group by photographerid order by count(distinct countrycode) desc
@pstorch
pstorch / .zshrc
Created Sep 19, 2018
Git fetch pull request
View .zshrc
git_fetch_pull_request() {
git fetch origin refs/pull/$1/head:pr/$1
git checkout pr/$1
}
alias gpr='git_fetch_pull_request'
@pstorch
pstorch / cgeodb.sh
Created Jan 6, 2017
Get sqlite file from android app via adb (non root), example for cgeo app
View cgeodb.sh
#!/bin/sh
adb -d shell "run-as cgeo.geocaching cp /data/data/cgeo.geocaching/databases/data /sdcard/cgeo.sqlite"
adb pull /sdcard/cgeo.sqlite
@pstorch
pstorch / schemacrawler2svg.sh
Created Jan 4, 2017
SchemaCrawler svg output
View schemacrawler2svg.sh
#!/bin/sh
#https://github.com/sualeh/SchemaCrawler
./schemacrawler.sh -c=graph -url=jdbc:sqlite:cgeo.sqlite -loglevel=CONFIG -infolevel=detailed -u=cgeo -outputformat=svg
View keybase.md

Keybase proof

I hereby claim:

  • I am pstorch on github.
  • I am peterstorch (https://keybase.io/peterstorch) on keybase.
  • I have a public key whose fingerprint is 954B A42D D4F4 E077 17D5 0400 1199 A722 4849 EA65

To claim this, I am signing this object:

@pstorch
pstorch / findInFiles.sh
Created Jun 27, 2016
find a text in files recursively
View findInFiles.sh
grep --include=\*.java -rnw . -e "pattern"
@pstorch
pstorch / chsh_zsh_winbind
Created Jun 20, 2016
Change login shell to zsh when ldap login via winbind is used
View chsh_zsh_winbind
echo template shell = /bin/zsh | sudo tee /etc/samba/smb.conf.local; sudo service winbind restart
@pstorch
pstorch / amazon-instance-packer.json
Last active Jan 27, 2017
Provision AWS Ubuntu AMI for packer.io with amazon-instance builder. If you have Problems with ec2-ami-tools: "ec2-bundle-vol command not found".
View amazon-instance-packer.json
{
"variables": {
"aws_access_key": "",
"aws_secret_key": ""
},
"builders": [{
"type": "amazon-instance",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"account_id": "<<YOUR_ACCOUNT_ID>>",