Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
lol no

Cameron Tod cam8001

💭
lol no
  • Wellington, New Zealand
View GitHub Profile
@cam8001
cam8001 / imessage_dump.py
Last active Aug 29, 2019 — forked from bgulla/imessage_dump.py
Dumps all images from iMessages.
View imessage_dump.py
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"
View tidy5-install-ubuntu.sh
#!/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 Aug 29, 2015 — 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.
View acquia.inc
<?php
/**
* @file
* Utilities for use in protecting an environment via basic auth or IP whitelist.
*/
function ac_protect_this_site() {
global $conf;
View 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 Aug 29, 2015
drupal_scan_large_cache_objects.php
View drupal_scan_large_cache_objects.php
<?php
$user = '';
$pass = '';
$database = '';
$limit = 1000000;
$dsn = 'mysql:dbname=' . $database . ';unix_socket=/var/run/mysqld/mysqld.sock';
try {
View golocal.drush.inc
<?php
/**
* @file
* Custom Drush integration.
*/
/**
* Implements hook_drush_command().
*
* @return
@cam8001
cam8001 / gist:1700086
Created Jan 29, 2012
Building a drupal query
View gist:1700086
$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);