Skip to content

Instantly share code, notes, and snippets.

View rroemhild's full-sized avatar

Rafael Römhild rroemhild

View GitHub Profile
@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'));
@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*$')
@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
@yoelrc88
yoelrc88 / matrix-install.sh
Last active July 7, 2021 11:44
MATRIX Voice : Installing MATRIX Software and running HAL demos
##########
# PART 1 #
##########
# Add repo and key
curl https://apt.matrix.one/doc/apt-key.gpg | sudo apt-key add -
echo "deb https://apt.matrix.one/raspbian $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/matrixlabs.list
# Update packages and install
sudo apt-get update
@B-Galati
B-Galati / tmux.sh
Last active September 8, 2022 13:00
tmux script example
#!/bin/bash
tmux has-session -t dev
if [ $? != 0 ]
then
tmux new-session -s dev -n "TEST" -d
tmux split-window -h -t dev:0
tmux split-window -v -t dev:0.1
tmux send-keys -t dev:0.0 'cd ~/foo/bar' C-m
tmux send-keys -t dev:0.1 'autossh -M 0 -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" test@test -t "cd ~/bar;bash"' C-m
@nevercast
nevercast / pixels.py
Last active November 20, 2022 17:34
Simple MicroPython ESP32 RMT NeoPixel / WS2812B driver.
# Copyright public licence and also I don't care.
# 2020 Josh "NeverCast" Lloyd.
from micropython import const
from esp32 import RMT
# The peripheral clock is 80MHz or 12.5 nanoseconds per clock.
# The smallest precision of timing requried for neopixels is
# 0.35us, but I've decided to go with 0.05 microseconds or
# 50 nanoseconds. 50 nanoseconds = 12.5 * 4 clocks.
# By dividing the 80MHz clock by 4 we get a clock every 50 nanoseconds.
@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.

@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() {
@abeluck
abeluck / gpg-offline-master.md
Last active October 22, 2023 02:59 — forked from KenMacD/cmd.md
GPG Offline Master Key w/ smartcard
@huggre
huggre / let_there_be_light.py
Last active January 28, 2024 13:47
Integrating physical devices with IOTA and Python
# Imports some Python Date/Time functions
import time
import datetime
# Imports GPIO library
import RPi.GPIO as GPIO
# Imports the PyOTA library
from iota import Iota
from iota import Address