Skip to content

Instantly share code, notes, and snippets.

scottalan / gist:1022898
Created June 13, 2011 14:49 — forked from glennpratt/gist:1016744
View gist:1022898
$ php -a
Interactive shell
php > $date = new DateTime('now');
php > $timestamp = $date->format('U');
php > var_dump($timestamp);
string(10) "1307626589"
php > $timestamp = $date->getTimestamp();
php > var_dump($timestamp);
View gist:1450563
$form['profile-status'] = array(
'#type' => 'radios',
'#title' => '',
'#options' => array(
'new' => t('Create a new profile.'),
'select' => t('Use an existing profile.'),
$form['select'] = array(
View gist:1564636
smb.conf -
workgroup = DEV
server string = %h server (Samba, Ubuntu)
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 10000
syslog = 3
panic action = /usr/share/samba/panic-action %d
scottalan / gist:1663369
Created January 23, 2012 14:20
cat pub key through ssh
View gist:1663369
ssh 'echo '`cat ~/.ssh/`' >> ~/.ssh/authorized_keys
View gist:1724887
$export['addthis_service_customizations'] = $strongarm;
$strongarm = new stdClass;
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'addthis_toolbox_classes';
<<<<<<< HEAD
$strongarm->value = '';
$strongarm->value = 'addthis_32x32_style';
scottalan / gist:1941427
Created February 29, 2012 15:12
blah blah
View gist:1941427
Rebooting your Linode would not make any changes within your server. Unfortunately, as an unmanaged provider, we wouldn't be intimately familiar with the internal configuration of your Linode, however it appears that "init" is not being found as your disk image is not being mounted correctly. Have you possibly customized your Linode to use XFS as opposed to ext3?
When using Finnix, your Linode's file-system can be found at "/dev/xvda" as per the "Rescue" tab of the Linode Manager. You may want to consider performing a file-system check using "fsck -fy" against your disk image from within Finnix:
Unfortunately, there's no indication of any issues on our end and the problems that you're experiencing appear to be the result of an issue internal to your Linode. If you're unable to identify the cause, your best option may be to re-deploy by backing up any important data from Finnix and creating a new Linode.
Alternatively, you could attempt to resize
View gist:2406249
php > $timestamp = 1334638800;
php > $date = date('d-m-Y', $timestamp);
php > print $date;
View gist:2431579
<?php if ($tabs): ?>
<div class="tabs"><?php print $tabs; ?></div>
<?php endif; ?>
<div id="main-content" class="region clear-block">
scottalan / gist:5910787
Created July 2, 2013 16:23
View gist:5910787
WD tmgmt_translator: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'custom_microsoft_translator' [error]
for key 'name': INSERT INTO {tmgmt_translator} (name, label, description, plugin, settings, weight, status, module) VALUES
(:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4,
:db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7); Array
[:db_insert_placeholder_0] => custom_microsoft_translator
[:db_insert_placeholder_1] => Custom microsoft translator
[:db_insert_placeholder_2] => Microsoft Translator service.
[:db_insert_placeholder_3] => microsoft
[:db_insert_placeholder_4] =>
scottalan / gist:6237724
Created August 15, 2013 02:32
Install pcre, autoconf, and APC on Mountain Lion.
View gist:6237724
Taken from:
Modified Versions.
# Compile PCRE - Perl Compatible Regular Expressions
cd /usr/local/src
curl -O
tar -xvzf pcre-8.33.tar.gz
cd pcre-8.33