Skip to content

Instantly share code, notes, and snippets.

Avatar

Tobias Preuss johnjohndoe

View GitHub Profile
@johnjohndoe
johnjohndoe / android-shell-commands.md
Last active Aug 29, 2015
Android shell commands
View android-shell-commands.md

Convert file names to lowercase

$> for i in $(find . -type f -name "*[A-Z]*"); do mv "$i" "$(echo $i | tr A-Z a-z)"; done

Replace hyphen with underbar in all files

$> for i in $(find . -type f -name "*[a-z]*"); do mv "$i" "$(echo $i | tr '-' '_')"; done
@johnjohndoe
johnjohndoe / google.tsv
Created Jun 17, 2014
Layer information file for TileLayer Plugin, https://github.com/minorua/TileLayerPlugin
View google.tsv
gs gs http://mt3.google.com/vt/lyrs=s,h&z={z}&x={x}&y={y} 1 0 19
@johnjohndoe
johnjohndoe / pdf2csv.rb
Created Jul 4, 2014
Digitize tables in PDF to CSV
View pdf2csv.rb
require 'tabula'
pdf_file_path = "Abschiebungen.pdf"
outfilename = "Abschiebungen.csv"
out = open(outfilename, 'w')
extractor = Tabula::Extraction::ObjectExtractor.new(pdf_file_path, :all )
extractor.extract.each do |pdf_page|
pdf_page.spreadsheets.each do |spreadsheet|
@johnjohndoe
johnjohndoe / eclipse.desktop
Created Dec 3, 2014
Generic desktop file for Eclipse IDE in ~/.local/share/applications/
View eclipse.desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=Eclipse
Icon=/home/USERNAME/bin/eclipse/eclipse-highres.png
Exec=env UBUNTU_MENUPROXY=0 "/home/USERNAME/bin/eclipse/eclipse"
Comment=Eclipse
Categories=Development;IDE;
Terminal=false
StartupWMClass=
@johnjohndoe
johnjohndoe / schedule.xml
Last active Aug 29, 2015
31c3 schedule.xml
View schedule.xml
<?xml version='1.0' encoding='utf-8' ?>
<schedule>
<version>1.5 To shine in a bright light</version>
<conference>
<acronym>31c3</acronym>
<title>31. Chaos Communication Congress</title>
<start>2014-12-27</start>
<end>2014-12-31</end>
<days>4</days>
<timeslot_duration>00:05</timeslot_duration>
@johnjohndoe
johnjohndoe / simplehttpserver.py
Created Jan 6, 2015
HAS BUGS!! NOT WORKING!!! SimpleHTTPServer capable of receiving HTTP GET and HTTP POST
View simplehttpserver.py
#!/usr/bin/python
"""
Save this file as server.py
>>> python server.py 0.0.0.0 8001
serving on 0.0.0.0:8001
or simply
>>> python server.py
@johnjohndoe
johnjohndoe / geoserver.conf
Last active Aug 29, 2015
Upstart configuration for GeoServer
View geoserver.conf
# GeoServer
# /etc/init/geoserver.conf
description "GeoServer upstart configuration"
# Stanzas
# When to start the service
start on runlevel [2345]
View RevealDrawable.java
package com.pixite.fragment.widget;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Drawable.Callback;
import android.view.Gravity;
@johnjohndoe
johnjohndoe / myapplication.conf
Last active Aug 29, 2015
Upstart configuration for Django / Gunicorn project
View myapplication.conf
# Upstart configuration for Django project called "myapplication"
# ===============================================================
#
# Location: /etc/init/myapplication.conf
#
# Status: sudo service myapplication status
# Start: sudo service myapplication start
# Stop: sudo service myapplication stop
description "My application"