Skip to content

Instantly share code, notes, and snippets.

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

waja

🔊
#yoloOps #itscomplicated
View GitHub Profile
@waja
waja / php54_deprecated_functions
Last active March 11, 2016 13:18
This shell script could be used to parse DocumentRoots for functions and ini directives problematic with PHP 5.4
#!/bin/bash
#
# PHP 5.4 Deprecated function checker
#
# Version: 0.0.3
#
# Original Author: Michiel Roos <michiel@donationbasedhosting.org>
#
# http://www.php.net/manual/de/migration54.incompatible.php
# http://www.php.net/manual/en/migration54.deprecated.php
@waja
waja / .bashrc
Last active December 24, 2015 07:28
Color your (Bash-)Life
if [ "$TERM" != "dumb" ]; then
if [[ "$OSTYPE" == "darwin"* ]]; then
# For ls colors in Solarized theme
# https://github.com/seebi/dircolors-solarized/issues/10
export LSCOLORS=gxfxbEaEBxxEhEhBaDaCaD
# source git completion
if [ -f /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash ]; then
. /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash
fi
source /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-prompt.sh
@waja
waja / 50-icinga.conf
Last active December 29, 2015 02:39
lighttpd config for icinga on Debian wheezy
# Load setenv module (as there is no template in
# /etc/lighttpd/conf-available and it's not loaded by default)
server.modules += ( "mod_setenv" )
# Aliases for needed directories
alias.url += (
"/cgi-bin/icinga" => "/usr/lib/cgi-bin/icinga",
"/icinga/stylesheets" => "/etc/icinga/stylesheets",
"/icinga" => "/usr/share/icinga/htdocs",
)
@waja
waja / mk-sbuild_raspbian.diff
Created November 25, 2013 09:55
Patching mk-sbuild to (maybe) add another keyring for building arch armhf (on default /usr/share/keyrings/${DISTRO}-archive-keyring.gpg is used, but we want use /usr/share/keyrings/raspbian-archive-keyring.gpg for example)
--- /usr/bin/mk-sbuild 2013-10-14 22:02:00.000000000 +0200
+++ /tmp/mk-sbuild 2013-11-24 22:56:49.000000000 +0100
@@ -618,7 +618,11 @@
sudo mkdir -p -m 0700 "$MNT"/root/.gnupg
# debootstrap the chroot
-sudo ${proxy:+"http_proxy=${proxy}"} "$DEBOOTSTRAP_COMMAND" --arch="$CHROOT_ARCH" $variant_opt $debootstrap_opts "$RELEASE" "$MNT" "${DEBOOTSTRAP_MIRROR:-http://archive.ubuntu.com/ubuntu}"
+if [ "$CHROOT_ARCH" = "armhf" ]; then
+ sudo ${proxy:+"http_proxy=${proxy}"} "$DEBOOTSTRAP_COMMAND" --arch="$CHROOT_ARCH" $variant_opt $debootstrap_opts "$RELEASE" "$MNT" "${DEBOOTSTRAP_MIRROR:-http://archive.ubuntu.com/ubuntu}" "${DEBOOTSTRAP_KEYRING}"
+else
@waja
waja / inject_firmware.sh
Created December 8, 2013 13:10
Bash script to inject latest wheezy firmware into local Debian netboot ramdisk
# see http://wiki.debian.org/DebianInstaller/NetbootFirmware#Wheezy_Example_.232_:_add_debs_from_firmware.tar.gz
#!/bin/sh
FWTMP=/tmp/d-i_firmware
DSTDIR=/srv/tftp/boot/debian-installer/
rm -rf $FWTMP
mkdir -p $FWTMP/firmware
cd $FWTMP
wget http://cdimage.debian.org/cdimage/unofficial/non-free/firmware/wheezy/current/firmware.tar.gz
@waja
waja / nginx_phpmyadmin_wheezy.conf
Created December 16, 2013 22:38
Nginx phpmyadmin config for wheezy
location /phpmyadmin {
root /usr/share/;
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
location ~ /(libraries|setup/frames|setup/libs) {
deny all;
}
location ~ ^/phpmyadmin/setup/(.+\.php)$ {
auth_basic "phpMyAdmin Setup";
@waja
waja / check_ocsp_class1_startssl
Created January 6, 2014 12:26
Check the status of the ocsp responder (here the class1 startssl variant). The -header option (supported by recent openssl versions) is needed for fixing HTTP/1.1, see http://www.math.ucla.edu/~jimc/documents/bugfix/21-openssl-ocsp.html!
#!/bin/sh
wget -q http://www.startssl.com/certs/sub.class1.server.ca.pem -O /tmp/sub.class1.server.ca.pem; \
openssl ocsp -CAfile /tmp/sub.class1.server.ca.pem -issuer /tmp/sub.class1.server.ca.pem \
-url http://ocsp.startssl.com/sub/class1/server/ca -noverify -no_nonce \
-header "HOST" "ocsp.startssl.com" -cert ${1}
@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")