Skip to content

Instantly share code, notes, and snippets.

@BjoernSchilberg
BjoernSchilberg / README.md
Last active August 28, 2015 08:12
mpg123 keyboard control
-= terminal control keys =-
[s] or [ ] interrupt/restart playback (i.e. 'pause')
[f] next track
[d] previous track
[b] back to beginning of track
[p] pause while looping current sound chunk
[.] forward
[,] rewind
[:] fast forward
@BjoernSchilberg
BjoernSchilberg / minibrowser.c
Last active December 27, 2015 03:49
minibrowser
#include <webkit/webkit.h>
static void entry_activated (GtkEntry *entry, WebKitWebView *embed)
{
webkit_web_view_load_uri (embed, gtk_entry_get_text (entry));
}
int main (int argc, char** argv)
{
gtk_init (&argc, &argv);
/* Widgets and signals */
GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

Custom QGIS

Create customizationfile

The quickest way to get the ini file you need is exporting it from the the Settings -> Customization dialog. Once you have this ini file you can open and edit it to disable any widgets you don't need to see.

Load customizationfile

qgis --customizationfile qgis_custom.ini

Portable QGIS under Windows

@BjoernSchilberg
BjoernSchilberg / README.md
Last active September 8, 2017 18:04
Import videos and images stored on an SD card to the IPad

Import videos and images stored on an SD card to the IPad

Videos stored on an SD card can be imported with the Camera Connection Kit when formatted properly.

Formatting your SD card

First, you must set up your SD card. In order for the iPad to recognize your media files, it has to think that the card you store your media on is from a camera.

To do this, set the folder structure to something of the type created on a

@BjoernSchilberg
BjoernSchilberg / blindtiffs.go
Created November 1, 2017 12:37 — forked from s-l-teichmann/blindtiffs.go
A small tool to create a copy of a directory tree with all GeoTIFFs 'blinded' (all values zero) by gdal_calc.py preserving the meta data.
// blindtiffs
// ----------
// Usage: blindtiffs <src> <dst>
// Recursively copies folder <src> to folder <dst>.
// All GeoTIFFs in the source tree are 'blinded' by
// gdal_calc.py to have zero channels but still contain
// all the meta data.
//
// (c) 2017 by Sascha L. Teichmann
@BjoernSchilberg
BjoernSchilberg / xmlToJson.js
Created November 10, 2017 15:39 — forked from chinchang/xmlToJson.js
Function to convert XML to JSON
// Changes XML to JSON
// Modified version from here: http://davidwalsh.name/convert-xml-json
function xmlToJson(xml) {
// Create the return object
var obj = {};
if (xml.nodeType == 1) { // element
// do attributes
if (xml.attributes.length > 0) {
@BjoernSchilberg
BjoernSchilberg / bash_prompt.sh
Created November 30, 2017 09:13 — forked from gryf/bash_prompt.sh
Set color bash prompt according to active virtualenv, Git, Mercurial or Subversion branch and return status of last command.
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the active nodejs virtualenv[1]
# * the branch/status of the current Git, Mercurial or Subversion repository
# * the return value of the previous command
# * one line prompt
import requests
import csv
import datetime
import calendar
import time
i=0
# Change the range depending on how long you like to record the data
for i in range (0,50):
@BjoernSchilberg
BjoernSchilberg / rainymood.sh
Created May 11, 2018 11:04
A simple bash script to continuously listen to random tracks from @Rainymood in your terminal.
#!/bin/bash
# SOURCE: https://twitter.com/0x766c6164/status/967741716106219520
# WEBSITE: http://rainymood.com/
# TWITTER: https://twitter.com/RainyMood
rainymood(){
FILE=$((RANDOM%4)) # only found 3 items :v
URL="https://rainymood.com/audio1110/${FILE}.ogg"
mpv "$URL" && rainymood