Skip to content

Instantly share code, notes, and snippets.

View cam8001's full-sized avatar
💭
lol no

Cameron Tod cam8001

💭
lol no
  • Amazon Web Services
  • Wellington, New Zealand
  • 22:30 (UTC +12:00)
View GitHub Profile
@cam8001
cam8001 / imessage_dump.py
Last active August 29, 2019 01:00 — forked from bgulla/imessage_dump.py
Dumps all images from iMessages.
import os
import pwd
import shutil
from datetime import datetime, date
username = pwd.getpwuid(os.getuid()).pw_name
rootDir = "/Users/{}/Library/Messages/Attachments".format(username)
destDir = "/Users/{}/Desktop/imessage_dump".format(username)
IGNORE_STRING = "pluginPayloadAttachment"
@cam8001
cam8001 / tidy5-install-ubuntu.sh
Last active February 22, 2016 20:46 — forked from teawithfruit/tidy5-install-ubuntu.sh
Install tidy5 on Ubuntu.
#!/bin/bash
# Check if user is root
if [ $(id -u) != "0" ]; then
echo "Error: You must be root to run this script, please use root to install the software."
exit 1
fi
apt-get remove libtidy-0.99-0 tidy -y
wget -O /tmp/tidy-5.1.25-64bit.deb http://binaries.html-tidy.org/binaries/tidy-5.1.25/tidy-5.1.25-64bit.deb
@cam8001
cam8001 / acquia.inc
Last active August 29, 2015 14:27 — forked from typhonius/acquia.inc
An include file for the Acquia Cloud to be placed at the docroot/sites/acquia.inc location. May be optionally called from the site's settings.php with further details found on the Acquia Knowledgebase article.
<?php
/**
* @file
* Utilities for use in protecting an environment via basic auth or IP whitelist.
*/
function ac_protect_this_site() {
global $conf;
@cam8001
cam8001 / dice.sh
Last active August 29, 2015 14:11 — forked from saltednut/dice.sh
#!/usr/bin/env bash
# Usage: dice makefile docroot dbuser dbpass dbname sitename install-profile
drupal_install_clean_env() {
if [[ -r $2 ]]; then
sudo rm -r $2
cd ~/
fi
if [[ -r $1 ]]; then
drush make --working-copy --concurrency=5 $1 $2
@cam8001
cam8001 / drupal_scan_large_cache_objects.php
Last active August 29, 2015 14:01
drupal_scan_large_cache_objects.php
<?php
$user = '';
$pass = '';
$database = '';
$limit = 1000000;
$dsn = 'mysql:dbname=' . $database . ';unix_socket=/var/run/mysqld/mysqld.sock';
try {
<?php
/**
* @file
* Custom Drush integration.
*/
/**
* Implements hook_drush_command().
*
* @return
@cam8001
cam8001 / gist:1700086
Created January 29, 2012 18:45
Building a drupal query
$arg = "%".drupal_get_path_alias($_GET['q'])."%";
echo $arg;
$query = db_select('url_alias', 't');
$query->fields('t');
$query->condition('t.alias', '$arg', 'LIKE');
$query->range(0, 1);
$result = $query->execute();
while ($record = $result->fetchAssoc()) {
print_r($record);