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
MAILTO="you@domain.com" | |
SHELL=/bin/bash | |
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin | |
# prerequisities: | |
# sudo wget -q -O/usr/local/bin/wpcli https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar; sudo chmod 0755 /usr/local/bin/wpcli | |
# WP CRON | |
* * * * * wpuser cd /path/to/wordpress; wpcli cron event run --due-now --quiet |
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
import os | |
import sqlite3 | |
import logging | |
import re | |
import glob | |
import sys | |
import hashlib | |
import arrow | |
import argparse | |
from bs4 import BeautifulSoup |
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
import json | |
import arrow | |
import os | |
import logging | |
from shlex import quote | |
from pprint import pprint | |
base = '/web/blog.pakuauk.com/exports/facebook-export' | |
with open('facebook-export/posts/posts.json', 'rt') as f: |
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 | |
# script needs env vars passed, needs to be called as: | |
# WALLABAG_ID='client_id' WALLABAG_SECRET='client_secret' WALLABAG_USERNAME='username' WALLABAG_PASSWORD='password' WALLABAG_URL='url' bash wallabag2epub.sh | |
# requires `jq` https://stedolan.github.io/jq/ because nobody should deal with parsing json with sed | |
function err { | |
>&2 echo $1 | |
} |
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
var links2img = [] | |
function initLightbox() { | |
var links = document.getElementsByTagName("a"); | |
for(var i = links.length; i--; ) { | |
var imginside = links[i].getElementsByTagName("img"); | |
if (imginside.length == 1 ) { | |
links2img.push(links[i]) | |
console.log(links[i]); | |
links[i].onclick = openLightbox; |
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 | |
function usage () { | |
echo "backup-github.sh | |
A tiny bash script to backup own and starred public github repositories | |
Usage: | |
backup-github.sh GITHUB_USERNAME DIRECTORY_TO_BACKUP_TO" | |
exit 1 |
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 [ -z "$1" ]; then | |
echo "Use: image.initmeta PHOTO" | |
exit 1 | |
fi | |
year="$(exiftool -s -EXIF:DateTimeOriginal "$1" | awk '{print $3}' | cut -d":" -f1)" | |
artist="Peter Molnar" | |
rights="CC BY-NC-ND 4.0 ${year} ${artist} <mail@petermolnar.net>" |
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
{ | |
"bad_request": [ | |
".*%22https?:.*", | |
"^/xmlrpc\\.php$", | |
"^.*\\.pHp5$", | |
"^.*\\.phtml$", | |
"^/_timthumb_.*$", | |
"^.*?flattrss_redirect.*$", | |
"^.*/None", | |
"…" |
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
modules_enabled = { | |
-- lots of modules here, add: | |
"turncredentials"; | |
} | |
-- before virtualhosts | |
turncredentials_secret = "[SECRET STRING]"; | |
turncredentials_host = "xmpp.petermolnar.net" |
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
// ==UserScript== | |
// @name unfix-all-the-toolbars | |
// @description Removes "position: fixed" style from elements, unfixing "toolbars" and the such. | |
// @namespace http://inf.ufrgs.br/~vbuaraujo/ | |
// @include * | |
// @version 1.2 | |
// @grant none | |
// ==/UserScript== | |
OlderNewer