pitSTOP

How To Run Google Chrome OS From A USB Drive [Windows]

Posted by: aneeska on: November 24, 2009

You must have seen this post in makeuseof.com . It walks you through step-by-step procedure with which you can boot Google’s Chrome OS from USB in any PC! If you haven’t tried the image, its time you hurry.

Welcome Screen

When Chrome OS boots (in my case a little under 10 seconds), it gives you a login screen like this:

chromium os login page

picture taken from makeuseof.com article : http://bit.ly/8e6uCw

Username : chronos

Password : password

It will give you this landing page:

chrome os landing page

picture taken from makeuseof.com article : http://bit.ly/8e6uCw

If not:

It happened to me – I was sitting behind a proxy and the connection was not going through since in my network all the machines have static IPs – unknown, unassigned IPs can’t access internet.

In this situation (and similar ones) chrome OS will simply say “Unable to reach internet – Offline mode not supported in this build:-(

What to do then?

I tried login in from a terminal ( to reach a terminal, press Ctrl+Shift+F2 ) . But the same issue – I don’t have connection – I didn’t know root password.

So I mounted the disk in another linux machine.

Modifying the USB Disk

The USB disk will have 3 partitions – two ext3 and one swap . To get the file system mount the third partition :

$ mount /dev/sdaX /mnt/sdaX

$ cd /mnt/sdaX

Task 1 : Remove password for root and chronos usernames

Open the file /etc/passwd in vi editor and locate the lines starting with “root” and “chronos“. Delete the first “x” in each of those lines – so that they will something like this :

root::….(do not alter the rest)

chronos::…(do not alter the rest)

Task 2 : Setup Static IP for the network

Open the file /etc/network/interfaces and put the following lines:

auto eth0
iface eth0 inet static
# static address available to you
address 192.168.1.42
# specify the network
netmask 255.255.255.128
#specify the gateway
gateway 192.168.1.15
# specify the default route
up route add -net 172.20.11.0/16 gw 172.20.10.254 dev eth0

Next open /etc/resolv.conf and put the IP of your nameserver, like this:

nameserver 192.168.1.5

Done!

Reboot into the Chrome OS and type in only the username – “chronos” – Press enter and viola! you are in to Chrome OS! :-)

Note: But the joy is short lived – ChromeOS crashes unfailingly after a maximum of five minutes in to the desktop! :-)

howto: AllowOverride ExpiredByType

Posted by: aneeska on: November 17, 2009

There’s no such option! There is – technically – but not quite.

Background:
I wanted to override certain aspects of the apache server using ‘.htaccess’ file, like ExpiredByType – for adding Expiry headers to files that are requested from the server – and SetOutputFilter – to send files gzip comoressed from server.

Here’s I what I wanted:

Add an expiry of one month from the time of access to the following File Types -
gif
javascript
jpeg
ico
css

Enable gzip compression for the following type of docs
html
css
javascript

Putting the above rules in “httpd.conf” worked fine. But when the same was put in “.htaccess”, these rules were ignored.

Reason:

In order for the server to use the settings from “.htaccess” file, the following condition need to be met:
- AllowOverride should be set to some thing other than “None”

To add Expiry header, the following conditions should be met:
- expires_module should be enabled in apache config file
- “ExpiresActive On” rule should be set

Solution:

AllowOverride take 3 types of arguements:
1. All - all directives in .htaccess context are allowed
2. None - .htaccess file is ignored by server
3.
This can be one among the following
a. AuthConfig
b. FileInfo - for Gzip compression
c. Indexes - for stamping expiry header
d. Limit

So the final httpd.conf should have the following lines:

LoadModule expires_module modules/mod_expires.so
AllowOverride FileInfo Indexes

In .htaccess file, the following rules are added:

#Add Expire header to the file types listed above
ExpiresActive On
ExpiresDefault “access plus 1 month”
ExpiresByType image/gif A2592000
ExpiresByType text/javascript A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/ico A2592000
ExpiresByType text/css A2592000

#enable gzip compression
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/css text/javascript text/plain

Sorry, command-not-found has crashed!

Posted by: aneeska on: November 2, 2009

sorry

howto: Mirror using RAID Level 1

Posted by: aneeska on: October 29, 2009

Creating a Mirrored RAID array

$ mdadm –create /dev/mdX –level=1 –raid-devices=2 /dev/sdY /dev/sdZ

- sdY , sdZ : partitions/disks taking part in the mirroring. They could be anything depending upon your situation. For ex, sdY could be sdc1 and sdZ could be sdf2

- mdX : name of the RAID partition on to which the partitions sdZ and sdZ are associated

Once the command is successfully executed, mdX will be listed in “/proc/partitions” as a partition. This can now be mounted and used a normal EXT2/3 partition. Now the partitions sdY and sdZ will contain exactly the same data.

info : To know the mirroring status as well as the health of the RAID arrays, do “cat /proc/mdstat” from command line. Output of the command is self-explanatory (else refer man pages).

Stopping the raid array

$ mdadm –manage –stop /dev/mdX

 

Use only one of the disks of the array

The disk/partition sdY or sdZ will not be mountable by themselves using mount command. For that, “assemble” a raid array with any one of the disk which you want, as given below:

$ mdadm –assemble –run /dev/mdX /dev/sdY

or

$ mdadm –assemble –run /dev/mdX /dev/sdZ

 

Remove/Wipe out only RAID array information from a disk

To remove a RAID array configuration from the disks participating in RAID, use the “–zero-superblock” option removes the RAID information from the partitions and hence the partition will no longer will be recognized as a RAID component. Individual partitions (ex. mdY, mdZ) can be mounted afterwards and data will be preserved.

$ mdadm /dev/mdX –stop # stop RAID

$mdadm /dev/mdX –zero-superblock /dev/sdY

or

$ mdadm /dev/mdX –zero-superblock /dev/sdZ

 

Re-creating RAID array with the drives (sdY/sdZ) whose superblock has been zeroed

Use the command for creating the RAID array. It will ask whether to create array with partitions containing ext2fs. Answer yes and the RAID array will be recreated. Existing data in the partitions will be preserved.

 

– acknowledgements to my friend jk for the info


advertisement :

Ad_blumblum

howto: merge pdfs into one

Posted by: aneeska on: October 16, 2009

OS: Linux
Application : pdftk
Package : pdftk
Usage :

# pdftk 001.pdf 002.pdf cat output output.pdf

tweeting is a way of life!