Skip to content

Instantly share code, notes, and snippets.

View XenGi's full-sized avatar
☠️
🪄✨ hax hax

Ricardo Band XenGi

☠️
🪄✨ hax hax
View GitHub Profile
@jaseg
jaseg / README.md
Created April 28, 2014 10:55
systemd service file for running a transmission-daemon through OpenVPN

What is still missing

  • mullvad-up.sh as called from openvpn.conf would be unnecessary if openvpn would fork after setting up the tun interface, for then its contents could be realized with a few systemd ExecStartPost-directives.
  • Some means of automatically detecting and stopping/reconnecting a broken connection would be nice.
  • Due to libcurl being buggy, transmission-daemon leaks DNS requests. I don't mind, if you do, consider using a couple of iptables rules to route any packets coming from transmission's UID through a special routing table.
#!/usr/bin/python
# -*- coding: utf-8 -*-
import subprocess
__all__ = ["transform"]
__version__ = '0.3'
__author__ = 'Christoph Burgmer <cburgmer@ira.uka.de>'
__url__ = 'http://github.com/cburgmer/upsidedown'
@uwekamper
uwekamper / matelight.rb
Last active August 29, 2015 13:56
Matelight in Ruby
require 'socket'
# 3 colors by 30 pixels by 16 pixels + 4 bytes of checksum (which is never checked) = 1924 byts
frame = (1..1924).map{|x|"\xFF"} * ""
u1 = UDPSocket.new
u1.send a, 0, "matelight", 1337
# For the emulator use:
u1.send a, 0, "127.0.0.1", 1337
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
import socket
import colorsys # for HSV-to-RGB-conversion
UDP_IP = "10.0.0.200"
UDP_PORT = 1337
ROWS = 16
@XenGi
XenGi / application.py
Last active June 6, 2019 19:00
Example code for new python projects.
#!/usr/bin/env python3
"""
Application - The way to make things right.
Usage:
application.py arg1 [--arg2 <key>]
application.py (-h | --help)
application.py --version
@XenGi
XenGi / 99-displaymagic.rules
Last active September 18, 2021 02:11
display magic
#/etc/udev/rules.d/99-displaymagic.rules
# enable LVDS on HDMI disconnect
SUBSYSTEM=="drm", ACTION=="change", RUN+="/usr/local/bin/displaymagic.sh"
@jaseg
jaseg / README.md
Last active December 14, 2015 11:08
Greet your shell users like they were Kim Jong-il!

Put the following line in /etc/profile and put the attached titles file in /etc/.

echo Welcome `id -un`, `sort -R</etc/titles|head -n 1`!

The next time someone logs in, there will be an appropriate greeting:

/home/jaseg
&lt;3 ssh kim@my-awesome-server.example.net
@jirutka
jirutka / rules-both.iptables
Created September 18, 2012 12:42
Basic iptables template for ordinary servers (both IPv4 and IPv6)
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <jakub@jirutka.cz>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@brodul
brodul / streaming.sh
Created July 25, 2012 19:39
Twitch.tv script for streaming
#! /bin/bash
# originaly from http://tinyurl.com/twitch-linux from taladan
# www.youtube.com/user/taladan
# gist created by brodul
INRES="1280x800" # input resolution
#OUTRES="1024x640" # Output resolution
OUTRES="800x500" # Output resolution
alert('fuck you')