Skip to content

Instantly share code, notes, and snippets.

@silageman
silageman / quam.py
Last active November 16, 2015 23:10
Image sequence recorder linux (requires ffmpeg)
# -*- coding: utf-8 -*-
#Requires ffmpeg, audio not working at the moment: silageman
import gtk.gdk
import time
import os
print '\033[1;33m ________ _______ _____ \033[1;m'
print '\033[1;33m / ____/ | \__ \ / \ \033[1;m'
print '\033[1;33m< <_| | | // __ \| Y Y \ \033[1;m'
print '\033[1;33m \__ |____/(____ /__|_| / \033[1;m'
@silageman
silageman / arduinocom.py
Created December 22, 2015 05:34
Serial communication to arduino, requires pyserial.
import serial
import time
import msvcrt
from msvcrt import getch
byte1 = 50
byte2 = 51
print "***********************************"
print "********Opening Serial Port********"
@silageman
silageman / atm.java
Created January 27, 2016 16:01
atm project file
import java.util.Scanner;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
import java.util.Scanner;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
@silageman
silageman / autossh.txt
Created September 10, 2017 14:46
autossh examples
Now that you are able to create various forward or reverse SSH tunnels with lots of options and even simplify your live with ~/.ssh/config you probably also want to know how make a tunnel persistent. By persistent I mean, that it is made sure the tunnel will always run. For example, once your ssh connection times out (By server-side timeout), your tunnel should be re-established automatically.
I know there are plenty of scripts out there which try to do that somehow. Some scripts use a while loop, others encourage you to run a remote command (such as tail) to make sure you don’t run into timeout and various others. But actually, you don’t want to re-invent the wheel and stick to bullet-proof already existing solutions. So the game-changer here is AutoSSH.
TL;DR
autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -L 5000:localhost:3306 [email protected]
or fully configured (via ~/.ssh/config) for background usage
autossh -M 0 -f -T -N cli-mysql-tunnel
@silageman
silageman / test.md
Created September 10, 2017 16:24
something

#hello world

@silageman
silageman / fart
Last active September 10, 2017 16:30
Hello!
<h1 id="welcome-to-stackedit">Welcome to StackEdit!</h1>
<p>Hey! I’m your first Markdown document in <strong>StackEdit</strong><a href="#fn:stackedit" id="fnref:stackedit" title="See footnote" class="footnote">1</a>. Don’t delete me, I’m very helpful! I can be recovered anyway in the <strong>Utils</strong> tab of the <i class="icon-cog"></i> <strong>Settings</strong> dialog.</p>
<hr>
<h2 id="documents">Documents</h2>
!
interface FastEthernet0/0
ip address 1.1.1.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 192.168.10.10 255.255.255.0
duplex auto
speed auto
!
!
interface FastEthernet0/0
ip address 1.1.1.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 192.168.20.20 255.255.255.0
duplex auto
@silageman
silageman / nat.txt
Created September 26, 2017 20:21
NAT
!
!
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 172.35.10.2 255.255.255.0