• Home
  • Blogger
  • Github
  • Travel
  • The Tank Project
skip to main | skip to sidebar

Steven Occhipinti

A braindump.

Changing the default boot option with GRUB2

Gone are the days of the nice /boot/grub/menu.lst file, but with new tools comes new features.


Changing the default boot item

In Grub2 you can change the default boot entry by editing the /etc/default/grub file.
In this file you'll see something like this near the top:
GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

The first line above tells Grub to boot the first boot entry by default (menu item with index 0).
You can simply change this to menu entry you prefer, but whenever you make any change to this file you need to run the following command to make the changes take effect:
$> sudo update-grub

Changing the default boot entry from the command line

A new feature that Grub2 provides is to change this option dynamically from the command-line.
In order for this to work, instead of setting the GRUB_DEFAULT option to the desired index, set it to 'saved' instead, like this:
GRUB_DEFAULT=saved

And run update-grub to make the changes take effect:
$> sudo update-grub

Now you can use the grub-set-default and the grub-reboot commands.
Both commands take the index of the boot entry you want as a command line argument:

$> grub-set-default <entry>
This command will permanently set the default boot entry to the index specified on the command line, useful if you tend to change the default regularly.

$> grub-reboot <entry>
This command will reboot the machine and boot into the specified boot entry, but only that once. The following boot will use the default.
Posted by Steve at 21:33 2 comments
Labels: linux , ubuntu Email This BlogThis! Share to X Share to Facebook

Getting started with Ruby on Rails

I've been using Ruby on Rails for about a year and half now and I'm really enjoying it! At the time of writing (at least in Melbourne) there is lots of demand for Rubyist's, so it's great time to get involved.
I have a couple of friends who are interested in making the switch from Java to Ruby so I wrote them an email with some pointers on how to get started and then realized it would make a good blog post :)

Join the community!

Ruby and Rails are quite well known for their excellent communities, so the first step is to join your local group. For us in Australia, that group is "Ruby On Rails Oceania" (aka RORO).
They have meetups on the last Thursday of every month in Melbourne and a pretty active mailing list:
  • Ruby On Rails Oceania Mailing List
  • Ruby.org.au

Ruby and Rails resources:
  • Rails Guides - I use these almost everyday!
  • ApiDock - API's for Ruby, Rails and RSpec in one place
  • Rails For Zombies - A great beginners tutorial for rails
  • Rails Casts - Regular video podcast all about rails
  • Ruby5 - Regular 5 minute audio podcast on the latest news
  • ... a plethora of good books, such as "The RSpec Book", "Design Patterns in Ruby", etc. (alot of which I still need to read)

Getting started:

To get started you'll need to set up your development environment, here's what I use:
  • Vim... of course... although there are lots of alternatives, the most popular ones would probably be:
    • RubyMine (IDE) - used alot at work (commercial software)
    • Sublime Text 2 (Text editor)
    • TextMate (Text editor)
  • RVM (Ruby Version Manager)
    • Get from here: https://rvm.io
    • Follow the instructions to configure your shell to use RVM
    • Use RVM to install the latest ruby
      • $> rvm install 1.9.3
    • A newer alternative to RVM is RBenv
  • Once you have ruby installed, you will have the 'gem' command available
    • Gems are roughly equivalent to jars in the Java world
    • Use gem to install the latest rails
      • $> gem install rails
  • Once you have rails installed, you will have the 'rails' command available
    • Use the rails command to start a new project
      • $> rails new todolist
      • $> rails server
      • browse to http://localhost:3000
  • Now you can read the readme, the rails guides and make a simple app with scaffolding!

Things to keep in mind for RoR dev:
  • Rails is just a framework written in Ruby, so it will help to learn some straight Ruby too.
    • ruby-lang.org is a good place to start
  • Ruby on Rails strongly supports DRY principles, don't reinvent the wheel, theres problably a gem that already does what you want.
    • To find gems, good places to look are:
      • Ruby-Toolbox.com
      • RailsCasts.com
      • RubyGems.org
      • GitHub.com
  • The majority of Ruby projects are:
    • Developed using TDD/BDD, so you'll need to learn the testing frameworks:
      • Test::Unit (default with rails)
      • RSpec (a popular replacement for Test::Unit)
      • Cucumber (BDD)
    • Developed on MacOSX - for new comers (like myself) some essentials are:
      • brew - a mac package manager (like apt or yum)
      • iterm2 - really good terminal emulator
    • Deployed on Linux
      • Basic Linux foo is really useful
    • Version controlled with git
      • If you need to learn git, I highly recommend Pro git

That's a quick overview of what I can recommend to get going based on my own experience, things will obviously change over time, and others may have other opinions, if so feel free to leave comments below.
Posted by Steve at 23:29 0 comments
Labels: programming , rails , ruby Email This BlogThis! Share to X Share to Facebook
Newer Posts Older Posts Home

Blog Archive

  • ►  2013 (4)
    • ►  June (1)
    • ►  May (1)
    • ►  March (1)
    • ►  January (1)
  • ▼  2012 (17)
    • ►  December (1)
    • ►  October (1)
    • ▼  September (2)
      • Changing the default boot option with GRUB2
      • Getting started with Ruby on Rails
    • ►  August (2)
    • ►  July (1)
    • ►  May (2)
    • ►  April (2)
    • ►  March (3)
    • ►  February (3)
  • ►  2011 (33)
    • ►  December (1)
    • ►  November (3)
    • ►  October (3)
    • ►  September (4)
    • ►  August (3)
    • ►  July (4)
    • ►  June (6)
    • ►  May (6)
    • ►  April (3)

Labels

android (5) apache (1) arch linux (1) arduino (1) bash (11) calendar (1) compiz (1) design (1) diff (1) email (1) gimp (1) git (3) github (2) gnome3 (1) Google (2) hacking (1) hardware (4) howto (1) htpc (1) java (1) lamp (1) linux (28) Mac (2) minecraft (2) mysql (1) netduino (1) nfs (1) parallel port (1) patch (1) photography (4) php (1) pidgin (2) printer (1) programming (6) python (1) rails (1) regex (5) review (3) ruby (3) Samsung Galaxy S3 (2) Samsung Series 9 (1) security (1) sed (3) ssh (1) sudo (1) tank (2) Toshiba Portege (1) troubleshooting (1) ubuntu (16) ui (2) unity (2) vim (5) webcam (1) websites (3) xbmc (1) xclip (1) xul (1)

Total Pageviews

Sparkline
 
Copyright (c) 2010 Steven Occhipinti. Designed by Conveyancing
High Deductible Health Insurance, Purchase Beats