Skip to content

Instantly share code, notes, and snippets.

View rroemhild's full-sized avatar

Rafael Römhild rroemhild

View GitHub Profile
@abeluck
abeluck / gpg-offline-master.md
Last active October 22, 2023 02:59 — forked from KenMacD/cmd.md
GPG Offline Master Key w/ smartcard
@MrDys
MrDys / gist:3512455
Created August 29, 2012 13:26
Link directly to an open modal window in Bootstrap
/* If you've ever had the need to link directly to an open modal window with Bootstrap, here's a quick and easy way to do it:
Make sure your modal has an id:
<div class="modal" id="myModal" ... >
Then stick this bit of Javascript at at the end of your document:
*/
$(document).ready(function() {
@kinkerl
kinkerl / icinga2json.py
Last active December 16, 2015 02:19
converts icinga status files (*.dat) to a json file.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import json
tobj = list()
statusfile = 'serverstatus.dat'
statusfile_output = 'serverstatus.json'
currentobj = dict()
reg = re.compile(r'^\s*$')
@rofl0r
rofl0r / init.c
Created August 6, 2013 21:15
minimal init daemon by rich felker, author of musl libc
#define _XOPEN_SOURCE 700
#include <signal.h>
#include <unistd.h>
int main()
{
sigset_t set;
int status;
if (getpid() != 1) return 1;
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@sloria
sloria / bobp-python.md
Last active May 1, 2024 08:37
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@rubencaro
rubencaro / install_elixir.md
Last active September 30, 2023 03:58
Elixir installation guide

Elixir installation guide

Version numbers should be the ones you want. Here I do it with the last ones available at the moment of writing.

The simplest way to install elixir is using your package manager. Sadly, at the time of writing only Fedora shows the intention to keep its packages up to date. There you can simply sudo dnf install erlang elixir and you are good to go.

Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to a specific version, you will need to compile it yourself. Then asdf is your best friend.

@blizzz
blizzz / getUserGroupMemberships.php
Created November 21, 2014 11:08
displays groups belonging to a specified user and users belonging to a specified group
<?php
if($argc !== 3) {
print('Usage: php -f ' . $argv[0] . ' UID GID' . PHP_EOL);
die;
}
require_once 'lib/base.php';
\OC_App::loadApps(array('authentication'));
@gabstv
gabstv / cvwebv.sh
Last active January 12, 2019 05:57
Convert videos to HTML5 friendly video formats (mp4, ogg and webm).
#!/bin/bash
# For this to work, you need to have ffmpeg
# installed with libvorbis, theora and libvpx ENABLED
# to do that in Homebrew:
# brew reinstall ffmpeg --with-libvpx --with-libvorbis --with-theora
#
# encoding reference:
# https://blog.mediacru.sh/2013/12/23/The-right-way-to-encode-HTML5-video.html
@phrawzty
phrawzty / 2serv.py
Last active May 2, 2024 12:27
simple python http server to dump request headers
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import logging
PORT = 8000
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):