Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Christian M. Grube seraphyn

🏠
Working from home
View GitHub Profile
@seraphyn
seraphyn / wp-cron-mu.php
Created Sep 19, 2016
Multisitecron für WordPress. */2 * * * * www-data /usr/bin/php /var/www/html/wordpress/wp-cron-mu.php > /dev/null
View wp-cron-mu.php
<?php
if( php_sapi_name() !== 'cli' ) {
die("Meant to be run from command line.\n");
}
// Modify this based on site domain
$_SERVER['HTTP_HOST'] = 'yoursite.com';
define( 'WP_USE_THEMES', false );
global $wp, $wp_query, $wp_the_query, $wp_rewrite, $wp_did_header;
@seraphyn
seraphyn / atomupdate.sh
Created Sep 7, 2016
Automatic update for the editor atom
View atomupdate.sh
#!/bin/bash
wget -q https://github.com/atom/atom/releases/latest -O /tmp/latest
MATCHEDROW=$(awk -F '[<>]' '/href=".*atom-amd64.deb/' /tmp/latest)
LATEST=$(echo $MATCHEDROW | grep -o -P '(?<=href=").*(?=" rel)')
VER_LATEST=$(echo $MATCHEDROW | rev | cut -d"/" -f 2 | rev | sed 's/v//g')
VER_INST=$(dpkg -l atom | tail -n1 | tr -s ' ' | cut -d" " -f 3)
if [ "$VER_LATEST" != "$VER_INST" ]; then
wget --progress=bar -q "https://github.com/$LATEST" -O /tmp/atom-amd64.deb --show-progress
dpkg -i /tmp/atom-amd64.deb
echo "Atom has been update from $VER_LATEST to $VER_INST"
@seraphyn
seraphyn / dist-upgrade.yml
Created Aug 5, 2016
Fallback and logging in dist-upgrade via ansible ansible-playbook dist-upgrade.yml -i your_inventory [-l host_name]
View dist-upgrade.yml
---
- hosts:
all
gather_facts: no
vars:
verbose: false
log_dir: "log/dist-upgrade/{{ inventory_hostname }}"
pre_tasks:
- block:
- setup:
View gist:85c7fc5c61eefafc4d5635dc5e5d7eb9
[gallery columns="1" ids="257972,257974,257975,257976,257979,257980,257981,257982,257983,257984,257985,257986,257987,257988,257989,257990,257991,257992,257993,257994,257995,257996,257997,257998,257999,258000,258001,258002,258003,258004,258005,258006,258007,258008"]
@seraphyn
seraphyn / tt2srt.py
Created Feb 22, 2016 — forked from mbirth/tt2srt.py
Timed Text Captions to SRT Subtitles converter script
View tt2srt.py
#!/usr/bin/env python
# Usage: python tt2srt.py source.xml output.srt
# FROM: https://gist.github.com/adammw/915259
from xml.dom.minidom import parse
import sys
def fixTime(time):
parts = time.split(':')
frames = int(parts[3]) # 00..24
@seraphyn
seraphyn / httpsgottorg
Created Feb 3, 2016
Ausgabe von python sslyze_cli.py --regular got-tty.org für den Aritkel https://got-tty.org/sslyze-ssl-scanner
View httpsgottorg
AVAILABLE PLUGINS
-----------------
FallbackScsvPlugin
SessionResumptionPlugin
HeartbleedPlugin
OpenSslCipherSuitesPlugin
@seraphyn
seraphyn / speedtweet.py
Created Jan 31, 2016
RaspberryPI Speedtest automatically tweet at Comcast Xfinity whenever internet speeds drop significantly below what payed for for as mentioned in https://www.reddit.com/r/technology/comments/43fi39/i_set_up_my_raspberry_pi_to_automatically_tweet
View speedtweet.py
#!/usr/bin/python
import os
import sys
import csv
import datetime
import time
import twitter
def test():
@seraphyn
seraphyn / 00logwatch
Created Dec 31, 2015
Encrypt Logwatch with gpg
View 00logwatch
#!/bin/bash
recipient_email=""
recipient_gpg_pub_key=""
sender_gpg_pub_key=""
file="$(mktemp)"
test -x /usr/share/logwatch/scripts/logwatch.pl || exit 0
/usr/sbin/logwatch --detail high > $file
test -s $file || exit 1
View cfg_statusbar.lua
mod_statusbar.create{
screen=0,
pos='bl',
fullsize=false,
systray=true,
template="%date || %>load || E: %netmon_avgin/%netmon_avgout W: %iwinfo_signal %iwinfo_ssid || %exec_tlpbattery %exec_temp || %workspace_pager ||%weather_tempC C %weather_wind || %exec_sera %exec_chris %exec_google PWK: %exec_pwk WP: %exec_wp GAuth: %exec_ggl %systray_dock",
}
mod_statusbar.launch_statusd{
date={
@seraphyn
seraphyn / ttrss-update.service
Created Sep 17, 2015
Start TinyTinyRSS update Service with systemd instead using cron.
View ttrss-update.service
# This file is part of my tinytinyRSSinstallation
# It is used by systemd under Debian Jessie
# WorkingDirectory=/var/www/html/ttrss must be YOUR Installationpath without
# ending slash /
#
# vim /lib/systemd/system/ttrss-update.service
# systemctl enable ttrss-update.service
# systemctl --system daemon-reload
# systemctl start ttrss-update.service
# systemctl status ttrss-update.service