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 | |
# Require: run from a Nextcloud root dir | |
if [ ! -f lib/versioncheck.php ]; then | |
echo "Enter the Nextcloud root dir first" > /dev/stderr | |
exit 255; | |
fi | |
# Test general php bin first | |
if php lib/versioncheck.php 1>/dev/null ; then |
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 |
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
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
#!/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
#!/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/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 | |
#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 | |
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
<?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() |
NewerOlder