December 2010
7 posts
4 tags
OpenCart - Setting up cURL on Ubuntu for...
During installation of OpenCart you are required to have certain PHP extensions active one of them is cURL, if it’s not then install it like so: sudo apt-get install curl libcurl3 libcurl3-dev php5-curl Then we need to restart apache apache2ctrl restart Refresh the page if you are still on it and it should be working. I think OpenCart could offer up a more pleasant installation...
Dec 13th
3 notes
2 tags
WordPress - It doesn't need FTP access, it needs a...
If you’ve ever attempted to install WordPress on your own you might find that it’s asking for your FTP/SFTP credentials. A seemingly absurd prospect since it’s running on the server, and should be perfectly capable. What is happening is that the apache user doesn’t have write access to wordpress/wp-content, and WordPress is trying to get around that problem by using the...
Dec 6th
7 notes
2 tags
Chrome Extensions - Unexpected Token ILLEGAL
I wrote a chrome extension uploaded it to the Google extension gallery earlier today, and after installation it refused to work. Investigating showed an Unexpected Token ILLEGAL message, which if I trusted chrome occurred right after the DOCTYPE in the background page (yeah right). What in reality is happening is that whenever JSON.parse encounters something which it can’t parse it throws...
Dec 4th
2 notes
4 tags
ImageMagick - Scaling and padding a screenshot for...
Google has a new policy for the chrome extension gallery where screenshots need to be 400x275 (or some larger multiple of that). I soon found out that ImageMagick -came to the rescue again with the extent command which when scaling a picture to a larger size will add padding to the image (you can use -gravity to decide where). So I ended up with this for producing the screenshot of an appropriate...
Dec 4th
4 notes
5 tags
Chrome Extensions - Content script are unable to...
There’s a bug (#20773) in chromium that causes content scripts to be unable to access frames. If you run the following snippet and the initial condition is true. Then we get the output: This was a bit of a bother since I was trying to find what the activeElement on a page was and that property sits on the document. So to be able to get the activeElement on pages with iframes I needed to...
Dec 3rd
8 notes
3 tags
Chrome Extensions - 'Failed to load resource' on...
I was using the very descriptively named web-app-theme for the options page of a chrome extension I’m writing and it has backgrounds specified in the CSS files in the default theme with a relative paths: background-image:url(images/menubar-background.png'); Despite putting the images in the correct place in my extension directory, chrome was giving off ’Failed to load resource’...
Dec 2nd
2 notes
3 tags
Ubuntu - Quickly scaling images in the command...
The most convenient way of scaling images in Ubuntu I’ve found this far is using ImageMagick. Or perhaps more interestingly Paint is one of the few things I miss from windows. Firing up GIMP to do basic Image editing is a bit of a bother, and you keep forgetting what the command line tool names are.
Dec 2nd
2 notes