Posted by & filed under NoSQL, PHP, Redis.

Here’s the code and notes for a presentation I’m giving this Saturday on PHP and Redis: Even if you’re not going to presentation, feel free to check it out and give it a try. Redis is pretty simple to use and quite powerful once you get the hang of it.

Posted by & filed under Linux, Redis.

If you’d like to have the most recent version of Redis installed on your Debian machine, follow along with this guide. Unfortunately, the process of installing it is not as easy as `sudo apt-get install redis`, which you probably already knew since you’re reading this. The current version of Redis, at the time of me writing… Read more »

Posted by & filed under OS X.

Boy does my Homebrew installation like to get messed up. Pretty much every time I do a big `brew update` I have to repair everything. This is what I typically have to do: cd /usr/local sudo chown -R USERNAME /usr/local/.git sudo chown -R USERNAME /usr/local sudo chown -RL mysql:mysql /usr/local/mysql/data git pull git reset –hard… Read more »

Posted by & filed under Linux.

If you’re using my previous method for logging a networks ever-changing public IP to a webserver you control, you can use this simple command to grab the last known IP and SSH into the box that way. ssh USERNAME@`curl -s` The `backticks`, when run in a shell, will execute that command and return the… Read more »

Posted by & filed under PHP.

<?php $raw_header = “http://location/\r\nBadHeader”; # PHP 5.4: $clean_header = explode(“\n”, explode(“\r”, $raw_header)[0])[0]); # PHP 5.3: $no_cr = explode(“\r”, $raw_header); $no_nl = explode(“\n”, $no_cr[0]); $clean_header = $no_nl[0]; unset($no_cr, $no_nl); echo $clean_header;

Posted by & filed under Linux.

Use this script to take a photo using the webcam on your computer. It makes use of and requires the installation of mplayer. When it takes pictures, it will take 20 of them, and delete the first 19. I have to do this because my netbook has a really crappy camera, and it takes a… Read more »

Posted by & filed under NoSQL.

$ brew install rethinkdb ==> Downloading Already downloaded: /Library/Caches/Homebrew/rethinkdb-1.5.0.tgz ==> ./configure –prefix=/usr/local/Cellar/rethinkdb/1.5.0 –fetch protobuf –fetch protoc ==> make make[1]: *** [build/release_clang_notcmalloc/rethinkdb_web_assets/js/reql_docs.json] Error 1 make[1]: *** Deleting file `build/release_clang_notcmalloc/rethinkdb_web_assets/js/reql_docs.json’ make[1]: *** Waiting for unfinished jobs…. make[1]: unlink: build/release_clang_notcmalloc/rethinkdb_web_assets/.: Invalid argument make: *** [make] Error 2 READ THIS: The only thing Google brings up is… Read more »

Posted by & filed under Linux.

After moving to my new apartment, it was time to dust off the old Linksys router I had lying around. This thing has been hacked to run the latest DD-WRT that it could handle. My network address changes occasionally, and I didn’t want to setup any dyndns accounts to keep track of the IP and… Read more »

Posted by & filed under PHP.

<?php /** * This class will safely parse complex objects or arrays with possible missing keys * * Usage: obj::query($obj, ‘dot.separated.syntax’); */ class obj { /** * Parse the provided object * * @param $object mixed The complex object you’re going to parse * @param $path string The dot separated path you would like to… Read more »