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
Options +FollowSymLinks -MultiViews | |
RewriteEngine On | |
SetEnvIf User-Agent ^Amazon Cloudfront$ cdn | |
Order Deny,Allow | |
Deny from all | |
Allow from env=cdn |
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 | |
/** | |
* This gist is no longer maintained - it is a proper repo now: | |
* | |
* @see https://github.com/sun/drupal-reinstall | |
*/ | |
# ██╗ ██╗██████╗ ██████╗ ███╗ ██╗ ██████╗ |
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
$ grunt | |
Running "concat:edit" (concat) task | |
File "build/edit.js" created. | |
Running "min:edit" (min) task | |
File "build/edit.min.js" created. | |
Uncompressed size: 83949 bytes. | |
Compressed size: 7684 bytes gzipped (29545 bytes minified). | |
Running "min:backbone" (min) task |
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 python | |
# Calculates the size of the PHP codebase of all sites. | |
import os | |
import optparse | |
import subprocess | |
def calculate(http_root_dir): | |
sites = list_sites(http_root_dir) |
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
mining association rules complete, # association rules: 166 | |
( | |
{episode:css(0), ua:WinXP:Firefox(60)} => {duration:slow(16)} (conf=0.280632) | |
{episode:css(0), ua:WinXP:Firefox(60), ua:WinXP:Firefox:3(61)} => {duration:slow(16)} (conf=0.290043) | |
{episode:css(0), ua:WinXP:Firefox:3(61)} => {duration:slow(16)} (conf=0.290043) | |
{episode:pageready(39)} => {duration:slow(16)} (conf=0.398305) | |
{location:AS(3), episode:css(0)} => {duration:slow(16)} (conf=0.216981) | |
{location:AS(3), episode:pageready(39)} => {duration:slow(16)} (conf=0.639344) | |
{location:AS(3), episode:totaltime(40)} => {duration:slow(16)} (conf=0.639344) | |
{location:AS(3), ua:WinXP:IE(8), episode:frontend(19)} => {duration:slow(16)} (conf=0.468927) |
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++) |
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
#!/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
#!/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 |