This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
if [ $# -lt 2 ]; then | |
echo "merge single pdfs into one document" | |
echo "Usage" | |
echo "$0 Outputfile Inputfiles" | |
echo "Examples:" | |
echo "\"$0 fulldoc.pdf page1.pdf page2.pdf page3.pdf\"" | |
echo "\"$0 fulldoc.pdf page*.pdf\"" | |
echo "\nrequires ghostscript" | |
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(0); | |
define('HHVM_PHP_INI', "/etc/hhvm/php.ini"); | |
define('HHVM_SERVER_INI', "/etc/hhvm/server.ini"); | |
define('XDEBUG', "xdebug"); | |
define('ZEND_DEBUGGER', "Zend Debugger"); | |
function createXmlHeader() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ ! -f /dev/shm/first-names.txt ]; then | |
wget -q https://raw.githubusercontent.com/dominictarr/random-name/master/first-names.txt -O /dev/shm/first-names.txt | |
fi | |
if [ ! -f /dev/shm/last-names.txt ]; then | |
wget -q https://raw.githubusercontent.com/dominictarr/random-name/master/names.txt -O /dev/shm/last-names.txt | |
fi | |
IFS=$'\r\n' GLOBIGNORE='*' command eval 'FIRST_NAMES=($(cat /dev/shm/first-names.txt))' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for i in {1..200} | |
do | |
#echo "samba-tool group add 'Osmium ${i}'" | |
samba-tool group add "Osmium ${i}" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for i in {1..3200} | |
do | |
R_UID="Joker ${i}" | |
MEMBERSHIPS="$((($RANDOM % 10) + 10))" | |
for j in {1..${MEMBERSHIPS}}; do | |
R_GROUP="Osmium $((($RANDOM % 200) + 1))" | |
samba-tool group addmembers "${R_GROUP}" "${R_UID}" || true | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for i in {1..200} | |
do | |
R_GID="Osmium ${i}" | |
MEMBERSHIPS="$((($RANDOM % 3)))" | |
for j in {1..${MEMBERSHIPS}}; do | |
R_GROUP="Osmium $((($RANDOM % 200) + 1))" | |
samba-tool group addmembers "${R_GROUP}" "${R_GID}" || true | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env bash | |
# requires nvm installed from AUR (i.e. only tested on Arch), and also jq | |
# run from the project directory like: runWithNodeAndNpm.sh make dev-setup | |
# the package.json is taken from the current working directory | |
NODE_MAJOR_VERSION=$(cat package.json | jq .engines.node | grep -oE '[0-9]*' | head -1) | |
NPM_MAJOR_VERSION=$(cat package.json | jq .engines.npm | grep -oE '[0-9]*' | head -1) | |
source /usr/share/nvm/init-nvm.sh | |
nvm install ${NODE_MAJOR_VERSION} && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep $(date -d 'last minute' '+%d/%b/%Y:%H:%M') /var/log/apache2/access.log | grep -oE 'HTTP/..." [0-9]{3}' | awk '{ print $2; }' | sort | uniq -c | sort -n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# ⚠️ ATTENTION! It purges kernels without asking for confirmation!!! | |
CURRENT_KERNEL=$(uname -r | grep -oE '[0-9\.]+-[0-9]+') | |
LATEST_KERNEL=$(apt show linux-image-generic | grep -oE 'linux-image-[0-9\.]+-[0-9]+' | cut -d '-' -f3-) | |
BASE_KERNEL=$(echo ${CURRENT_KERNEL} | cut -d '.' -f 1-2) | |
apt list --installed | grep linux | cut -d '/' -f 1 | egrep -v "(${CURRENT_KERNEL}|${LATEST_KERNEL})" | grep "${BASE_KERNEL}." | tr '\n' ' ' | xargs apt purge -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
CTT_HIGH=0 | |
while : | |
do | |
CTT=$(cat /proc/sys/net/netfilter/nf_conntrack_count) | |
if (( ${CTT} > ${CTT_HIGH} )); then | |
echo $CTT | |
CTT_HIGH=${CTT} | |
fi | |
sleep 3 |