Now You’re Being Ridiculous: Featuring William Golden
August 5th, 2009 Jonathan Harriot expand/collapse this entryPosted in i came as a rant | No Comments
Posted in i came as a rant | No Comments
While shared hosts offer great service for little cost there can be problems with sites timing out when uploading large files or you would like to be in more control of your server a bit. Just change the value for site and you’ll be off to the races. There are some other values you can customize to your needs but only edit and use this script if you know what you’re doing. This was created so I could upload some large files over a 20MB line so if your connection is slower or would like to allow users with slower connections to upload such large files, toy with the time settings a bit till you find the proper values for your system & connection. I take no responsibility for anyone who uses this script, if you break your server contact support and beg them for help. Or ask me and I’ll see what we can do, cheers!
Onto the script!
# stop on errors
set -e
# set the site for which you want to setup the custom php.ini
SITE=yoursite.com
# copy the php.ini to modify
mkdir $HOME/${SITE}/cgi-bin
cp /etc/php5/cgi/php.ini $HOME/${SITE}/cgi-bin/php.ini
cat << EOF > $HOME/${SITE}/cgi-bin/php-wrapper.fcgi
#!/bin/sh
exec /dh/cgi-system/php5.cgi $*
EOF
chmod 755 $HOME/${SITE}/cgi-bin
chmod 755 $HOME/${SITE}/cgi-bin/php-wrapper.fcgi
chmod 640 $HOME/${SITE}/cgi-bin/php.ini
# search and replace the php.ini
#!/bin/sh
INIFILE="$HOME/${SITE}/cgi-bin/php.ini"
rsync -a /dh/cgi-system/php5.cgi "$CGIFILE"
perl -p -i -e '
s/.*post_max_size.*/post_max_size = 100M/;
s/.*upload_max_filesize.*/upload_max_filesize = 100M/;
s/.*max_execution_time.*/max_execution_time = 1200/;
s/.*max_input_time.*/max_input_time = 1200/;
s/.*memory_limit.*/memory_limit = 250M/;
' "$INIFILE"
# create the new htaccess or append the handlers to your current .htaccess
FILE=.htaccess
cat >> $HOME/${SITE}/${FILE} << EOF
Options +ExecCGI
AddHandler php5-cgi .php
Action php-cgi /cgi-bin/php-wrapper.fcgi
Action php5-cgi /cgi-bin/php-wrapper.fcgi
EOF
Posted in Dreamhost, featured, php | 4 Comments
If you use the Google Sitemap Generator Plugin for WordPress and receive the following error using WordPress 2.8+ you are not alone:
Warning: mktime() expects parameter 1 to be long, string given in/wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 2438
A solution for this was posted in the WordPress forums and is posted below:
//return mktime($hour, $min, $sec, $month, $day, $year);
return mktime(doubleval( $hour), $min, $sec, $month, $day, doubleval($year));
//return mktime($hour, $min, $sec, $month, $day, $year);
return mktime(doubleval( $hour), $min, $sec, $month, $day, doubleval($year));
Posted in gnu gpl, php, wordpress plugins | 1 Comment
If you are in favor of defending net neutrality, enjoy solid uptime or want an alternative to Comcast here are two services I have used which work wonderfully.
Great fiber optic package with combined internet, TV and VOIP services with solid uptime. AT&T is a corporate defender of net neutrality. They also have reasonable DSL speeds for lower cost and their tech support are some of the smartest I have been on the end of the line with. I previously had their Elite DSL package and regular phone while living in Costa Mesa, CA and never had the net connection drop once. Plus they allow you to run a web server out of your home if you feel so inclined. This is not the story with Comcast which can be helpful for setting a small gaming server or creating a local web server to show off updates on projects without having to upload to a development site or email links. This also allows your clients to see the most recent version of their projects, which my clients loved.
True fiber optic connection until the fiber optic line hits your residence where the signal is converted to copper wires but it hauls and is well worth it. If I remember correctly for internet and VOIP services the bill came out to around $80 a month and once the ‘Spicoli’ installers replaced a bad conversion box it never went down and remained a solid service. I think with the TV services our bill would have rounded out to around $125 so its not a bad deal. Unfortunately, I had some issues using port forwarding for my home web server, Verizon does not support Net Neutrality (Obama does though) and their tech support is rather poor. But once things are setup its very self maintaining, just use your own router and use theirs to act only as modem.
Posted in eff, i came as a rant, net neutrality | 1 Comment
So there’s this wonderful problem that came about with WinAmp and Google Talk. If you try to “Show current music track” in Google Talk while WinAmp is playing some music it will have a cardiac arrest, freeze up and force to CTRL+ALT+DEL it into oblivion. I tried logging into Google Talk via Gmail to change the status message to something else or even opening iTunes (which works wonderfully with Google Talk I would like to add!) just to get Google Talk to stop freezing up. I searched the internets and found some advice around forums and here is what I found that worked for me in less steps than were posted on almost all the forums:
Option 1:
Option 2:
Hope this was helpful, cheers!
Posted in Tools, eff, featured, random mess | No Comments
A simple vertical jQuery accordion with much room for growth. In future version I would like to use a few additional lines of JS to create a cleaner structure but even if only as an example this is a good start. I made a horizontal accordion as well but all things will be made public in due time.
This script creates a cooking and remembers which section was last opened therefore making it a great homepage piece or miniature site navigation.
Cheers!
Posted in css, eff, gnu gpl, jQuery, javascript, php, work | 2 Comments
Firefox is a priceless debugging tool for web developers. However, when it stops functioning properly, daily tasks & work become more complicated.
One day Firefox stopped asking if I wanted to restore my tabs when the program closed. After being annoyed for quite sometime I thought about restoring FireFox to its defaults settings.
Windows XP/2000/Vista:
firefox -safe-mode
“C:\Program Files\Mozilla Firefox\firefox.exe” -safe-mode
OR
Start > All Programs > Mozilla Firefox (folder) > Mozilla Firefox Safe Mode
Linux:
/path/to/firefox/firefox -safe-mode
Mac OS X:
/Applications/Firefox.app/Contents/MacOS/firefox -safe-mode
Now, while it is true that somewhere along the way I may have inadvertently unchecked “No, don’t ask me again” the problem was nonetheless frustrating. So, if Firefox does not remember what tabs you had open before on closing it just follow those steps above.
That is unless you don’t want it to remember what tabs were open, browsing history, passwords, cookies, etc because you were looking at skeevy porn or browsing the Jars of Clay ‘Eternal Fanclub of best Friends Forever’, then you probably shouldn’t be using Firefox. Use Internet Explorer and get the viruses God intended your computer be infected with.
Posted in i came as a rant, work | No Comments
PHPFlickr is a really neat little package that makes implementation of Flickr’s API quick and painless. I tried various techniques to create a slideshow for a client with LyteBox to enlarge the images but I slowly grew tired of the animation and the functionality that almost no one for this specific project would use. So I grabbed a small SWF slideshow from my toolbox and went to work creating a simple script to grab the photos and output the image URI I needed without creating bulky code. Here is what I came up with to make this easier for myself:
<?
photosets_getPhotos($photoset_id, NULL, NULL, 15, 1);
// create a random interval for the timer between 6 and 10 seconds
$randomnumber= rand(6,10);
// create an array to output as xml
$xml_output = "\n";
foreach ((array)$photos['photo'] as $photo) {
$xml_output .= "
buildPhotoURL($photo, "medium") . "\" ";
$xml_output .= "/>\n";
$i++;
}
$xml_output .= "\n";
echo $xml_output;
// you're done!
?>
Simple and straight forward.
Posted in actionscript, gnu gpl, php, wordpress plugins | No Comments
A few of the projects I had the pleasure of working on at Amies have been featured in their newest reel. The video was created by Travis Anderson and is pretty solid as a whole. Enjoy!
Posted in featured, work | No Comments
Posted in i came as a rant, random mess | No Comments