Skip to content

Instantly share code, notes, and snippets.

View waja's full-sized avatar
🐢
#yoloOps #itscomplicated

waja

🐢
#yoloOps #itscomplicated
View GitHub Profile

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 / openwrt_x86.install
Last active August 10, 2018 12:06
Openwrt x86 installation
# look also at
# http://wiki.openwrt.org/doc/recipes/relayclient
# http://wiki.openwrt.org/doc/recipes/dumbap
# disable dhcp on lan interface (just in case there is a dhcp server running)
uci set dhcp.lan.ignore=1
uci set dhcp.@dnsmasq[0].nonegcache=1
uci commit dhcp
/etc/init.d/dnsmasq restart
@waja
waja / README.md
Last active December 15, 2021 10:45
Migration from Debian Squeeze to Wheezy
@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 / redis-sentinel-switch-state.sh
Last active April 30, 2024 15:51
Shell script to migrate a VIP to the actual redis master when managing them with redis-sentinel
#!/bin/sh
_DEBUG="on"
DEBUGFILE=/tmp/sentinel_failover.log
VIP='10.125.125.30'
MASTERIP=${6}
MASK='24'
IFACE='eth0'
MYIP=$(ip -4 -o addr show dev ${IFACE}| grep -v secondary| awk '{split($4,a,"/");print a[1]}')
DEBUG () {
@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