Skip to content

Instantly share code, notes, and snippets.

View ArseniyShestakov's full-sized avatar

Arseniy Shestakov ArseniyShestakov

View GitHub Profile
@ArseniyShestakov
ArseniyShestakov / client.conf
Last active October 8, 2016 01:55
OpenVPN config without HMAC
client
dev tun
proto tcp
remote 1.2.3.4 443
ca ca.crt
cert client1.crt
key client1.key
resolv-retry infinite
@ArseniyShestakov
ArseniyShestakov / README
Created December 28, 2014 17:51
SteamCMD script to install PA headless
You need to do this:
1 - Download SteamCMD for Windows:
http://media.steampowered.com/installer/steamcmd.zip
2 - Extract it.
Now in directory with SteamCMD save script.cmd
3 - Now run it from console this way:
steamcmd +runscript script.cmd
More details about SteamCMD available here:
@ArseniyShestakov
ArseniyShestakov / list.txt
Last active August 29, 2015 14:16
Intel OTC developers
For this comment on reddit:
http://www.reddit.com/r/linux_gaming/comments/2xd0sr/eli5_why_is_the_performance_of_open_source_video/
Intel OTC Mesa:
http://cgit.freedesktop.org/mesa/mesa/log/?qt=grep&q=intel.com
abdiel.janulgue@linux.intel.com
benjamin.widawsky@intel.com
chad.versace@intel.com
connor.abbott@intel.com
damien.lespiau@intel.com
@ArseniyShestakov
ArseniyShestakov / pre.sh
Created March 15, 2015 06:17
QEMU configuration
#!/bin/sh
modprobe vfio-pci
service lightdm stop
echo "1002 6719" > /sys/bus/pci/drivers/vfio-pci/new_id
echo "0000:01:00.0" > /sys/bus/pci/devices/0000:01:00.0/driver/unbind
echo "0000:01:00.0" > /sys/bus/pci/drivers/vfio-pci/bind
echo "1002 6719" > /sys/bus/pci/drivers/vfio-pci/remove_id
echo "1002 aa80" > /sys/bus/pci/drivers/vfio-pci/new_id
@ArseniyShestakov
ArseniyShestakov / winxp.sh
Created March 15, 2015 10:32
Windows XP QEMU
qemu-system-x86_64 \
-bios /usr/share/qemu/bios.bin \
-enable-kvm \
\
-name "winxp" \
\
-M pc \
\
-cpu host \
-smp 2,sockets=1,cores=2,threads=1 \
@ArseniyShestakov
ArseniyShestakov / ig7icd32.dll.txt
Last active August 29, 2015 14:18
Android IA: proprietary EGL UFO strings
!This program cannot be run in DOS mode.
VMRich
.text
`.rdata
@.data
.tls
.rsrc
@.reloc
h bE
h0bE
@ArseniyShestakov
ArseniyShestakov / README
Created May 9, 2015 00:27
Unencrypted unauthenticated OpenVPN configuration
Funny to say, but it's hard to setup insecure VPN. In this case I have router running under OpenWRT with 4MB flash only so it's only possible to include "openvpn-nossl" in firmware. That was easy part, but hard part was to find out what configuration I need to use to avoid SSL usage as I really don't want to compile my own openvpn package on server.
As I find out that is almost no information on internet about this use case, but after few hours of google-fu and source reading I finally setup configuration that actually work. There is none important data going to be transferred over network and security unimportant. Though I wish to add some basic PAM authentification in future, but for now it's not really needed.
@ArseniyShestakov
ArseniyShestakov / colors.py
Created May 12, 2015 21:43
Simple Python script for monitor testing: show one color fullscreen
# Based off snippet:
# http://unix.stackexchange.com/questions/195910/start-a-single-color-full-screen-from-the-terminal
import gtk
import sys
from itertools import cycle
def color(widget, event):
colors = ['#FFFFFF', '#000000', '#FF0000', '#0000FF', '#008000', '#FFFF00']
color.idx = (color.idx + 1) % len(colors)
w.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(colors[color.idx]))
@ArseniyShestakov
ArseniyShestakov / images.py
Created June 29, 2015 22:06
Simple Python script for monitor testing: show images fullscreen
#!/usr/bin/env python
# https://gist.github.com/ArseniyShestakov/969f27d4a2437fe60cd1
import os, sys, gtk, argparse
from os import path
from itertools import cycle
# Check command line options
parser = argparse.ArgumentParser(description='Simple fullscreen image view')
parser.add_argument('imagedir', nargs='?', default=path.join(os.getcwd(), "img"), help="directory with background images")
parser.add_argument('-a', '--noauto', action="store_false", help="disable auto rotation")
@ArseniyShestakov
ArseniyShestakov / console_tricks
Last active August 29, 2015 14:24
Different console tricks to remember
# Lazy TCP port forwarding on localhost
autossh -M 0 -f -N -R 34567:192.168.1.150:34567 localhost
## Proper port forwarding from server to internal subnet
# Allow forwarding on external interface (eth0)
iptables -A FORWARD --in-interface eth0 -j ACCEPT
# Add masquerade for internal OpenVPN interface (tun0)
iptables -t nat -A POSTROUTING --out-interface tun0 -j MASQUERADE
# Forward from public ip port 8080 to internal port 80
iptables -t nat -A PREROUTING -p tcp -i eth0 -m tcp --dport 8080 -j DNAT --to-destination 192.168.1.150:80