Skip to content

Instantly share code, notes, and snippets.

View moregeek's full-sized avatar

Stefan Morgenthaler moregeek

View GitHub Profile
@coderofsalvation
coderofsalvation / restconsole.bash
Created April 2, 2014 21:32
restconsole, a simple curl REST api wrapper for bash
#!/bin/bash
# author: Leon van Kammen / Coder of Salvation 2014
#
# restconsole, a simple curl REST api wrapper for bash
rooturl="http://api.yourcompany.com"
apikey="e270f99745341a89e883c583a25b821c"
cache=()
# here you can define your preset calls
@blacktm
blacktm / install_ruby_rpi.sh
Last active November 28, 2024 20:35
A Bash script to install Ruby on the Raspberry Pi
#!/bin/bash
# --------------------------------------------------------------------------------------------
# Installs Ruby using rbenv/ruby-build on the Raspberry Pi (Raspbian)
#
# Run from the web:
# bash <(curl -s https://gist.githubusercontent.com/blacktm/8302741/raw/install_ruby_rpi.sh)
# --------------------------------------------------------------------------------------------
# Set the Ruby version you want to install
@GianlucaGuarini
GianlucaGuarini / post-merge
Last active February 13, 2025 13:38 — forked from sindresorhus/post-merge
Git hook that gets triggered after any 'git pull' whenever one of the files specified has changed. Useful to update any web application dependency using bower npm or composer
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# forked by Gianluca Guarini
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep -E --quiet "$1" && eval "$2"
}
obj-m += rootkit.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
@EmbeddedAndroid
EmbeddedAndroid / qemu-ifup
Created September 15, 2013 17:24
Mac OSX (10.8.X) /etc/qemu-ifup script for QEMU/KVM bridged networking.
#!/bin/bash
echo "Executing /etc/qemu-ifup"
echo "Creating bridge"
sysctl -w net.link.ether.inet.proxyall=1
sysctl -w net.inet.ip.forwarding=1
sysctl -w net.inet.ip.fw.enable=1
ifconfig bridge0 create
echo "Bringing up $1 for bridged mode"
ifconfig $1 0.0.0.0 up
echo "Add $1 to bridge"
@pixelhandler
pixelhandler / pre-push.sh
Last active July 2, 2024 11:27
Git pre-push hook to prevent force pushing master branch
#!/bin/sh
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# Steps to install, from the root directory of your repo...
# 1. Copy the file into your repo at `.git/hooks/pre-push`
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push`
@benbalter
benbalter / gist.md
Last active October 15, 2024 15:32
Example of how to embed a Gist on GitHub Pages using Jekyll.

Here's an example of how to embed a Gist on GitHub Pages:

{% gist 5555251 %}

All you need to do is copy and paste the Gist's ID from the URL (here 5555251), and add it to a gist tag surrounded by {% and %}.

@rcmorano
rcmorano / chef-server-bootstrap.sh
Last active January 4, 2016 14:48
Debian 'chef-server' bootstrap script that deploys with rvm, librarian (automagical cookbook download) and chef-solo. It's supposed to be easily maintenable since it completely relays on community cookbooks :] COPY PASTE: wget -O /tmp/bootstrap.tgz https://gist.github.com/rcmorano/5056474/download; bash /tmp/$(tar zxvf /tmp/bootstrap.tgz -C /tmp…
#!/bin/bash
CHEF_REPO=/var/lib/chef-repo
CHEF_FILE=/tmp/Cheffile; test -d $(dirname $CHEF_FILE) || mkdir -p $(dirname $CHEF_FILE)
SOLO_RB=/etc/chef/solo.rb; test -d $(dirname $SOLO_RB) || mkdir -p $(dirname $SOLO_RB)
SOLO_JSON=/etc/chef/solo.json; test -d $(dirname $SOLO_JSON) || mkdir -p $(dirname $SOLO_JSON)
GEM_PREDEPENDS="librarian chef"
RVM_RUBY_VER=1.9.2
# changed rvm installation from rvm-cookbook to rvm.io scripts again
@sedm0784
sedm0784 / CapsLockCtrlEscape.ahk
Last active April 11, 2025 12:38
AutoHotkey script to map Caps Lock to Escape when it's pressed on its own and Ctrl when used in combination with another key, à la Steve Losh. Adapted from one that does something similar with the Ctrl Key on the Vim Tips Wiki (http://vim.wikia.com/wiki/Map_caps_lock_to_escape_in_Windows?oldid=32281). (Plus contribs from @randy909 & @mmikeww.)
g_LastCtrlKeyDownTime := 0
g_AbortSendEsc := false
g_ControlRepeatDetected := false
*CapsLock::
if (g_ControlRepeatDetected)
{
return
}
@puppe
puppe / absender.lco
Last active July 30, 2023 20:14
Deutsche Briefvorlage für LaTeX (scrlttr2) (ACHTUNG: Aktualisierte Version jetzt unter https://codeberg.org/puppe/german-latex-letter-template/)
\ProvidesFile{absender.lco}
\KOMAoptions{%
% fromemail=true, % Email wird im Briefkopf angezeigt
% fromphone=true, % Telefonnumer wird im Briefkopf angezeigt
% fromfax=true, % Faxnummer wird im Briefkopf angezeit
% fromurl=true, % URL wird im Briefkopf angezeigt
% fromlogo=true, % Logo wird im Briefkopf angezeigt
% subject=titled, % Druckt "Betrifft: " vor dem Betreff
locfield=wide, % Breite Absenderergänzung (location)