Skip to content

Instantly share code, notes, and snippets.

@miebach
miebach / Watir on windows
Created July 7, 2012 18:50
Watir on windows
Watir installation on windows
(following more or less https://github.com/zeljkofilipin/watirbook/blob/master/installation/windows.md )
1) go to http://rubyinstaller.org/downloads and downloaad latest RubyInstaller and the "development kit"
2) Execute RubyInstaller, installing to c:\Ruby - add to path -> yes
3) Unpack devcelopment kit to c:\Ruby\devkit
@miebach
miebach / host_up_ping_nt.rb
Created July 7, 2012 21:17
Ruby function to detect if a host is up by pinging it
def host_up_ping_nt?(host)
# Checks if a host is up by pinging it.
# Version for windows. See "man ping" for other systems.
# inspired by http://stackoverflow.com/a/3561831/362951
ping_max_try = 10
cmd = "ping -n 1 #{host}"
#puts cmd
isup = false
ping_max_try.times do
result = `#{cmd}`
@miebach
miebach / iptables
Created July 8, 2012 18:58
/etc/init.d/iptables
#!/bin/bash
# see http://serverfault.com/a/363745/45819
start() {
echo "Starting iptables."
EXT="eth0"
TUNNELS="tun+"
iptables -F
@miebach
miebach / gist:3075297
Created July 9, 2012 09:17
Start google chrome in headless mode
http://stackoverflow.com/questions/9210765/any-way-to-start-google-chrome-in-headless-mode
http://e-method.blogspot.co.uk/2010/11/google-chrome-with-xvfb-headless-server.html
Install xvfb:
sudo aptitude install xvfb
Normal start:
@miebach
miebach / git-vlog
Created July 29, 2012 08:48 — forked from asabaylus/git-vlog
Git visual log for the console
http://www.baylus.com/a-nice-visual-log-for-git-command-line/
A nice visual log for Git command line
I like having a quick visual log for Gits command line. Here’s a little git alias which’ll display a brief and colorful summary for your projects.
Enter the following code in terminal or git bash.
You can now generate a visual tree style log, open your shell
@miebach
miebach / howto.txt
Created August 7, 2012 22:47
Install the latest monit on ubuntu
sudo aptitude install monit
sudo aptitude remove monit
Now we have the basic config and the init script.
Download the latest monit source and untar.
./configure
Install missing dependencies at this point.
@miebach
miebach / example output
Created August 8, 2012 08:49
Websocket echo test
WebSocket Test
CONNECTED
SENT: WebSocket rocks
RESPONSE: WebSocket rocks
DISCONNECTED
@miebach
miebach / README
Created September 3, 2012 10:12
Allow colours and other inline styles in Redmine
Allow colours and other inline styles in Redmine
================================================
Textile inline styles are disabled in Redmine >=0.8 for security reasons.
If you want this feature and don't fear XSS attacks as you don't have projects with public write access, you can change this in /lib/redmine/wiki_formatting/textile/formatter.rb :
self.filter_styles=false
Restart Redmine after the change!
@miebach
miebach / README.txt
Last active October 12, 2015 17:37
Cygwin
Download http://cygwin.org/setup.exe
Save as c:\opt\cygwin\setup.exe
Store packages at c:\opt\cygwin\package
----
See also https://gist.github.com/1059810 for a "cygwin-here" registry modificatioon.
----
@miebach
miebach / gist:4139268
Created November 24, 2012 11:25
reST - Restructured Text