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 / .htaccess
Created February 12, 2016 21:48
.htaccess file routing domains into separate directories
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} domain10.org$ [OR]
RewriteCond %{HTTP_HOST} domain11.org$
RewriteCond %{REQUEST_FILENAME} !dir1/
RewriteRule (.*) dir1/$1 [L]
RewriteCond %{HTTP_HOST} domain20.org$ [OR]
RewriteCond %{HTTP_HOST} domain21.org$
@waja
waja / config.diff
Created January 29, 2016 16:29
oxidized config patch
-- config.orig 2016-01-27 10:48:05.000000000 +0100
+++ config 2016-01-28 16:54:26.000000000 +0100
@@ -1,8 +1,9 @@
---
username: username
password: password
-model: junos
-interval: 3600
+model: cisco
+interval: 600
@waja
waja / Dockerfile
Created January 25, 2016 13:35
Example Dockerfile creating a simple nginx container
# Pull base image
FROM debian:latest
# Dockerfile Maintainer
MAINTAINER Jan Wagner "[email protected]"
# Install nginx and adjust nginx config to stay in foreground
RUN apt-get update && apt-get install --no-install-recommends -y nginx; \
echo "daemon off;" >> /etc/nginx/nginx.conf
@waja
waja / google-hilite.diff
Created January 7, 2016 14:10
google-hilite.diff
--- /tmp/google-hilite.php 2005-06-17 02:36:02.000000000 +0200
+++ /usr/share/wordpress/wp-content/plugins/google-hilite.php 2006-05-26 00:17:32.000000000 +0200
@@ -81,6 +81,10 @@
break;
case 'wordpress':
+ if (preg_match('|^http://'. quotemeta($_SERVER["SERVER_NAME"]) .'|i', $referer)){
+ return false;
+ break;
+ }
@waja
waja / extended-live-archives.diff
Created January 7, 2016 14:09
extended-live-archives.diff
diff -Nur orig/af-extended-live-archive-options.php af-extended-live-archive-options.php
--- orig/af-extended-live-archive-options.php 2006-02-22 19:06:00.000000000 +0100
+++ af-extended-live-archive-options.php 2006-05-26 22:47:28.000000000 +0200
@@ -7,7 +7,7 @@
*/
include_once(ABSPATH . WPINC . '/class-snoopy.php');
-$af_ela_cache_root = ABSPATH . 'wp-content/af-extended-live-archive/';
+$af_ela_cache_root = ABSPATH . 'wp-content/af-extended-live-archive/' . $_SERVER["SERVER_NAME"] .'/';
@waja
waja / umount-button.patch
Created January 7, 2016 12:47
umount-button.patch
--- status-usb.sh.orig 2007-02-23 20:50:16.000000000 +0100
+++ status-usb.sh 2007-02-23 23:29:16.000000000 +0100
@@ -7,6 +7,12 @@
. /usr/lib/webif/webif.sh
header "Status" "USB" "@TR<<USB Devices>>"
+if ! empty "$FORM_umount"; then
+ if ! empty "$FORM_mountpoint"; then
+ umount $FORM_mountpoint
+ fi
@waja
waja / mount.patch
Created January 7, 2016 12:46
mount.patch
--- /tmp/01-mount.orig 2007-02-23 23:35:48.000000000 +0100
+++ /tmp/01-mount 2007-02-23 23:34:03.000000000 +0100
@@ -8,12 +8,13 @@
mkdir -p /tmp/mnt
ln -s /tmp/mnt /
}
+ fulldev="/dev$(ls -l "$dev" | sed -e 's/^.*\.\.//')"
cd $dev
for part in part*; do
if [ $part != "part*" ] ; then
@waja
waja / muninlite_fix-unused-up_interface.diff
Created January 6, 2016 14:07
muninlite_fix-unused-up_interface.diff
--- /opt/sbin/munin-node.orig 2013-01-27 15:13:51.869007214 +0100
+++ /opt/sbin/munin-node 2013-01-27 16:11:20.536006950 +0100
@@ -133,7 +133,7 @@
if [ -n "$(which ethtool)" ]; then
if [ -x "$(which ethtool)" ]; then
if ethtool $1 | grep -q Speed; then
- MAX=$(($(ethtool $1 | grep Speed | sed -e 's/[[:space:]]\{1,\}/ /g' -e 's/^ //' -e 's/M.*//' | cut -d\ -f2) * 1000000))
+ MAX=$(($(ethtool $1 | grep Speed | sed -e 's/[[:space:]]\{1,\}/ /g' -e 's/^ //' -e 's/M.*//' | sed -e 's/Unknown\!/0/' | cut -d\ -f2) * 1000000))
echo "up.max $MAX"
echo "down.max $MAX"
@waja
waja / gitlab-ci_runner_jessie_deploy.sh
Last active June 2, 2019 11:05
Install Gitlab-CI runner on Debian Jessie
#!/bin/bash
# depends on https://gist.github.com/waja/01ba2641f93f461044f9
[ "$(cat /etc/debian_version | awk -F. {'print $1'})" -ne "8" ] && echo exit 1
# Install Source Liste for Gitlab-CI runner
cat >/etc/apt/sources.list.d/runner_gitlab-ci-multi-runner.list <<EOF
# this file was generated by packages.gitlab.com for
# the repository at https://packages.gitlab.com/runner/gitlab-ci-multi-runner
deb https://packages.gitlab.com/runner/gitlab-ci-multi-runner/debian/ jessie main
deb-src https://packages.gitlab.com/runner/gitlab-ci-multi-runner/debian/ jessie main
@waja
waja / gitlab_source_minor_version_update.sh
Last active March 11, 2016 13:54
Script for updating gitlab source installations for minor versions (Don't use for major version updates)
#!/bin/sh
if [ -z "${1}" ]
then
echo "Specify which database are you using: [ --mysql | --postgresql ]"
exit 0
fi
case ${1} in
--mysql)
BUNDLE_EXCLUDE="postgres"
;;