Skip to content

Instantly share code, notes, and snippets.

View tamcore's full-sized avatar

Philipp B. tamcore

  • Düsseldorf / Germany
View GitHub Profile
#!/bin/bash
MOUNT=/mnt/${HOSTNAME}-BACKUP
KEYFILE=/root/crypt.key
PHYSICAL_UUID=/dev/disk/by-uuid/xxx-xxx-xxxx-xxxx-xxxx
CRYPTED_UUID=/dev/disk/by-uuid/xxxx-xxxx-xxxx-xxxx-xxxxx
CRYPT_NAME=cryptbackup
BACKUP_PATHS='/ /home'
BACKUP_ARGS='--one-file-system --exclude-caches --progress'
@tamcore
tamcore / gist:26860d0ceb9d0031a8c512e3eeb8454e
Created May 25, 2018 07:37
parsing mysql's bullshit query log format with fluentd
<source>
@type tail
path /var/log/mysql/*slow*.log
pos_file /var/log/td-agent/_tmp_mysql_slow.pos
tag forward.mysql_slow
format multiline
format_firstline /^\# User@Host:.*/
format1 /^\# User@Host: (?<user>.*) @ (?<host>.*) \[.*\n/

Keybase proof

I hereby claim:

  • I am tamcore on github.
  • I am tamcore (https://keybase.io/tamcore) on keybase.
  • I have a public key whose fingerprint is 49A6 9811 AC2E B49E 599B 0658 9AE6 94D8 4D80 BF88

To claim this, I am signing this object:

@tamcore
tamcore / 500px.sh
Last active January 28, 2016 19:03
#!/bin/bash
#
# CRON
# */10 * * * * ~/bin/500px.sh <catgeories>
#
CATEGORIES=${1:-"City+%26+Architecture,People"}
ping -q -c1 500px.com &>/dev/null
if [ "$?" -eq 0 ] && [ "$1" != "--local" ]; then
#!/bin/sh
PING_IPS="nexus4 thinkpad"
MIN_TRIES=5
MAX_LOAD=0.1
DOWN_SINCE=$(cat /tmp/auto_shutdown 2>/dev/null)
for IP in ${PING_IPS}
do
ping -q -c1 ${IP} &>/dev/null
if [ "$?" -eq 0 ];
@tamcore
tamcore / savrix-android-market.php
Last active October 12, 2015 03:28
rewritten sav_get_file() function for the Savrix Android Market Wordpress Plugin to use cURL if available
function sav_get_file($package_name) {
global $sav_file;
$sav_file = false;
$ua = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0';
$headers = array(
'Accept-language' => 'en-us,en;q=0.5',
);
$url = 'https://play.google.com/store/apps/details?id=' . $package_name;