Skip to content

Instantly share code, notes, and snippets.

View tolleiv's full-sized avatar

Tolleiv Nietsch tolleiv

  • Bare.ID Gmbh - an AOE Group company
  • Wiesbaden, Deutschland
View GitHub Profile
@tolleiv
tolleiv / register.sh
Created March 10, 2014 18:19
Autoregistering a hook through a shell script.
#!/bin/bash
### ALL SPOTS marked with XXX have to be changed before this runs
token="XXX"; # get that from your user settings
name="AOEpeople" # the github login name
type="orgs" # or "users"
list=`curl -s -H "Authorization: token ${token}" "https://api.github.com/${type}/${name}/repos" | grep '"url"' | grep 'repos' | sed -E 's~.*https(.*)",~https\1~'`
@tolleiv
tolleiv / t.sh
Created March 18, 2014 08:33
Log a telnet session
#!/bin/bash
umask 000
script -a /tmp/telnet.log.$$
/usr/bin/telnet $*
exit 0
@tolleiv
tolleiv / demo.bat
Last active August 29, 2015 14:00
Shortcut to keep RDP connections within the URL field of KeePass
cmd://"C:\Windows\System32\cmd.exe" /c cmdkey.exe /generic:{TITLE} /user:{USERNAME} /pass:{PASSWORD} & mstsc.exe /v:{TITLE} & cmdkey.exe /delete:{TITLE}
@tolleiv
tolleiv / Dockerfile
Created June 5, 2014 16:12
Docker "client" (disbaled daemon) installation as a docker container
FROM ubuntu:12.04
RUN apt-get update
RUN [ -e /usr/lib/apt/methods/https ] || apt-get install -y apt-transport-https
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
RUN sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
RUN apt-get update
RUN apt-get install -y lxc-docker
RUN service docker stop
RUN update-rc.d -f docker remove
@tolleiv
tolleiv / Creator.rb
Last active August 29, 2015 14:03
Automatic Jenkins job creation - used as a reference on blog.tolleiv.de
#!/usr/bin/ruby
##############################
# Parameters via environment variables
#
# COOKBOOK - List of recipes which we should have related jobs for
# SERVER - Jenkins server which is used for the job creation
# USER - related Jenkins user
# PASSWORD - related Jenkins password
##############################
@tolleiv
tolleiv / dump_env.rb
Last active August 29, 2015 14:04
Dump environment from Ruby / a Chef recipe to a file. That file can be used with "source /environment.sh" to set the missing variables in a session later on.
# Dump environment for debugging purpose
file '/environment.sh' do
content ENV.reduce("#!/bin/bash\n") { |s, e| s+="export #{e[0]}=$\{#{e[0]}:?#{e[1]}\}\n" }
end
@tolleiv
tolleiv / README.txt
Last active August 29, 2015 14:04
Dashing Zabbix Screen
This shows my adjustment/extension of the Zabbix Widget for Dashing. Original code comes from: https://gist.github.com/chojayr/7401426
@tolleiv
tolleiv / README.md
Last active August 29, 2015 14:05
Zabbix Info Widget

Zabbix Info Widget

This is a Dashing widget and all components needed to outline some general Zabbix server numbers.

##Usage

To use this widget, copy zabbix_info.html, zabbix_info.coffee, and zabbix_info.scss into the /widgets/zabbix_info directory. Put the zabbix_info.rb file in your /jobs folder. Or simply run dashing install d7ab8e1611330e0fdf76 to let dashing do that for you.

To include the widget in a dashboard, add the following snippet to the dashboard layout file:

@tolleiv
tolleiv / README.md
Created August 31, 2014 15:08
Zabbix Jobs

...

@tolleiv
tolleiv / graph.sh
Created September 9, 2014 21:44
RRDtool example code
#!/bin/bash
let time=1407882500
let now=$(( time+300 ))
rm datafile.rrd
rrdtool create datafile.rrd --start $time --step 60 \
DS:hdduse:GAUGE:100:0:100 \
RRA:AVERAGE:0.5:1:1440 \