Skip to content

Instantly share code, notes, and snippets.

View waja's full-sized avatar
🥾
#yoloOps #itscomplicated #BackpackingThroughAsia

waja

🥾
#yoloOps #itscomplicated #BackpackingThroughAsia
View GitHub Profile
@waja
waja / sync_bare2xen.sh
Last active August 29, 2015 13:56
Migrate your system from bare metal into LVM device for running it with Xen, you need https://github.com/waja/backuppc-helper for this.
#!/bin/bash
if [ -f /etc/default/backuppc-helper ]
then
. /etc/default/backuppc-helper
if [ -z "$VOL" ]
then
echo "#### WARNING ####"
echo "VOL in /etc/default/backuppc-helper not set!"
echo "#################"
exit 0
@waja
waja / git2release
Last active August 29, 2015 13:56
This script could be used to prepare a tarball from monitoring-plugins upstream git
#!/bin/bash
#TMPDIR=/tmp/
# creating temp dir
TMPDIR=`mktemp -d`
trap "rm -rf $TMPDIR" EXIT
# defining some values
DIR=$(pwd)
# git clone git://git.debian.org/git/pkg-nagios/pkg-nagios-plugins.git /tmp/monitoring-plugins.git
case "$1" in
diff --git a/lib/tasks/gitlab/backup.rake b/lib/tasks/gitlab/backup.rake
index ae2b1bb..f6aacce 100644
--- a/lib/tasks/gitlab/backup.rake
+++ b/lib/tasks/gitlab/backup.rake
@@ -157,8 +157,8 @@ namespace :gitlab do
# Build a backup path
path_to_bundle = File.join(backup_path_repo, project.path_with_namespace + ".bundle")
-
- if Kernel.system("git clone --bare #{path_to_bundle} #{project.repository.path_to_repo} > /dev/null 2>&1")

Keybase proof

I hereby claim:

  • I am waja on github.
  • I am waja (https://keybase.io/waja) on keybase.
  • I have a public key whose fingerprint is 5CE7 510A 8FBC 0D4E 72AB BA9B 0C70 557B 5A06 513E

To claim this, I am signing this object:

@waja
waja / .config
Last active August 29, 2015 13:58
Needed files to build lcd4linux in openwrt x86 buildenv
#
# Automatically generated file; DO NOT EDIT.
# OpenWrt Configuration
#
CONFIG_MODULES=y
CONFIG_HAVE_DOT_CONFIG=y
# CONFIG_TARGET_ppc40x is not set
# CONFIG_TARGET_realview is not set
# CONFIG_TARGET_sunxi is not set
# CONFIG_TARGET_atheros is not set
@waja
waja / lcd4linux.conf
Last active August 29, 2015 13:59
lcd4linux.conf for FW8888
# $Id: lcd4linux.conf.sample 759 2007-02-04 05:55:58Z michael $
# $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/lcd4linux.conf.sample $
Plugin FIFO {
fifopath '/tmp/lcd4linux.fifo'
}
Variables {
tick 500
tack 100
@waja
waja / post-setup.sh
Last active August 29, 2015 14:01
Setup an Ubuntu trusty after installation
#!/bin/bash
# get clipboard installed
sudo apt-get install diodon diodon-plugins
# install flash for chromium
[ $(dpkg -l | grep chromium-browser | grep ^ii | wc -l) -ge "1" ] && sudo apt-get install pepperflashplugin-nonfree
# audio video codecs
sudo apt-get install ubuntu-restricted-extras
sudo apt-get install libavcodec-extra
# disable apport (like on stable release on default)
@waja
waja / .bash_profile
Last active August 29, 2015 14:02
Script to generate motd trailer for unsupported squeeze-lts packages
# wget --no-check-certificate https://gist.github.com/waja/29b9e41113f6587fffb9/raw/squeeze-lts -O /etc/cron.daily/squeeze-lts && chmod +x /etc/cron.daily/squeeze-lts
# TMP=$(mktemp); wget --no-check-certificate https://gist.github.com/waja/29b9e41113f6587fffb9/raw/.bash_profile -O ${TMP} && grep -v "^#" ${TMP} >> ~/.bash_profile
if [ ! -f /tmp/motd.squeeze-lts.trail ]; then
sh /etc/cron.daily/squeeze-lts
fi
echo ""; echo "Not supported packages by squeeze LTS (wiki.debian.org/LTS/Development):"; echo ""
cat /tmp/motd.squeeze-lts.trail
@waja
waja / prepare_mp_build
Created July 30, 2014 20:43
Prepare the build of monitoring-plugins
#!/bin/bash
# install build essential packages
apt-get install --no-install-recommends build-essential fakeroot
# install build dependencies
apt-get install --no-install-recommends perl autotools-dev libdbi-dev libldap2-dev libpq-dev libmysqlclient-dev libfreeradius-client-dev libkrb5-dev libnet-snmp-perl procps
# install tools to create dist files
apt-get install --no-install-recommends autoconf automake
# create dist files
tools/setup
# configure the build
@waja
waja / dom0resources
Last active August 29, 2015 14:07
Shell script gathering Xen DomU resources on a Dom0
#!/bin/sh
for DOMU in $(xm list | grep -v -E "^(Name|Domain-0)" | awk '{print $1}'); do
PARTSPACE=$(lvdisplay /dev/xen-vol/${DOMU}-disk | grep Size | awk '{print $3}')
RESOURCES=$(xm list | grep ${DOMU} | awk '{printf "%s %s %s",$6,$3,$4}')
# name_domu cpu_time ram vcpu part_space
echo ${DOMU} ${RESOURCES} ${PARTSPACE}
done