Wednesday, 20 February 2013

Install Raspbmc media center on RaspberryPi

[caption id="attachment_719" align="aligncenter" width="225"]RASPBMC RASPBMC[/caption]

Raspbmc  media center for the Raspberry Pi and is based on Raspbian and XBMC.

All credits go to Sam Nazarko, Thanks for excellent media center, works perfectly.

Reference: http://www.raspbmc.com/,

Install raspbmc on SDcard from MAC OSX / Linux / Windows ,

Download the raspbmc, change permission and execute. Make sure that you select the correct disk ( verify the info from disk utilities in MAC OS X)
$ curl -O http://svn.stmlabs.com/svn/raspbmc/testing/installers/python/install.py
$ chmod u+x install.py
$ sudo python install.py
Raspbmc installer for Linux and OS X
http://raspbmc.com
----------------------------------------
Please ensure you've inserted your SD card, and press Enter to continue.
Enter the 'IDENTIFIER' of the device you would like imaged:
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *120.0 GB   disk0
   0:      GUID_partition_scheme                        *500.1 GB   disk1
   0:                  Apple_HFS Macintosh HD           *118.7 GB   disk2
   0:     Apple_partition_scheme                        *17.4 MB    disk3
   0:     FDisk_partition_scheme                        *15.9 GB    disk4
Enter your choice here (e.g. 'disk1', 'disk2'): disk4
It is your own responsibility to ensure there is no data loss! Please backup your system before imaging
You should also ensure you agree with the Raspbmc License Agreeement
Are you sure you want to install Raspbmc to '/dev/disk4' and accept the license agreement? [y/N] y
Downloading, please be patient...
Downloaded 16.35 of 16.35 MiB (100.00%)
Unmounting all partitions...
Unmount of all volumes on disk4 was successful
Please wait while Raspbmc is installed to your SD card...
This may take some time and no progress will be reported until it has finished.
0+1173 records in
0+1173 records out
76800000 bytes transferred in 14.809589 secs (5185829 bytes/sec)
Installation complete.
Would you like to setup your post-installation settings [ADVANCED]? [y/N]N


  • Once the installation is completed, eject it from the system.

  • Insert the sdcard to RaspberryPi.

  • Connect the RaspberryPi using Ethernet cable, continue with the post installation steps.

Tuesday, 19 February 2013

Create NAS/SAN storage with openfiler, work with VMware ESXi as sharedstorage

- Download the openfiler installation ISO , download link

I have downloaded the Installation ISO image (x86/64).

Basically we need to create open filer as a virtual machine with say 20 GB thin provisioning, and attach another disk/datastore to the virtual machine to configure it as SAN.

- Download and install  the Installation ISO image (x86/64) as a virtual machine, noting fancy here just do a normal installation.

- Once rebooted you get a web interface to login on port 446, https://< ip > :446/

- Login with username: openfiler, and password: password

Network access configuration:

set up network access configuration, enter the Network/Host , who are allowed to access.

System --> Network Access Configuration

[caption id="attachment_683" align="alignnone" width="300"]Network Access Config Network Access Config[/caption]

[caption id="attachment_682" align="alignnone" width="300"]Network Access Config Network Access Config[/caption]

Create a new physical volume

Volumes --> Block devices

[caption id="attachment_684" align="alignnone" width="300"]Create Physical Volume Create Physical Volume[/caption]

Click on Edit devices on the hard disk where we going to create new physical volume, this is the extra hard drive we added to the virtual machine at the beginning. (/dev/sdb)



[caption id="attachment_685" align="alignnone" width="300"]Create Physical Volume Create Physical Volume[/caption]

Select Physical volume as your partition type ( assuming that you are not using RAID), and set the mode to Primary, click create.

[caption id="attachment_686" align="alignnone" width="300"]Create Physical Volume Create Physical Volume[/caption]

Create new Volume Group

Let us create a volume group for the physical volumes

Volumes --> Volume groups , enter a group name and select the physical drive and click Add volume

[caption id="attachment_687" align="alignnone" width="300"]Create volume group Create volume group[/caption]



[caption id="attachment_688" align="alignnone" width="300"]Create volume group Create volume group[/caption]

Create the Volume

Volume --> Add Volume

Enter Volume Name , Description, required space and select File System block.

[caption id="attachment_689" align="alignnone" width="300"]Create Volume Create Volume[/caption]

[caption id="attachment_690" align="alignnone" width="300"]Create Volume Create Volume[/caption]

Now Enable and Add  iSCSI Target

Services --> iSCSI Target Enable, Start

[caption id="attachment_691" align="alignnone" width="300"]Start iSCSI target Start iSCSI target[/caption]

Volumes --> iSCSI Targets --> Target Configuration --> Add new iSCSI Target

[caption id="attachment_703" align="alignnone" width="300"]Add new iSCSI target Add new iSCSI target[/caption]

Setup the LUN Mapping and allow access to iSCSI target

[caption id="attachment_704" align="alignnone" width="300"]Setup LUN Mapping Setup LUN Mapping[/caption]



[caption id="attachment_705" align="alignnone" width="300"]Allow access to iSCSI target Allow access to iSCSI target[/caption]

Now the open filer is ready to use.

In VMware ESXi

Create new VMKernel network adapter to use for iSCSI connection

[caption id="attachment_706" align="alignnone" width="300"]VMKernel Adapter VMKernel Adapter[/caption]

[caption id="attachment_707" align="alignnone" width="300"]VMKernel Adapter VMKernel Adapter[/caption]

[caption id="attachment_709" align="alignnone" width="300"]VMKernel Adapter VMKernel Adapter[/caption]

Click on storage adapter --> Add new

[caption id="attachment_710" align="alignnone" width="300"]Add storage adapter Add storage adapter[/caption]

Click on properties, add the VMkernel switch and the discover the iSCSI target.

[caption id="attachment_711" align="alignnone" width="256"]Add VMKernel to iSCSI adapter Add VMKernel to iSCSI adapter[/caption]

[caption id="attachment_712" align="alignnone" width="256"]Dynamic discovery Dynamic discovery[/caption]

Now your ESXi will show the openfiler as a datastore :)

[caption id="attachment_713" align="alignnone" width="300"]Openfiler datastore Openfiler datastore[/caption]

More information about Openfiler:

http://www.openfiler.com/products

Monday, 18 February 2013

Configure static IP on Raspberry Pi


Some access points does not deliver DHCP to the raspberrypi. You could assign the IP statically as follows:

Edit the /etc/network/interfaces file

Comment out the following lines.
> #allow-hotplug wlan0
> #wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
> #iface eth0 inet manual
Add following configs.
auto lo 
iface eth0 inet dhcp
auto wlan0
iface wlan0 inet static
address x.x.x.x
netmask x.x.x.x
gateway x.x.x.x
pre-up wpa_supplicant -Dwext -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -B
Re-enable the interface.
ifdown wlan0
ifup wlan0
Configure the name server if required.
/etc/resolv.conf
nameserver x.x.x.x

Tuesday, 8 January 2013

Upgrade, Restore Drupal 7

Shell script to upgrade and restore Drupal 7 website
This script will take care of the necessary actions required for upgrading drupal to higher versions.

USAGE

  • Copy the script to your webserver.

  • Edit the script and change the variables to match with your setup

  • Give execute privilege to the owner of the script (chmod u+x upgrade-restore-drupal7.sh)

  • Execute the script ./upgrade-restore-drupal7.sh

UPGRADE

$ ./upgrade-restore-drupal7.sh 
 Please enter your choice:
 1. Update drupal
 2. Restore an old installation from backup
 3. Exit
1
Please enter the new drupal version (eg: 7.15) : 7.18
Downloading drupal-7.18
Downloaded the the drupal version drupal-7.18
Current site backup is created: /home/foo/backups/08-01-2013-0938
Database backup created: /home/foo/backups/08-01-2013-0938.sql
Site is in maintanence mode now
Removed all drupal core files from destination
Copied the new version contents
Drupal updated to drupal-7.18
Site is active again, but please update your database, 
please visit http://<yourwebsite>/update.php   
to finalize the process 


RESTORE

$ ./upgrade-restore-drupal7.sh 
 Please enter your choice:
 1. Update drupal
 2. Restore an old installation from backup
 3. Exit
2
List of available backups
08-01-2013-0753
08-01-2013-0758
08-01-2013-0804
08-01-2013-0841
08-01-2013-0849
08-01-2013-0858
08-01-2013-0900
08-01-2013-0904
08-01-2013-0905
08-01-2013-0938
Please enter the backup file name to restore: (eg: 08-01-2013-0753): 
08-01-2013-0905
Site is offline now
Removed production files
Restored the filesystem backup 
Restored the database
Site is restored




View on github

Saturday, 5 January 2013

Upgrading Linux Mint 13 (maya) to Linux Mint 14 (nadia).

Linux Mint 14

Take a backup of the current sources.list, preferably make a full backup of the system.

Edit the sources.list file,
replace the occurrences of maya with nadia and precise with quantal.

$ vi /etc/sources.list

:%s/maya/nadia/g
:%s/precise/quantal/g


Resulting file may look like.
deb http://packages.linuxmint.com/ nadia main upstream import
deb http://archive.ubuntu.com/ubuntu/ quantal main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ quantal-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ quantal-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu/ quantal partner
deb http://packages.medibuntu.org/ quantal free non-free

Update the system

$ sudo apt-get update
$ sudo apt-get dist-upgrade