Skip to content

Instantly share code, notes, and snippets.

@kidmose
kidmose / Dockerfile
Last active September 2, 2016 21:56
Dockerfile for docker image with docker and bash - because offical docker docker image from docker doesn't have bash
FROM debian:jessie
MAINTAINER Egon Kidmose
RUN set -x && \
apt-get update && \
apt-get install -y --no-install-recommends apt-transport-https ca-certificates && \
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D && \
echo 'deb https://apt.dockerproject.org/repo debian-jessie main' > /etc/apt/sources.list.d/docker.list && \
apt-get update && \
apt-get install docker-engine -y --no-install-recommends
@kidmose
kidmose / .bashrc
Last active September 19, 2019 10:24
bash config
export EDITOR="emacs"
# <copy> source="http://stackoverflow.com/questions/9457233/unlimited-bash-history">
# Eternal bash history.
# ---------------------
# Undocumented feature which sets the size to "unlimited".
# http://stackoverflow.com/questions/9457233/unlimited-bash-history
export HISTFILESIZE=
export HISTSIZE=
export HISTTIMEFORMAT="[%F %T] "
@kidmose
kidmose / modify_url_to_zorac.js
Last active September 25, 2020 10:00
Bookmarklet that modifies the current url by appending a string: useful for accessing Aalborg University Library paid services from outside
# Slices a string into the url:
# - from eg.: http://link.springer.com/chapter/10.1007/978-3-642-31217-5_19#page-1
# - to eg.: http://link-springer-com.zorac.aub.aau.dk/chapter/10.1007/978-3-642-31217-5_19#page-1
# - subdomains at target are eliminate by replacing `.` with `-`
javascript: (function() {
wl = window.location.toString().split("/");
wl[2] = wl[2].replace(/\./g , "-") + ".zorac.aub.aau.dk";
window.location = wl.join("/");
})()

Keybase proof

I hereby claim:

  • I am kidmose on github.
  • I am kidmose (https://keybase.io/kidmose) on keybase.
  • I have a public key whose fingerprint is 1E90 04B7 3855 5F04 92B5 AD61 788C 75A4 01CD 0087

To claim this, I am signing this object:

@kidmose
kidmose / .gitignore
Last active August 29, 2015 14:20
Simple linux ressource usage logging
*
@kidmose
kidmose / virsh-restore-all.sh
Last active April 20, 2019 14:22
Scripts for automating libvirt guest save and restore
#!/bin/bash
# restore all hosts from saved stated (ram image) and start
virsh list --all | `#list of all guest` \
tail -n +3 | head -n -1 | sed 's/\ \+/\t/g' | `#strip head and tail, use tab for seperator`\
awk '{print($2)}' | \
while read GUEST; do
echo "Restoring $GUEST"
virsh restore "/var/lib/libvirt/images/$GUEST/state" --running
echo "Marking $GUEST for autostart"