Ramblings on technology with a dash of social commentary
RSS icon Email icon Home icon
  • How to install Memcached Memcache PHP on OS X

    Posted on May 9th, 2011 phpguru No comments

    This Guide is the best resource I’ve found yet. I had to also look up how to fix pear installation errors.

     

  • Adobe Excuse the Interruption, but…

    Posted on January 20th, 2011 phpguru No comments

    Okay, Officially I hate Adobe worse than Microsoft now. Get ready for this, guys…

    I just got my computer back from being repaired (1), during which time I had a loaner computer from Fry’s Electronics. I’ve been working from a Time Machine backup on the loaner computer (2) and now have my original restored laptop with a fresh motherboard back again (3).

    I launch Photoshop to edit some vacation photos, since I haven’t seen the computer they were on for the last 20 days, and I’m greeted with this:

    Excuse the Interruption from Adobe

    Excuse the Interruption from Adobe


    Bullsh!t. Two other computers? How about my old one, a loaner and my repaired one (new motherboard surely generates a new Gestalt value which Creative Suite thinks is a new computer, which technically it is.) Okay well, I’ll try the “I already have deactivated the other computers” option and see what it does.

    Excuse the Interruption from Adobe

    Excuse the Interruption from Adobe


    Oh come on! What’s ridiculous is that I’ve only ever used this serial number on two computers. I formatted the loaner before returning it and now don’t have possession of it. Oh is some offshore call center person going to get an earful from me.

    Welcome to 2011.

  • MySQL won’t start on Snow Leopard

    Posted on December 31st, 2010 phpguru 5 comments

    I recently spent a lot of time scratching my head over this. Partial solution only at this point, any additional ideas would be most welcome.

    I restored a Time Machine backup from an older 32-bit MacBook Pro onto a new 64-bit MacBook Pro. Apache & PHP worked fine, but I had compiled the 32-bit version of 5.1 on the 32-bit box. I had problems with MySQL starting after the restore, which led me to rm -rf everything related to MySQL including the /Library/StartupItems/LaunchDaemon, reboot, and install the 5.1.54 from the 64-bit dmg download installer.

    After this, I figured I’d be fine, The MySQL preference pane in System Prefs shows “stopped”. Clicking start has no effect.

    ps aux | grep mysql

    shows only my grep command.

    I had to do a few things to get MySQL partially working.

    1) I had to

    chown -R mysql:wheel mysql-install-dir/bin
    chown -R mysql:wheel mysql-install-dir/data

    2) I discovered I can only start MySQL if, from terminal, I do:

    sudo /usr/local/mysql/bin/mysqld_safe --user=root

    I can’t connect to mysql from the command line with the dreaded

    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

    I do another

    ps aux | grep mysql

    and see it’s starting with

    /usr/local/mysql/bin/mysqld 
      --basedir=/usr/local/mysql
      --datadir=/usr/local/mysql/data
      --user=root
      --log-error=/usr/local/mysql/data/MacbookPro.local.err
      --pid-file=/usr/local/mysql/data/MacbookPro.local.pid
      --socket=/var/mysql/mysql.sock

    So I make a symlink

    ln -s /var/mysql/mysql.sock /tmp/mysql.sock

    and try again

    mysql -u root -p

    Yes! Now I can use MySQL from the command line. After Googling for hours, I’ve seen others with similar install/starting problems on the latest Snow Leopard. I think it all has to do with file permissions on the /bin and /data directories.

  • Get MySQL Certified For Just Under Four Grand

    Posted on November 15th, 2010 phpguru No comments

    Oracle just sent me an email with a “soft offer” to get 20% off MySQL Certification. I’m using GMail in Safari. I click to see the pricing. The click-through sent me to this page.

    The page requires you to pick your country, and then breaks. Second time, I get an error message: The packages couldn’t be received. Third time it worked.

    Normally, $4,635 – act fast and get MySQL Certified for only $3,708.

    So let me see if I understand this correctly… in a down economy, when the average guy is just lucky to have food on the table… I can pay just under four thousand dollars to be certified to use a free database? Hmmm. I’ve never been asked by any employer for such a certification.

    I think I’d rather eat this month.

    Great email campaign though – generated three clicks. D’OH! Fail.

  • Twitter API Snowflake and MySQL

    Posted on November 13th, 2010 phpguru 2 comments

    I’ve been looking at APIs lately, and in particular, the Twitter API.

    I managed to stumble into an advanced discussion on the Twitter developer forums about Twitter’s “Snowflake” update. One of the primary changes of the Snowflake update is the use of 64-bit integers for their ID.

    As a PHP & MySQL developer interested in learning more about the Twitter API, I want my database schema to be optimized properly.

    On this page of the MySQL website, it says, in part:

    Some things you should be aware of with respect to BIGINT columns:

    • All arithmetic is done using signed BIGINT or DOUBLE values, so you should not use unsigned big integers larger than 9223372036854775807 (63 bits) except with bit functions! If you do that, some of the last digits in the result may be wrong because of rounding errors when converting a BIGINT value to a DOUBLE.

    Does that mean I cannot use a BIGINT to store a Tweet’s primary key?

    Surely VARCHAR(64) will be much slower…

  • LVS-TUN How To on RackSpace Cloud

    Posted on October 6th, 2010 phpguru No comments

    I have to hand it to the sales/techs over at RackSpaceCoud.com.

    After just a few minutes with their Online Chat Sales, I was intrigued enough to create an account. Heck, it was free, and would give me a chance to experiment with server configuration via one of the hot topics today – virtualization.

    One of the first things I mentioned to Zack (I think that was his name) was that I was interested in making a more fault-tolerant web server setup. My client at the time had a dedicated server, but was planning on a few different television appearances, and didn’t want his site to go down with the surge of traffic.

    Load Balancer How-To using Apache Mod_Proxy (Easy)

    The RackSpaceCloud tech linked me to this article by Brandon Woodward on how to set up a simple load balancer using Apache. I followed that article to the letter, using one CentOS VM for the load balancer, and two CentOS VMs for web heads.

    Well, I have to admit, it was not as difficult as I thought it would be. Now granted, it’s not super robust, but for a simple round-robin load balanced setup, it only took an hour or two to setup and configure, and it is still in place on the client’s domain. Not bad, considering it’s the equivalent of 3 servers for less than $50/mo.

    Load Balancer How-To using LVS-TUN (Intermediate-Advanced)

    Having found the RackSpaceCloud article on setting up a load balancer with Apache just a few months prior, I was interested in learning more when I saw this new article by the same author on installing and configuring LVS-TUN.

    I was intrigued, because even though I believe having a mod_proxy-based load balancer solution on 3 servers in the cloud is preferrable in many ways to a single server with no load balancer at all, I could still see some areas for improvement and wondered what else was out there.

    Woodward explains it like this:

    LVS-TUN is a tunneling load balancer solution that will take all incoming requests through the load balancer and forward the packet to the web nodes. The web nodes will then respond directly to the client without having to proxy through the Load Balancer. This type of solution can allow for geo-load balancing, but will more importantly allow a customer use the bandwidth pool available from all web nodes, instead of relying on the limited through put of the load balancer.

    In other words, whereas the mod_proxy-based load balancer is quick and easy to set up and manage, the load balancer itself is a single point of failure, since it is acting as a proxy for the two web heads behind it. LVS-TUN on the other hand, enables the load balancer itself to be distributed, and also takes advantage of the web heads serving content directly back to the client.

    Whether you’re looking at a load balanced setup for scalability or just your own hardware architecture experimentation, without a doubt, the cloud is the best playground.

  • Director Shockwave Plug-in on Snow Leopard

    Posted on August 24th, 2010 phpguru No comments

    Installing Shockwave on Mac OS X (Snow Leopard) 32-bit, at the end you get this vague dialog:

    To use Shockwave, launch Safari in 32-bit mode.

    Then when launching Safari, you get:

    Shockwave Player Error

    Shockwave Player Error

    Um, ok, you have to hunt for the ‘More Info..’ button in Finder –> Applications –> Safari, not In Safari. Dialog Fail.

    Director Shockwave Plug-in Settings

    Director Shockwave Plug-in Settings

    Also, this has probably been covered on Direct-L, but if you visit a page with Shockwave content with the plug-in installed but Safari running in 64-bit mode, Safari hangs badly, requiring a force-quit. Adobe fail.

    Finder -> Applications -> Safari -> More Info...

    Finder -> Applications -> Safari -> More Info...

    Then check here…

    How to Run Safari in 32-bit mode for Shockwave

    How to Run Safari in 32-bit mode for Shockwave

  • Read Free Book Online: Thinking In Java

    Posted on July 21st, 2010 phpguru No comments
    Read the online e-book, Thinking In Java - free!

    Read the online e-book, Thinking In Java - free!

  • How to set the transparency of the Terminal window on Mac

    Posted on July 16th, 2010 phpguru No comments

    Thanks to this post on MacObserver, which explains you can make your terminal window semi-transparent. It helps, for instance, if you’re trying to type in some sample commands from a web browser in the background.

    1. Just go to Terminal -> Preferences -> Settings -> Window
    2. Click the background color chip
    3. Drag the opacity slider to the left.
  • Spaces Are Very Cool – Keyboard shortcuts to switch between running apps

    Posted on July 13th, 2010 phpguru No comments

    spaces-icon

    If you have a Mac and aren’t using spaces for multi-tasking, you’re missing out on one of the great features of modern OSen. Encapsulation.

    Even novice computer users understand that a computer can run more than one program at once. Using many apps simultaneously is called Multitasking. For example, you can edit your vector artwork in Illustrator, import the .ai file into Photoshop and apply effects to it, and use the PSD in an InDesign layout. You can run all 3 programs at once, and edits are instantly available in the other softwares when saving. As a web developer, I’m routinely running multiple browsers, an IDE (I use NetBeans and Dreamweaver), a text editor (on PC I use UltraEdit and TextMate on Mac), plus Photoshop if I have to work on any design elements.

    Well, multi-tasking is one thing. But are you getting the most out of your 8GB of RAM and quad-core processor? Encapsulation, such as provided by Apple Spaces, takes it one step further and makes staying organized and more efficient easier than ever.

    If you’ve ever spent any time on a laptop after using a dual screen setup, you’ve gotten really friendly with Alt-Tab (application switching) and Control-Tab (tab switching in one browser, or window switching in applications like Photoshop or Microsoft Word).

    As a platform-agnostic PC-at-work / Mac-at-home kinda guy, I always think it’s great when Apple takes a killer feature from the PC world (the reverse applies, too, though less often) and makes it better. For the longest time on Mac, I yearned for an easy way to switch between applications like you could on a PC.

    Keyboard Shortcuts to Switch Between Applications on Windows

    To switch between running programs on Windows PC try these steps:

    1. Hold down the Alt key,
    2. and then press the Tab key,
    3. and press the Tab key to cycle forward through running apps,
    4. or hold the Shift key and press Tab to cycle backward,
    5. and let go of the Alt key to use the selected App

    Go ahead. Launch a few programs and practice. It sounds more complicated than it is and will become second nature to you in no time.

    Anyway, at some point in the past, Apple adopted this feature for OS X… and made it even better.

    Keyboard Shortcuts for switching between running applications on a Mac

    On a Mac, to switch between applications, you need to:

    1. Hold down the Command key,
    2. and then press the Tab key,
    3. and press the Tab key to cycle forward through running apps,
    4. or hold the Shift key and press the Tab key to cycle backward,
    5. and let go of the Command key to switch to the highlighted app,
    6. Or, while still holding the Command key, hover your mouse over any app you want to switch to before letting go of the Command key.

    Just by adding that single OR at the end, Apple made a fantastic productivity tool exceptional.

    For the record, on a Mac, from the running app, you can choose [Application name Menu] -> Hide [Application name] or [Application name menu] -> Hide Others… which applies to the running applications. And you can also option-click on the finder (background application) when you have an application open in the foreground to instantly hide the foreground application. And of course there’s the yellow minimize icon that stuffs the app into a spring-loaded folder in the dock, but I digress.

    appsutil_spaces20090608Now, for the frosting on the cake.

    What are Apple Spaces?

    Imagine having 4 or 8 Macs instead of one. Would you be more productive if had 4 Macs and you could switch between them instantly? Apple Spaces lets you have the appearance of several virtual machines (all copies of your Mac). What’s cool about spaces is now you can run a couple of different browsers in one space, iTunes in another space, and your web development tools in a third space, and all your design apps in a fourth space. This keeps all those floating palettes and application windows more organized and is a great new way to gain even more productivity. By utilizing Spaces, you’ll spend less time application switching because each Space contains its own list of programs assigned to that space. And all those seconds can really add up, especially if you’re on deadline.

    1. Enable Spaces by going to  -> System Preferences -> Exposé and Spaces
    2. Then, to activate Spaces, press fn+F8.
    3. With the Space selector activated, you can drag apps from one space to another,
    4. and to switch between Spaces, you can use Ctrl-Right-Arrow and Ctrl-Left-Arrow to move between spaces,
    5. or to instantly go to a space, hold Ctrl and type the number corresponding to the space, for example, Ctrl-2 instantly switches to the second space.

    Give that a try, Mac guy. If you don’t think Spaces and application switching is useful, you’re wasting time and missing out on the full potential of a modern computer’s power.

    References
    macworld.com
    discussions.apple.com