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 ports='sudo lsof -iTCP -sTCP:LISTEN -P' | |
alias dnsflush='dscacheutil -flushcache' | |
alias git-add='git add -A' | |
alias dmesg="sudo dmesg" | |
alias l='ls -lrtha' | |
alias dir='ls -lh' | |
alias svnscrub='find . -name .svn -exec rm -rf {} \;' | |
alias vpnfix='sudo route -nv add -net 10 -interface utun0 && sudo route change default 10.0.1.1' | |
alias gitx='/Applications/GitX.app/Contents/MacOS/GitX &' |
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 http = require('http'); | |
var secure = new RegExp('(' + [ | |
'facebook.com', | |
'twitter.com', | |
'google.com' | |
].join('|').replace('.', '\\.') + ')$'); | |
var noSecure = new RegExp('^(' + [ | |
'http://(www\.)?google\.com/(image|imghp)', |
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 | |
LOGFILE=/data/logs/dps-cdn-rsync/$(date "+%Y-%m").log | |
# Append a header first, so we know when this script was run. | |
date "+%n%n=====%nSyncing DriverPacks to CDN at %Y-%m-%d %H:%M:%S" >> $LOGFILE | |
# Now perform the actual syncing, still appending to the logfile. | |
rsync -avv --progress --delete --exclude lost+found --exclude .ssh --exclude .bash_history /data/www/downloadsorigin.driverpacks.net/ dpsdl.drupalcdn@storage01.netdna.com:/home/dpsdl.drupalcdn/public_html/ >> $LOGFILE |
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
# | |
# Normal cronjobs. | |
# m h dom mon dow command | |
# | |
# Regenerate torrents.tar.gz every hour. | |
*/60 * * * * tar -cvzf /data/www/svn_driverpacks.net/files/torrents.tar.gz /data/www/svn_driverpacks.net/files/torrents/*.torrent | |
# Run DriverPacks CDN and seedbox rsync scripts (for downloads) | |
*/20 * * * * /home/wim/cronscripts/dps-cdn-rsync.sh |
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
QDateTime timeConvertor; | |
QString customDateString = "14-Nov-2010 05:27:03 +0100"; | |
QString dateTime = customDateString.left(20); | |
int timezoneOffset = customDateString.right(5).left(3).toInt(); | |
timeConvertor = QDateTime::fromString(dateTime, "dd-MMM-yyyy HH:mm:ss"); | |
// Mark this QDateTime as one with a certain offset from UTC, and set that | |
// offset. | |
timeConvertor.setTimeSpec(Qt::OffsetFromUTC); |
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 | |
LOGFILE=/data/logs/dps-seedbox1-rsync/$(date "+%Y-%m").log | |
EXCLUDES_COMMON="--exclude lost+found --exclude .ssh --exclude .bash_history" | |
EXCLUDES_MORE="--exclude other --exclude BASE --exclude applications" | |
# Append a header first, so we know when this script was run. | |
date "+%n%n=====%nSyncing DriverPacks to seedbox1 at %Y-%m-%d %H:%M:%S" > $LOGFILE | |
# Sync the DriverPacks themselves to the seedbox' 'data' folder. However, we |
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 | |
export AWS_ACCESS_KEY_ID=yourID | |
export AWS_SECRET_ACCESS_KEY=yourSecret | |
export AWS_TARGET_BUCKET=DriverPacks_back-up | |
export AWS_TARGET_DIR=/ | |
export SOURCE_DIR=/data/www/downlodsorigin.driverpacks.net/ | |
export S3SYNC_DIR=/home/wim/scripts/s3sync | |
export SSL_CERT_DIR=/etc/ssl/certs |
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 | |
$host="https://bodega.fogbugz.com/api.asp"; | |
$user="rick@madefresh.ca"; | |
$password = "********"; | |
$query = 'project:"Bodega Application" milestone:"1.4.0" status:"Active"'; | |
$cols = "ixBug"; | |
$tokenCommand = "curl \"$host?cmd=logon&email=$user&password=$password\" | perl -ne 'print if s/.*\\[CDATA\[(.*)\\]\\].*/\\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/sh | |
INPUT=/var/log/mysql/mysql-slow.log | |
OUTPUT_1H=/data/www/wimleers.com/status/mysql-slow-1h.txt | |
OUTPUT_24H=/data/www/wimleers.com/status/mysql-slow-24h.txt | |
# Perform the analytics, overwriting the previous results. | |
../scripts/mk-query-digest --since 1h $INPUT > $OUTPUT_1H | |
../scripts/mk-query-digest --since 24h $INPUT > $OUTPUT_24H |
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
#include <stdio.h> | |
#define uint unsigned int | |
#define TTW_NUM_GRANULARITIES 5 | |
class Weird { | |
public: | |
Weird() { | |
this->lastUpdate = 0; | |
for (int g = 0; g < TTW_NUM_GRANULARITIES; g++) |
OlderNewer