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
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" |
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 | |
# 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 |
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 | |
* Utilities for use in protecting an environment via basic auth or IP whitelist. | |
*/ | |
function ac_protect_this_site() { | |
global $conf; |
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 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 |
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 | |
$user = ''; | |
$pass = ''; | |
$database = ''; | |
$limit = 1000000; | |
$dsn = 'mysql:dbname=' . $database . ';unix_socket=/var/run/mysqld/mysqld.sock'; | |
try { |
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 | |
* Custom Drush integration. | |
*/ | |
/** | |
* Implements hook_drush_command(). | |
* | |
* @return |
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
$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); |