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
# Quick snippet to convert public key signatures from an authorized_keys file into their ssh fingerprint | |
# Usage: python fingerprint_conversion.py authorized_keys | |
import base64,hashlib,sys | |
line = sys.argv[1] | |
f = open(line, 'r') | |
for key in f: | |
key = str(key.strip().split()[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
<?php | |
function custom_import_import_files_batch_files(&$context) { | |
db_set_active('import'); | |
// Build the total import count. | |
// need to query D5 db | |
// mysql> select nr.body from node_revisions nr join node n on n.nid = nr.nid where n.type = 'homepage' and nr.body like '%flipperpage%'; | |
if (empty($context['sandbox'])) { |
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
<?php | |
/** | |
* @file Node Export i18n module | |
*/ | |
// Ensure this node type has multilingual support | |
/** |
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
<?php | |
# Memcache | |
print "Memcache API\n"; | |
$conf['cache_backends'][] = './sites/all/modules/memcache/memcache.inc'; | |
$conf['cache_default_class'] = 'MemCacheDrupal'; | |
bench_it(); | |
#Memcache Storage | |
print "Memcache Storage\n"; |
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
use strict; | |
use warnings; | |
use HTTP::Request; | |
use LWP::UserAgent; | |
use Regexp::Common qw /net/; | |
use JSON; | |
my $email = 'FILLME'; | |
my $password = 'FILLME'; | |
my $badger = 'https://api.badger.com'; |
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
<?php | |
$url = 'URL GOES HERE'; | |
$key = 'KEY GOES HERE'; | |
// View https://developers.google.com/speed/docs/insights/v1/getting_started#before_starting to get a key | |
$data = json_decode(file_get_contents("https://www.googleapis.com/pagespeedonline/v1/runPagespeed?url=$url&key=$key")); | |
$dat = $data->formattedResults->ruleResults; | |
foreach($dat as $d) { | |
$name = $d->localizedRuleName; |
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
<?php | |
$adam = array( | |
'remote-host' => 'adammalone.net', | |
'root' => '/var/www/html/adammalone/docroot', | |
'uri' => 'adammalone.net', | |
'strict' => 0, | |
'path-aliases' => array( | |
'%dump-dir' => '/home/adammalone/.drush/dumps', | |
'%files' => 'sites/default/files', |
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
<?php | |
$options['shell-aliases']['offline'] = 'variable-set -y --always-set maintenance_mode 1'; | |
$options['shell-aliases']['online'] = 'variable-delete -y --exact maintenance_mode'; | |
$options['shell-aliases']['sync-dbs'] = '!drush sql-sync --structure-tables-key=common --no-cache {{#prod}} {{@target}}'; | |
$options['shell-aliases']['sync-files'] = '!drush rsync {{#prod}}:%files {{@target}}:%files'; | |
$options['structure-tables']['common'] = array('cache', 'cache_filter', 'cache_menu', 'cache_page', 'history', 'sessions', 'watchdog'); | |
$options['shell-aliases']['sync-fsdb'] = '!drush sql-sync {{#prod}} {{@target}} && drush rsync {{#prod}}:%files {{@target}}:%files'; |
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 perl | |
use strict; | |
use warnings; | |
use HTTP::Request; | |
use LWP::UserAgent; | |
use JSON; | |
use utf8; | |
binmode(STDOUT, ":utf8"); |
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 | |
SALT=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-10};echo;` | |
PW=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-18};echo;` | |
HASH=`openssl passwd -1 -salt $SALT $PW` | |
echo "Automatically generated password of $PW salted against $SALT gets hashed as $HASH" |