Skip to content

Instantly share code, notes, and snippets.

View gorillamoe's full-sized avatar
:octocat:
🦍🍌

Marco Kellershoff gorillamoe

:octocat:
🦍🍌
View GitHub Profile
@gorillamoe
gorillamoe / 10-evdev.conf
Created October 20, 2014 10:38
Linux X11 German Umlauts with US International Keyboard
#/etc/X11/xorg.conf.d/10-evdev.conf
Section "InputClass"
Identifier "evdev keyboard catchall"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "Xkb_Layout" "us"
@gorillamoe
gorillamoe / wajit-vanilla-mode.js
Created December 4, 2014 16:46
Wajit - Vanilla Mode Example
// require https://code.jquery.com/jquery-2.1.1.min.js
// require js/my_cool_script.js
var moo = function () {
window.console.log(jQuery);
}
moo();
@gorillamoe
gorillamoe / chrome-apps-launcher.desktop
Created November 18, 2015 08:21
Google Chrome / Chromium Apps Launcher Gnome (Linux) Shortcut (put in ~/.local/share/applications/)
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Name=Chrome Apps Launcher
Comment=Unofficial desktop shortcut for Google Chrome's / Chromium's App Launcher
Exec=/usr/bin/chromium --show-app-list
Icon=/usr/share/icons/hicolor/256x256/apps/chromium.png
Terminal=false
Type=Application
Categories=Network;
@gorillamoe
gorillamoe / vim-noexpandtab-2.vim
Created May 23, 2016 07:55
Vim settings for 2 spaces tabs
set tabstop=4 softtabstop=0 noexpandtab shiftwidth=2 smarttab
@gorillamoe
gorillamoe / defaultOptsHandling.js
Created December 29, 2016 11:19
Sane handling of default opts
/*jshint esversion: 6 */
// Meet the AwesomeClass
class AwesomeClass {
constructor(opts) {
}
static defaultOpts(opts, default_opts) {
var new_opts = default_opts;
if (opts) {
for (var property in default_opts) {
if (default_opts.hasOwnProperty(property)) {
@gorillamoe
gorillamoe / sane-shell-script.bash
Created March 16, 2017 14:27
Sane Shell Scripting Skeleton
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
readonly LOG_FILE="/tmp/$(basename "$0").log"
info() { echo "[INFO] $@" | tee -a "$LOG_FILE" >&2 ; }
warning() { echo "[WARNING] $@" | tee -a "$LOG_FILE" >&2 ; }
error() { echo "[ERROR] $@" | tee -a "$LOG_FILE" >&2 ; }
fatal() { echo "[FATAL] $@" | tee -a "$LOG_FILE" >&2 ; exit 1 ; }
@gorillamoe
gorillamoe / convert-webm-to-gif.bash
Created November 17, 2017 16:30
Convert webm movies to GIF
#!/bin/bash
main() {
if [[ -z $1 ]];
then
printf "Input file required\n"
exit 1
else
local inputfile="$1"
fi
@gorillamoe
gorillamoe / install-tmux.sh
Created December 14, 2017 15:37 — forked from pokev25/install-tmux.sh
Install tmux 2.3 on rhel/centos 6
# Install tmux on Centos release 6.5
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -OL https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
tar -xf libevent-2.0.22-stable.tar.gz
cd libevent-2.0.22-stable
./configure --prefix=/usr/local
@gorillamoe
gorillamoe / ffmpeg-concat.bash
Created December 21, 2017 19:13
Concat (media) files with ffmpeg
#!/bin/bash
get_all_files() {
local argc=$#
local argv=($@)
for (( j=0; j<argc-1; j++ )); do
echo file $PWD/${argv[j]}
done
}
@gorillamoe
gorillamoe / reboot-telekom-speedport.bash
Created December 23, 2017 20:10
Reboot/Restart Telekom Speedport
#!/bin/bash
# Usage:
# ./reboot-telekom-speedport.bash "URL or IP of speedport" "password of speedport"
# Example:
# ./reboot-telekom-speedport.bash "http://192.168.2.1" "aBcDEf1337GHijk"
main() {
local speedport
local devpwd