My power supply came in the mail this week for my Toshiba A200 notebook so I decided to add Windows 7 to the installed OS list (currently booting Leopard 10.5.2 and Ubuntu 9.04). As always Windows hijacked the master boot record with it’s inferior boot manager – I had to fix this immediately.
GRUB is not as complicated as people make it out to be. In fact it is a very elegant solution to handling multi-boot platforms. Here’s a quick guide to steal your MBR space back from Windows :
- Boot into live CD such as Ubuntu or Knoppix – DSL works well and is fast.
- Open a terminal, if your live CD boots into a GUI – press ALT+CTRL+F2 to access a different console.
- type “cfdisk”
This part is tricky – you must find where GRUB currently lives – in the case of the image below (my rig) sda5 is where Ubuntu is installed – in GRUB this is equal to hd0,4 – since GRUB counts from 0, not 1.
Once you have determined what partition holds grub root files – close cfdisk (q) and type :
grub
root (hd0,X) <– where X is the grub count from 0 to your current Linux installation*
setup (hd0,0)
This will opverwrite Windows MBR installation and give access back to GRUB hooray! Next step would be adding Windows boot back to grub which has already been covered in my “How To Dual Boot Hackintosh + Ubuntu” article.
* I have a difficult time expressing this simple idea – if Linux is installed on SD5 then grub should say (hd0,4). If your boot partition is /dev/sda87, GRUB would be (hd0,86) – I hope this helps.
EDIT : I forgot to mention a huge congratulations to Microsoft for making an operating system that looks and feels like Vista with the intermittent stability of XP – huge upgrade IMO.. still far from Leopard.
Displaying HTML rows with offset background colours is a great way to present large amounts of data in a table – plus it looks nice.
Here are a few ways I display data in this format :
1. PHP Method (for use with browsers with no JavaScript or CSSv3)
We set a variable (i) to the value of 1. We then add 1 to i until it reaches 10. Within the loop we determine if there is a remainder when dividing i by 2, this lets us know if the number is even or odd. We add an odd class to every odd table row – and and even class to every even table row.
Why choose this method :
Choose this method when you know your users will be using older browsers or are unsure if they have javascript enabled.
2. CSSv3 Method (For use with newer browsers)
How it works :
CSS sets the ‘nth-child’ to use the defined background colour.
Why choose this method :
Simplicity!, however beware of outdated browsers.
3. jQuery (for use with JavaScript enabled browsers)
How it works :
Similarly to the CSSv3 method above – however does not require CSSv3 support in the browser. It adds the class ‘odd’ to every other row in the table.
Why choose this method :
Simple to implement however requires JavaScript – do not forget to load jQuery in your document head!
CodeIgniter is a SUPER powerful framework and I have picked up some tricks along the road. If you are looking for a simple way to jail access to parts of your application, the following is tried and tested – I use a similar approach in almost every application I write.
When you want to lock users out of just one function or an entire controller just create a new model (call it auth.php or something useful) and autoload it in the autoload.php file under config/
For a simple explanation consider the following :
Really all we are doing is determining which script they are trying to access and if they are allowed to be there or not based on their user permission level (set in a session at login authentication (usually from the database)).
To lock down a controller simply add $this->auth->jail(); to the constructor or whatever method / function you want to lock. This may not be the most elegant solution but it works and is tough to screw up – if you do not need group permissions and only a boolean result, take a look at this one :
As you can see, much simpler however only allows a check to see if the user is logged in or not. Once again, this can be loaded per function or per controller (in the constructor).
Hope this helps, I really do need to get to bed - probably have twenty revisions for this code after a wink of sleep. Always welcome feedback (criticism is expected with insomniatic posts).
PS. I am aware “insomniatic” is not a real word.
More than 15 people have contacted me looking to receive an invitation to Google Voice, unfortunately Google has decided not to include an invite quota for their invitees as they did GMail back in the day. Hope this clears up that question :: here are a few reasons why I believe Google has appeared to cease sending invitations to the public at large :
- PSTN termination is expensive – and as much cash as Google has, I can’t imagine it being extremely lucrative at this point with free North American dialing.
- Google purchased a block of 1,000,000 DID’s (phone numbers) which very well could be their “beta pool”. I could be wrong but they may keep their testers to a “small” group until they figure out if they should continue (turn a profit from the service).
- There have been issues with SIP trunking, apparently they dropped it quickly when some clever folks discovered Google was using shockingly weak passwords. This may be something they want to clear up before inviting more people.
As soon as I heard peoples patience was wearing thin, I decided I would sign up for another account with my other GMail address (seeing as I received my first invite within two days). It has now been a month with no response – so don’t fret, you are not the only one. As far as I can tell there doesn’t appear to be any pattern to their invite protocol, I think in the beginning it was really all about timing.
As frustrated as you may be eventually you will get your invite – lets hope you don’t have to wait another two months… Good luck to you all and in the meantime read my first impressions.









