Skip to content

Instantly share code, notes, and snippets.

View rjaeckel's full-sized avatar

Robert Jäckel rjaeckel

  • IT-Servicezentrum, Uni Halle
View GitHub Profile
@rjaeckel
rjaeckel / ssh-put-key.sh
Created August 6, 2013 12:55
Put the public ssh key file to various remote hosts to use certificate based authentication
#!/bin/bash
if [ $# -eq 0 ]; then
me=$(basename $0)
echo "-> copy the personal rsa key to other machines for certificate based authentication"
echo Usage:
echo "$me [user@]machine [[user@]machine [...]]"
fi
@rjaeckel
rjaeckel / curl-http-status-cron.sh
Created April 2, 2014 07:11
curl-http-status-cron
#!/bin/bash
curl=/usr/bin/curl
hosts="www.vk.uni-halle.de www.wissenschaftsnacht-halle.de"
for host in $hosts; do
http_status=$($curl curl -sI --get http://$host | head -n1 | awk '{print $2}' )
if [[ "$http_status" -ne "200" ]]; then
echo "Host $host returned status '$http_status'"
fi
@rjaeckel
rjaeckel / nginx-host.conf
Last active August 29, 2015 13:59
nginx-charset
server {
# charset should always be set, dueto nginx won't specify it in the header if omitted
charset utf-8;
# charset iso-8859-1;
}
@rjaeckel
rjaeckel / install-rails.fish
Last active August 29, 2015 14:04
ruby on rails installation using rvm
#!/usr/bin/fish
# rvm install
curl -sSL https://get.rvm.io | bash -s stable
# fish integration --> https://rvm.io/integration/fish
curl -L --create-dirs -o ~/.config/fish/functions/rvm.fish https://raw.github.com/lunks/fish-nuggets/master/functions/rvm.fish
# make gems and ruby-binaries available in shell per default:
egrep "^[[:space:]]*rvm" config.fish; or echo "rvm>/dev/null">>~/.config/fish/config.fish
@rjaeckel
rjaeckel / chrootX.sh
Last active August 29, 2015 14:05
chroot +X
#!/bin/bash
# @see: http://wiki.ubuntuusers.de/chroot/Live-CD
# mount partition
mount /dev/sda1 /mnt
# mount boot here if neccessary
# mount system environment
# .X11 is for xserver and resolv.conf for networking
@rjaeckel
rjaeckel / check-kernel-release.sh
Last active August 29, 2015 14:06
Verifiy active kernel is the latest installed
#!/bin/bash
# u may use this script in cron or in the shell directly. Should work on any Linux distribution
# an alternative would be checking for /var/run/reboot-required to exist
running=$(uname -r)
kernels=/lib/modules
installed=($(ls $kernels))
latest=${installed[@]:(-1)}
@rjaeckel
rjaeckel / 999-no-suggests
Last active August 29, 2015 14:06
Apt Configuration to ignore Suggested Packages unless these are manually installed
apt::autoremove::suggestsimportant false;
apt::get::install-suggests false;
@rjaeckel
rjaeckel / 50unattended-upgrades
Created September 10, 2014 07:58
Apt auto-update config
// Automatically upgrade packages from these (origin:archive) pairs
Unattended-Upgrade::Allowed-Origins {
"${distro_id}:${distro_codename}-security";
"${distro_id}:${distro_codename}-updates";
"${distro_id}:${distro_codename}-proposed";
"${distro_id}:${distro_codename}-backports";
};
// List of packages to not update (regexp are supported)
Unattended-Upgrade::Package-Blacklist {
@rjaeckel
rjaeckel / sshd_config
Created September 15, 2014 07:58
Enable x-forwarding ob ubuntu-servers
...
addressfamily inet
...
@rjaeckel
rjaeckel / f.js
Created September 24, 2014 10:28
javascript function short code for lazy programmers
f=function(){var f=Function;return f.apply(new f,arguments);};