Skip to content

Instantly share code, notes, and snippets.

@vsefer
vsefer / obs-debian
Last active September 26, 2017 01:40
OBS on Debian Testing from Ubuntu repo
sudo apt-get remove libobs* --purge
sudo apt-get remove obs-studio --purge
sudo add-apt-repository ppa:obsproject/obs-studio
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EFC71127F425E228
sudo apt-get update
sudo apt-get -t artfull install obs-studio
obs --version
@vsefer
vsefer / ws2812-arduino-serial.ino
Created August 21, 2017 23:32
Control WS2812 RGB strip with Arduino via serial port and change the color of the whole strip at the same time.
#include <Adafruit_NeoPixel.h>
// Which pin on the Arduino is connected to the NeoPixels?
#define PIN 6
// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS 30
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
#!/bin/bash
free_data="$(free)"
mem_data="$(echo "$free_data" | grep 'Mem:')"
free_mem="$(echo "$mem_data" | awk '{print $4}')"
buffers="$(echo "$mem_data" | awk '{print $6}')"
cache="$(echo "$mem_data" | awk '{print $7}')"
total_free=$((free_mem + buffers + cache))
used_swap="$(echo "$free_data" | grep 'Swap:' | awk '{print $3}')"
@vsefer
vsefer / pxeboot-openwrt-grml.md
Last active April 4, 2022 15:42
PXEboot with OpenWRT and TP-Link WDR-4300

Local setup:

Create working directory:

mkdir ~/pxeboot
cd ~/pxeboot

Download grml netboot version:

@vsefer
vsefer / htz-bashrc
Created June 3, 2015 09:11
Bash config from Hetzner
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@vsefer
vsefer / wheezy-to-jessie.md
Last active August 29, 2015 14:07
wheezy-to-jessie

Edit apt-sources file

Use this generator -> http://debgen.simplylinux.ch/

Edit sources.list file

root@mpd:# vim /etc/apt/sources.list

Copy/paste following code

@vsefer
vsefer / firewall.user
Created September 17, 2014 01:40
Firewall config for OpenWrt to tunnel all traffic to VPN with OpenVPN
iptables -I OUTPUT -o tun+ -j ACCEPT
iptables -I INPUT -i tun+ -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -I FORWARD -o tun+ -j ACCEPT
iptables -I FORWARD -i tun+ -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -I POSTROUTING -o tun+ -j MASQUERADE
@vsefer
vsefer / nginx.conf
Created August 12, 2014 14:13
nginx configuration file
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}