I had some trouble compiling pcntl PHP module on OS X Lion so I thought I’d share this solution. In fact, you can use these steps to compile any other PHP module. First download the latest php source from PHP.NET cd into your php src directory, then: cd ext/pcntl phpize ./configure --enable-pcntl When I ran […]
I’ve wanted to write a few stored procedures in MySQL for a while now, but I found it very fiddly and was unable to come up with one very quickly. Tonight I was determined to read up on MySQL documentation and get one going. For my reference only, this stored procedure will loop through a […]
Internet Explorer for Mac Are you looking to install?Internet Explorer for Mac??Today I discovered a nice tool on Github which installs free Windows virtual machines using VirtualBox on OS X. The only reason I’d use these virtual machines is to have different versions of Internet Explorer browsers running side by side for testing purposes. So […]
Today I discovered opendiff tool that’s native to OS X – provided you have installed the Xcode on your system. It allows you to compare 2 directories and perform actions such as merge-left, merge-right etc… Opendiff simply launches FileMerge OS X utility, which is another one I didn’t know about, and displays differences between 2 […]
I’ve been using Charles HTTTP Proxy for bandwidth throttling and network monitoring in general. It’s a great little tool, but when it comes to bandwidth throttling, it will only throttle HTTP and HTTPS traffic on ports 80 and 443 respectively. I thought there had to be a way to throttle bandwidth on any port using […]
I’ve spent last 2 days scripting virtual server deployment on Amazon cloud. For my reference, these are some useful commands I had to use to get the job done. 1. Hash “Hello World” string using SHA256 algorithm echo -n "Hello World" | shasum -a 256 You can also hash a file shasum -a 256 myfile.ext […]
I recently changed my ISP from Optus to TPG and when I tried to start my local apache instance and I got this error httpd: apr_sockaddr_info_get() failed for 192-168-1-107.tpgi.com.au httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName That gave me a hint that my local hostname had changed. […]
I’ve recently been working on text file decryption using Railo server. My files were encrypted in ActionScript 3 with the powerful AES-128 algorithm. For more info on AS3 encryption see Hurlant Crypto demo. My challenge was to decypt this heavily encrypted content on a different platform, i.e. Railo with underlying Java Cipher capabilities. The 6 […]
I’ve had to reinstall apache server on my Mac and the only way to do it cleanly was to nuke my existing apache installation and compile a fresh one from source. That’s all cool, but I could never remember what modules I needed and how to enable them. ?If you don’t load any modules at […]
The first of multiple files that make up a split archive created with WinZip; uses the same compression as a standard .ZIP file, but must be decompressed along with the related split archives (.Z02, .Z03, etc.). Split archives are often used to shrink the size of large files for e-mail attachments or file downloads. They […]
I tried uploading a large file from Flash to php back end and got the following error: PHP Warning: POST Content-Length of 18348279 bytes exceeds the limit of 8388608 bytes It’s self explanatory, my PHP installation by default only allows up to 8MB of data to be uploaded to the server. To solve this you […]
I had a go at loading some assets from Amazon S3 with AS3 bulk loader and ran into trouble. Generally I specify loader context when I load files from external source, but I thought Bulk Loader handled it all internally. ?After browsing the source code I found out that you can pass the LoaderContext into […]
I just wrote a little mysql snippet that will replace all instances of ‘domain1’ to ‘domain2’ in a given table and column. So why not share it. ?All you need to do is set the variable values in first 4 lines of code below: SET @tblname = "tablename"; SET @colname = "columnname"; SET @lookfor = […]
This week I had to unzip some files using ColdFusion 7 (I know it’s ancient technology) and I realised that CF7 doesn’t natively support zipping/unzipping of files! ?Fortunately, ColdFusion can utilise the underlying power of Java to achieve this. ?I found this neat Java article – Unzipping Files with java.util.zip.ZipFile and simply translated it into […]
Today I had an interesting problem embedding a swf file compiled in Flash Professional CS3 into Flash Builder 4. My SWF file contained a Flash TextArea component, which dispatches a ComponentEvent when scroll bars are activated. This event resulted in the following error in Flex: TypeError: Error #1034: Type Coercion failed: cannot convert fl.events::ComponentEvent@1b06b4c1 to […]
Here’s another useful command line utility – Secure Copy or SCP, that allows you to securely transfer computer files between a local and a remote host. sudo scp localfile.dmg remoteuser(at)somehost.com://pathtoupload/ Much neater that using an SFTP client no? Thanks to my work colleague Luke for bringing this to my attention 🙂 Marko
Just a quick one for my reference. To create a jar package from a list of Java classes, use the following command in terminal: jar cf jarredfile.jar directory_to_jar Marko
I’ve been using command line for zipping and ‘tarring’ for a while and never really needed to exclude directories from the archive. I had to do this today and I worked out that I had to use absolute paths to achieve this. The following examples will exclude multiple directories from tar and zip archives respectively: […]
I installed a new verison of Ubuntu Lucid Lynx the other day on a brand new formatted hard drive. ?Installation went smoothly as you’d expect, but when I rebooted the server I was stuck on GRUB menu (my worst nightmare). ?The server just wouldn’t load the operating system and typing ‘boot’ in GRUB gave me […]
I’ve been trying to get to the bottom of a “Java Heap Space” error on my local Railo installation and decided to use?JConsole?to monitor Tomcat server. ?JConsole?is a very useful Java application monitoring tool, which is bundled into every JRE. ?You can run it by simply executing jconsole binary: $JAVA_HOME/bin/jconsole Where $JAVA_HOME is the path […]