Monthly Archives: January 2012

ec2 server create syntax (man page)

This is the knife create syntax page. I was trying to launch an instance of Chef with the “knife create” command that chef’s knife provides. The documentation page gives this example for how to launch a web server on Amazon’s EC2 server, but without much explanation of the terms: knife ec2 server create -r “role[webserver]” -I ami-2d4aa444 –flavor m1.small -G www,default -x ubuntu -N server01 After doing some searching I just ended up digging into the code and found this information quite helpful, and so I am sharing it: -f FLAVOR ( or –flavor FLAVOR ) The flavor of server (m1.small, m1.medium, etc) default: m1.small -I IMAGE ( or –image IMAGE ) The AMI for the server -G X,Y,Z ( or –groups X,Y,Z ) The security groups for this server default: “default” -Z ZONE ( or –availability-zone ZONE ) The Availability Zone default: us-east-1b -N NAME ( or –node-name NAME ) The Chef node name for your new node -S KEY ( or –ssh-key KEY ) The AWS SSH key id -x USERNAME ( or –ssh-user USERNAME ) The ssh username default: root -P PASSWORD ( or –ssh-password PASSWORD ) The ssh password -i IDENTITY_FILE ( or –identity-file IDENTITY_FILE ) The SSH identity file used for authentication –prerelease Install the pre-release chef gems –bootstrap-version VERSION The version of Chef to install -d DISTRO ( or –distro DISTRO ) Bootstrap a distro using a template default: ubuntu10.04-gems –template-file TEMPLATE Full path to location of template to use –ebs-size SIZE The size of … Continue reading

Posted in Linux, Server Admin, Server Administration, Tech Tips, Web Development | Tagged , , , , , , | Leave a comment

jQuery: Change Doctype

There are a few things you might want to know if you’re looking to change the document type (doctype) using jQuery or Javascript. First, doctype is listed as a property in the W3C documentation, and is defined as read-only: interface Document : Node { readonly attribute DocumentType doctype; readonly attribute DOMImplementation implementation; readonly attribute Element documentElement; Element createElement(in DOMString tagName) raises(DOMException); DocumentFragment createDocumentFragment(); While it may be possible to insert a doctype with javascript / jquery above the HTML tag, it is not advisable to do so. Sample code which would do this might look like: <!– no doctype, loads in Quirks Mode (BackCompat) –> <html> <!– rest of the document, then at the end: –> <script> alert(‘now in compatMode ‘+document.compatMode); if (document.compatMode===’BackCompat’) { setTimeout(function() { var markup= document.documentElement.innerHTML; markup= ‘< !DOCTYPE html><html xmlns=”” lang=”en” xml:lang=”en”>’+markup+'</html>’;; document.write(markup); document.close(); }, 0); } </script> </html> via

Posted in Tech Tips, Web Development | Tagged , , , , , , | Leave a comment

10 Amazon EC2 Alternatives

Amazon EC2 Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. It is dersigned to make web-scale computing easier for developers. Amazon EC2’s simple web service interface allows you to obtain and configure capacity with minimal friction. It provides you with complete control of your computing resources and lets you run on Amazon’s proven computing environment. Amazon EC2 reduces the time required to obtain and boot new server instances to minutes, allowing you to quickly scale capacity, both up and down, as your computing requirements change. Amazon EC2 changes the economics of computing by allowing you to pay only for capacity that you actually use. Amazon EC2 provides developers the tools to build failure resilient applications and isolate themselves from common failure scenarios. Digital Ocean Deploy an 512MB RAM and 20GB SSD cloud server in 55 seconds for $5/month. Simple, fast, scalable SSD cloud virtual servers. This competitor was recently featured on Uncrunched and the site boasted, “Digital Ocean v. AWS: 10x Performance For 1/3 Cost”. I am floored at how fast their servers are (if you know linux try doing something like du or updatedb or even find / -iname “*firefox*” – each command takes about 1 second! Slicehost / Rackspace Create Cloud Virtual Servers in minutes and pay per usage. Get a Windows or Linux Cloud Server with root access. 1 to 50 servers in minutes. Choose a server size and pay for what you use. Accessible … Continue reading

Posted in Server Admin, Server Administration, Tech Opinion, Tech Tips, Web Development | Tagged , , , , , , , | 8 Comments

Statcounter: Add Existing Project to Group

If you can’t find the option to move my existing projects to a group: Click on ‘Organise Projects’ beneath your list of Projects Then type new group name in the “Move to Group” box and tick the projects you want to include Press submit How to Add your Project to an Existing Group (screenshots) Note: you’ll need at least 4 projects to be able to view and use this feature.

Posted in Marketing, Tech Tips, Web Development | Tagged , , , , | Leave a comment

How to Monitor Canon Printers with SNMP

I’m working to set up monitoring of Canon printers with SNMP, and I’m having a hard time finding resources around the internet on how to go about doing this, so this article will be collecting the resources I’ve found and putting them in once place. Commands for Monitoring Canon Printers with SNMP One of the problems that I had to look into was monitoring of CANON printers, and properly modifying Nagios config files for that: Once you understand a little how NAGIOS works you will understand what I am trying to show you here in example: in /usr/local/nagios/etc/objects/commands.cfg I added a command: define command{ command_name check_snmp_canon command_line $USER1$/check_snmp -H $HOSTADDRESS$ -l STATUS -C public $ARG1$ $ARG2$ } then in: /usr/local/nagios/etc/objects/printer.cfg you define host and service like this: define host{ use generic-printer host_name SOMECANONPRINTER alias SOMECANONPRINTER Alias address “IP of the printer goes here” hostgroups network-printers } define service{ use generic-service host_name SOMECANONPRINTER service_description Printer Status check_command check_snmp_canon!-o hrDeviceStatus.1 -r “2|3” normal_check_interval 10 retry_check_interval 1 } via Some of the commands I’ve tried to execute directly from the command line use something like this: /usr/lib/nagios/plugins/check_snmp -H -C public -o hrDeviceStatus.1 snmpwalk -v <snmp version, typically ‘2c’> -c <community string> <agent address, e.g. ‘’> snmpwalk -v 2c -c public What is SNMP Simple Network Management Protocol (SNMP) is a set of standards for managing network devices, network devices are monitored by a SNMP manager which connects to an SNMP agent on network devices. Data which the SNMP agent … Continue reading

Posted in Linux, Server Administration, Tech Tips | Tagged , , , , , , , , , | 8 Comments

Google Search Lucky

Google’s “I’m Feeling Lucky” search in Google Chrome Do you want to use Google’s “I’m Feeling Lucky” search in Google Chrome? It’s easy using the custom search engines. In Google Chrome click the wrench icon and then choose prferences next click manage custom search engines Inser the string(s) below and a name (pretty much irrelevant) and they shortcut keyword you want to use. I use > Google Search Lucky Strings Standard “Im Feeling Lucky” Search SSL Encrypted “Im Feeling Lucky” Search Note: I’ve stripped out all items such as encoding and referrer to keep this as clean and simple as it can be. Now you can simply type in something like > Google Docs into your browser bar and have it go to the first result – which is most likely the right place.

Posted in Mac, Software, Tech Tips, Web Development | Tagged , , , , , , , , , , | 2 Comments

Make YSlow work with Firefox 9.0

YSlow won’t work with Fire Fox 9 because it requires Firebug to work. And the latest versions of Firebug, 1.8, 1.9, and 1.10, do not work with YSlow. Until Yahoo gets around to updating their plugin, use this method to make YSlow work with your Firefox. You may want to backup your profile before doing this – instructions are provided at the end of the posting. Type in about:config into your address bar. After accepting the “this is dangerous” message right click and create a new entry. Make sure it is a BOOL. Set the name to: extensions.checkCompatibility.9.0 and then set the value to false Now visit and click on the latest version of Firebug 1.7, which I believe is firebug-1.7X.0b4.xpi I’m assuming that you already have YSlow installed – but if you don’t then install it too. Restart Firefox. Voila! Now your YSlow is working again! Feel free to leave a comment to thank me or suggest any tips or tricks related to YSlow and Firefox :) You can either keep using Firebug 1.7 but if it’s really bothering you go ahead and reinstall the latest Firebug and then create a separate profile to use with YSlow. See Mozilla’s notes on using separate profiles:

Posted in Mac, Software, Tech Tips, Web Development | Tagged , , , , , , , | Leave a comment

Setting Nagios host check frequency and Nagios default check interval

With nagios (nagios3), the normal check interval is set to 5 minutes, and the retry is set to 1 minute. If your services are not that critical, you can increase the default check interval, perhaps from five minutes (or 600 seconds) to something like 10 minutes or 15 minutes. Look for a file like generic-service_nagios.cfg in your configuration directory, possibly: /etc/nagios3/conf.d/generic-service_nagios2.cfg Then you can find the corresponding lines to make the edits you need: define service{ name generic-service active_checks_enabled 1 passive_checks_enabled 1 parallelize_check 1 obsess_over_service 1 check_freshness 0 notifications_enabled 1 event_handler_enabled 1 flap_detection_enabled 1 failure_prediction_enabled 1 process_perf_data 1 retain_status_information 1 retain_nonstatus_information 1 notification_interval 0 is_volatile 0 check_period 24×7 normal_check_interval 5 retry_check_interval 1 max_check_attempts 4 notification_period 24×7 notification_options w,u,c,r contact_groups admins register 0 }

Posted in Software, Web Development | Tagged , , , , , | Leave a comment

Elinks User Agent Override

To manually set the useragent for the e-links web browser, edit this file: ~/.elinks/elinks.conf The syntax for setting or overriding the user agent is something like this: set protocol.http.user_agent = “Firefox/” Or possibly this for a more realistic agent string: set protocol.http.user_agent = “Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20060426 Firefox/”

Posted in Web Development | Tagged , , , , , , , | Leave a comment