Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
"""
Synchronise block devices over the network
Copyright 2006-2008 Justin Azoff <justin@bouncybouncy.net>
Copyright 2011 Robert Coup <robert@coup.net.nz>
License: GPL
Getting started:
@wienczny
wienczny / update_phabricator.sh
Last active January 11, 2020 22:53
Phabricator Backup, Update and Launch script.
#!/bin/sh
set -e
set -x
# This script should be run as user phabricator
# This is an example script for updating Phabricator, similar to the one used to
# update <https://secure.phabricator.com/>. It might not work perfectly on your
# system, but hopefully it should be easy to adapt. This script is not intended
INSERT INTO api_user (firstname, lastname, email, username, api_key, created, modified, lognum, reload_acl_flag, is_active) VALUES('Service', 'User', 'some@email.test', 'service', 'dec335babdf3963c310cdee3a03af112:7BgJbicGhvmLwETmUCCaqAV7185NHNPZ', STR_TO_DATE('2015-03-06 23:25:57','%Y-%m-%d %H:%i:%s'), STR_TO_DATE('2014-12-11 23:05:20','%Y-%m-%d %H:%i:%s'), 843, 0, 1); -- password is serviceservice
INSERT INTO api_role (parent_id, tree_level, sort_order, role_type, user_id, role_name) SELECT 1 as parent_id, 1 as tree_level, 0 as sort_order, 'U' as role_type, user_id, 'Service' as role_name from api_user WHERE username = 'service';
@wienczny
wienczny / .gitignore
Last active August 29, 2015 14:27
Magento .gitignore File
# Exclude backups, archives and logs
*.tar
*.gz
*.sql
*.log
*.tar.gz
*.zip
*.rar
*.tgz
ini_set('display_errors', 1);
ini_set('error_reporting', E_ERROR);
register_shutdown_function("fatal_handler");
function fatal_handler() {
$error = error_get_last();
echo("<pre>");
print_r($error);
}
file_put_contents('/tmp/trace' . microtime(), var_export(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), true));
@wienczny
wienczny / multi-ipn.php
Last active September 8, 2015 13:42 — forked from anointed/multi-ipn.php
Paypal multiple IPN's
<?php
/*
* This is a PayPal IPN (Instant Payment Notification) broadcaster
* Since PayPal does not provide any straightforward way to add
* multiple IPN listeners we'll have to create a central IPN
* listener that will broadcast (or filter and dispatch) Instant
* Payment Notifications to different destinations (IPN listeners)
*
* http://codeseekah.com/2012/02/11/how-to-setup-multiple-ipn-receivers-in-paypal/
*
@wienczny
wienczny / exampleBehavior.html
Last active September 16, 2015 21:11 — forked from garlicnation/exampleBehavior.js
behavior singleton model
<script>
// Resolve / declare namespace
window.MyCustomBehaviors = window.MyCustomBehaviors || {};
// This is a globally shared connection.
var singletonConnection = null;
window.MyCustomBehaviors.SocketConnectionBehavior = {
properties: {
connection: {
@wienczny
wienczny / pwdhash.py
Created November 14, 2015 12:33
Python3 pwdhash.py for https://www.pwdhash.com/
#!/usr/bin/env python
import base64
import re
import hashlib
import hmac
import itertools
def b64_hmac_md5(key, data):
"""
@wienczny
wienczny / phabricator-aphlict.service
Created November 17, 2015 15:18
Phabricator Systemd Units
[Unit]
Description=Phabricator Aphlict
After=syslog.target network.target mysql.service
[Service]
Type=forking
User=phabricator
Group=phabricator
ExecStart=/srv/http/phabricator/bin/aphlict start
ExecStop=/srv/http/phabricator/bin/aphlict stop