Skip to content

Instantly share code, notes, and snippets.

View 0x46616c6b's full-sized avatar

0x46616c6b 0x46616c6b

  • Dresden
  • 13:56 (UTC +02:00)
View GitHub Profile
@0x46616c6b
0x46616c6b / redis_to_mysql.go
Last active September 19, 2018 08:29
Etherpad Migration from Redis to MySQL
package main
import (
"database/sql"
"flag"
"fmt"
"log"
"strings"
"github.com/go-redis/redis"
id alias url
790669100971515 pegida https://www.facebook.com/pegidaevdresden
507642806040134 siegfried-daebritz https://www.facebook.com/pegida.daebritz
636833049762948 klotzsche-sagt-nein https://www.facebook.com/DRESDEN-Klotzsche-sagt-NEIN-zum-Heim-636833049762948/
1561506014089157 heimatschutz-meissen https://www.facebook.com/Ini.Heimatschutz/
594316897372117 orakel-debakel https://www.facebook.com/OrakelDebakel
880728778665642 widerstand-dresden https://www.facebook.com/Widerstand-Dresden-880728778665642/
603436016461261 nein-zu-johannstadt https://www.facebook.com/NEIN-zur-ZeltstadtContainerdorf-in-Johannstadt-603436016461261/
1701421860086089 freie-kameradschaft-dresden https://www.facebook.com/Freie-Kameradschaft-Dresden-1701421860086089/
1691946287705666 freie-aktivisten-dresden https://www.facebook.com/FreieAktivistenDresden/
@0x46616c6b
0x46616c6b / ansible-user.diff
Last active January 4, 2016 06:09
Some work on skeleton support for ansibles user module
Index: library/system/user
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- library/system/user (revision ff8eb5f4540d4649978f227dd432a1a2b5bd2512)
+++ library/system/user (revision )
@@ -72,6 +72,10 @@
required: false
description:
@0x46616c6b
0x46616c6b / functions.php
Last active January 3, 2016 12:29
Simple way to return relative urls with wordpress built in wp_enqueue_* function. Good for caching!
<?php
/**
* cut the base url from the assets
*
* @param $src
* @param $handle
* @return mixed
*/
function make_urls_relative($src, $handle)
require 'formula'
class SslscanNg < Formula
homepage 'https://github.com/ioerror/sslscan'
url 'https://github.com/ioerror/sslscan'
head 'https://github.com/ioerror/sslscan.git'
def install
system "make"
bin.install "sslscan"
<?php
require __DIR__ . '/vendor/autoload.php';
use Guzzle\Http\Client as HttpClient;
use Predis\Client as RedisClient;
$redis = new RedisClient();
$apiKey = '5P5SIaxS644YqeDbz6sFsT4ATJ2NkJhe';
$currentTimestamp = time();
<?php
require __DIR__ . '/vendor/autoload.php';
$db = new PDO('sqlite:sqlite.db');
$redis = new Predis\Client();
foreach ($db->query("SELECT * FROM store") as $row) {
$redis->set($row['key'], $row['value']);
}
require("ep_etherpad-lite/node_modules/npm").load({}, function(er,npm) {
process.chdir(npm.root+'/..');
var settings = require("ep_etherpad-lite/node/utils/Settings");
var sqlite3 = require('sqlite3');
var sqliteDb = new sqlite3.Database('var/sqlite.db');
var db = require("ep_etherpad-lite/node/db/DB");
db.init(function() {
@0x46616c6b
0x46616c6b / gist:6286987
Created August 20, 2013 20:40
Use a custom sluggable listener to convert the german "Umlaute" correctly
Index: app/config/config.yml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- app/config/config.yml (revision d38cd17)
+++ app/config/config.yml (revision 8f4f85a5ccd3e17b6bbe235fed1b5cff44c07d65)
@@ -68,6 +68,8 @@
default:
timestampable: true
@0x46616c6b
0x46616c6b / muninStart.sh
Created January 4, 2013 19:49
simple script to start a small webserver for munin
!/bin/bash
die () {
echo >&2 "$@"
exit 1
}
[ $EUID -eq 0 ] || die "this script must be run as root"
cd /var/cache/munin/www