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/perl | |
# | |
# memcached-tool: | |
# stats/management tool for memcached. | |
# | |
# Author: | |
# Brad Fitzpatrick <brad@danga.com> | |
# | |
# License: | |
# public domain. I give up all rights to this |
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/sh | |
# | |
# Run `drush updb` in parallel in groups of 5. | |
# | |
# The for loop is populated by running `drush sa`, but this could also be a | |
# file with aliases on each line. | |
# | |
# The | |
i=0 |
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
program WAR; | |
uses crt,DispANS,TextCursor; | |
const | |
top = 1; | |
whichCards : array[2..14] of char = | |
('2','3','4','5','6','7','8','9','0','J','Q','K','A'); | |
type setCards = array[2..14] of integer; |
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
# | |
# Create random password for every Drupal user from uid 1 to uid 45 | |
# @todo - variable user ID sequence? | |
# | |
for uid in $(seq 45); do uname=$(drush user-information $uid 2>/dev/null | grep -oP "(?<=User name \: ).+"); if [ -n "${uname}" ]; then drush user-password "$uname" --password=$(date | md5sum); fi done |
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
for alias in `drush sa`; do echo $alias; drush @$alias updb -y; done |
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 | |
vhosts=/etc/apache2/sites-enabled/* | |
for f in $vhosts | |
do | |
servername=`grep ServerName $f | sed 's/\s*ServerName\s*//g' - | head -n1` | |
for s in $servername | |
do | |
url="http://$s https://$s" | |
for protocol in $url |
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 | |
/** | |
* Theme a series of form elements into a table (Drupal 6), with optional | |
* tabledrag.js support. | |
*/ | |
function theme_D6MODULE_admin_table_form($form) { | |
$header = array(); | |
$rows = array(); |
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 | |
if ($order_id = db_result(db_query("SELECT order_id FROM {fundraiser_webform_order} WHERE sid = %d", $_GET['sid']))) { | |
$order = uc_order_load($order_id); | |
$order_total = isset($order->order_total) ? $order->order_total : 0; | |
} | |
?> |
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 | |
* Find out which words are most commonly used in song lyrics. | |
*/ | |
$wordcounts = array(); | |
$lines = file('album/song.txt'); | |
foreach ($lines as $line_num => $line) { |
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
alias now='/bin/date +%s' | |
# Convert a timestamp | |
unixtime() { | |
php -r 'if (isset($argv[1]) && is_numeric($argv[1])) print date(DATE_RSS, $argv[1]) . "\n";' $1 | |
} | |
# Local VM config | |
export localvmname="Debian32" |
NewerOlder