Create Custom Ubuntu Live-CD With Remastersys in Karmic

Remastersys is a tool that can be used to do 2 things with an existing Klikit or Ubuntu or derivative installation.It can make a full system backup including personal data to a live cd or dvd that you can use anywhere and install. It can make a distributable copy you can share with friends. This will not have any of your personal user data in it.

Install Remastersys in Ubuntu 9.10 (Karmic)

The Remastersys repository needs to be added to your /etc/apt/sources.list

gksudo gedit /etc/apt/sources.list

Paste the following into the sources.list:

# Remastersys
deb http://www.geekconnection.org/remastersys/repository karmic/

Save and exit the file.

Update the source list using the following command

sudo apt-get update

Install remastersys using the following command

sudo apt-get install remastersys

This will complete the installation

Using Remastersys

In order to learn how you can use remastersys, run

sudo remastersys

remastersys Syntax

sudo remastersys backup|clean|dist [cdfs|iso] [filename.iso]

remastersys Examples

1) to make a livecd/dvd backup of your system

sudo remastersys backup

2) to make a livecd/dvd backup and call the iso custom.iso

sudo remastersys backup custom.iso

3) to clean up temporary files of remastersys

sudo remastersys clean

4) to make a distributable livecd/dvd of your system

sudo remastersys dist

5) to make a distributable livecd/dvd filesystem only

sudo remastersys dist cdfs

6) to make a distributable iso named custom.iso but only if the cdfs is already present

sudo remastersys dist iso custom.iso

cdfs and iso options should only be used if you wish to modify something on the cd before the iso is created. An example of this would be to modify the isolinux portion of the livecd/dvd

Creating An ISO Image

To create an iso image of your installation, simply run

sudo remastersys dist

This will create an iso image called customdist.iso in the /home/remastersys directory. The dist option makes that your personal folder (e.g. /home/ruchi) will not be included in the iso image. You might have to insert your Ubuntu installation CD during the process.

/home/remastersys/customdist.iso is ready to be burned or tested in a virtual machine.

Check the size and if it is larger than 700MB you will need to burn it to a dvd

796M /home/remastersys/customdist.iso

Clean Up

After you’ve burnt the iso image onto a CD/DVD, you can run

sudo remastersys clean

to remove all temporary file created during the iso generation as well as the /home/remastersys directory.

Flex Builder Linux got an alpha 5

So just released on the Adobe Labs website is a new build of Flex Builder 3 for Linux. When I say new build I mean that all the same problems that applied to alpha 4 are there, with the exception of the product’s expiry date, which now gives us over another year to bask in the glory of this dying product.

So, if you’re keen on trying it out then go ahead, you will probably still be best to follow the step I outlined in a previous post as well as use a patch created by James.

On the other hand you could try out feiy’s port of Flash Builder 4 Beta 2 to Linux, which I have had some good success with.

Another product people seem fairly pleased with is FDT and according to their site version 3.5 will include better MXML support. As a free plug for them, they support the Red5 project which is now at v0.9.0 RC2 and is a great, free, replacement for Flash Media Server.

All in all you should hope, pray, petition and/or sign FB-19053 (choose whatever suits, but Adobe probably only reads the bug reports…) so that they can give us a working version of Flex/Flash Builder for Linux.

Eclipse 3.5 (Galileo) and Flex Builder for Linux

Introduction

I downloaded Eclipse 3.5 RC2, codename Galileo, yesterday to try it out because I was having some problems with the updater in Ganymede not wanting to update subversive because it required datatools 1.6.0 and I had 1.6.2. I solved that problem by uninstalling datatools and subversive completely then tried to reinstall the latest subversive and success, it worked!

But I also thought, hey I know Flex Builder for Linux doesn’t work in 3.4 or in 64 bit Eclipse but I will try solve the problem and get 3.5 and FBL working. So, here is my solution to get Flex builder for Linux installed in a 32 bit version of Galileo. I did all of this in Ubuntu 9.04 x86_64 so I do not know if you will come across any major problems in any other Linux distribution.

First things first – Preparation

We need all the part for this install and it’s much nicer to have them all on hand when you need them so here’s what’s required.

  1. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here.
  2. Download Flex Builder for Linux from here.
  3. Download the latest Flex SDK from here. (I currently use the free Flex SDK 3.3)
  4. Download the latest AIR SDK from here.
  5. Download the required patch components from here.
  6. For 64 bit: Install ia32-sun-java6-bin and all its dependencies.
  7. For 64 bit: Download my simple eclipse loader script from here.

Stage 2 – Installation

Let’s get this thing installed.

  1. For 64 bit: In a terminal window run “sudo update-alternatives –config java” and select ia32-java-6-sun as your jre of choice.
  2. Unpack your Eclipse download and place it where you want it to be, I like /usr/local/bin/eclipse-galileo, by running “tar zxf eclipse-SDK-3.5RC2-linux-gtk.tar.gz” to unpack it.
  3. Chmod Flex Builder for Linux install so it can be executed by running “chmod a+x flexbuilder_linux_install_a4_081408.bin“.
  4. Install Flex Builder for Linux making sure to point it at the right location for Galileo. “./flexbuilder_linux_install_a4_081408.bin“. NB. Do not install over a previous Eclipse installation or Flex Builder installation.
  5. Unpack the patch “tar zxf eclipse-galileo-fbl-patch.tar.gz“.
  6. Go in to ~/Adobe_Flex_Builder_Linux/eclipse/plugins and delete the directory “com.adobe.flexbuilder.debug.e33_3.0.204732″ and “com.adobe.flexbuilder.editors.derived_3.0.204732.jar”.
  7. Copy the eclipse directory in the patch folder to where you installed Flex Builder.
  8. For 64 bit: Move the eclipse.sh script into your eclipse install folder and run “chmod a+x eclipse.sh“.
  9. For 64 bit: Set java back to the regular 64 bit variety using the same method as step 1 (but obviously selecting just java-6-sun).
  10. For 64 bit: Please check out this link to get information on how to install 32 bit FireFox in a chroot environment for debugging. You then have to set up the link to /usr/lcoal/bin/firefox32 in your eclipse preferences as your web browser.

You should now be able to start eclipse and enjoy the Flex goodness (you may have to run “eclipse -clean” if you jumped the gun and have run it before following these steps). But please note, as with any eclipse upgrade, that you should use a new workspace folder and import your projects into it.

Stage 3 – Updating the Flex SDK

I did not try build a project with the included 3.0.0 SDK with flex builder because I want the latest. Latest stable anyway. So here is how you can update the SDK.

  1. Move the Flex SDK into a directory, like “3.3.0″, and unpack it “unzip flex_sdk_3.3.0.4852.zip“.
  2. Move the AIR SDK into a temporary directory, like “airsdk”, and unpack it also “tar xjf AdobeAIRSDK.tbz2
  3. Go in to the AIR SDK folder then into the bin directory and rename “adl” and “adt” to “adl_lin” and “adt_lin”.
  4. Copy all the contents of the AIR SDK on top of the Flex SDK, overwriting and existing files
  5. Move the Flex SDK folder into ~/Adobe_Flex_Builder_Linux/sdks/
  6. Start Eclipse, then go Window -> Preferences -> Flex -> Installed Flex SDKs and either add 3.3.0 to this list or replace 3.0.0 with 3.3.0 and make it your default.

You should now be able to build Flex/AIR projects.

Final Word

Thanks for sticking with me thus far and hopefully you should have Eclipse Galileo all set up now and running Flex Builder for Linux. I did not come up with all of these solutions on my own, but I did cobble together and add my own flair to what worked for me from these sources:

How to restore the default gnome-desktop-panels in Ubuntu

Many Ubuntu users would customize their gnome desktop by changing the default panels with dock or AWN.This tutorial shows how to restore this default panels.

First,open terminal from Applications->Accessories->Terminal.
Type this command and all panels will disappear.

gconftool –recursive-unset /apps/panel

then,type this to delete current one:

rm -rf ~/.gconf/apps/panel

Finally,reload panel:

pkill gnome-panel

How to setup Boot password protection for Grub2 Entries

Since Ubuntu 9.10 uses Grub2 as default boot loader,we cannot use the previous way to set password protection for grub entries.Grub 2 currently supports unencrypted password protection. Encrypted password protection using PBKDF2, as well as password scripting, is currently under development.
This post comes from Ubuntuforums and shows how to set up basic password protection. No user will be able to access the system unless the designated username and password specified in /etc/grub.d/00_header are entered.

Notes:

* Grub 2 has the ability to set password protection on individual menuentries and/or for specific users. Although multilevel access by more than one user is possible, it has not yet been automated and is beyond the scope of this guide. I will try to create a specific Password HOWTO as time permits.
* The username and password will also be required to gain access to the Grub 2 command line and menu editing modes.
* The username and/or password do not have to be the same as the Ubuntu logon name/password.
* This is basic password security. The name/password are unencrypted; anyone having physical access to the machine and more than an elementary knowledge of how Linux works will be able to access the configuration files and bypass this feature.
* Grub 2 password protection is still evolving. Currently (Grub 1.97beta4) password protection must be assigned to each menuentry as described below. There is a chance the password feature will be revised so that all entries are protected by default. If and when this feature is incorporated in Grub 2, password protection can be eliminated for a specific menuentry by adding “(–unlock)” on the menuentry line. More information will be posted here as it becomes available.

Warning: Errors in creating a password-protected Grub 2 menu may result in an unbootable system. To restore a system with broken passwords, access and edit the Grub 2 configuration files using the LiveCD or another OS.

Now,let’s start following steps to create password protection.You’d better make a backup before changing a file.
Step1:
Add the following the bottom of /etc/grub.d/00_header

cat << EOF
set superusers=”myname”
password myname 1234
EOF

here “myname” and “1234″ after “password” are the username and password you need to type to access grub entries.Change them to what you want.
Step2:
Change the following in /etc/grub.d/10_linux to password protect Linux installations on the main partition:
from:

menuentry “$1” {

to:

menuentry “$1” –users myname {

Note:This is what I change in my 64-bit machine:

printf “menuentry \”${title}\” –class linux –users myname {\n” “${os}” “${version}”

Step3:
Change the following in /etc/grub.d/20_memtest to password protect the memtest86+ option:
from:

menuentry “Memory test (memtest86+)” {

to:

menuentry “Memory test (memtest86+)” –users myname {

Additional memtest86+ entries (from other partitions) may also be located in this file. The line will start with “menuentry”. Change these lines as desired.
Step4:
Change the following in /etc/grub.d/30_osprober to password protect kernels/operating systems on other partitions.Look for any line in /etc/grub.d/30_osprober which begins with “menuentry”.

menuentry “${LONGNAME} (on ${DEVICE})” {

menuentry “${LLABEL} (on ${DEVICE})” {

Make the change as described in previous step.
Step5:
Finally,requiring a password for every menuentry in a file can be added using the following command:

sudo sed -i -e ‘/^menuentry /s/ {/ –users myname {/’ /etc/grub.d/10_linux  /etc/grub.d/20_memtest86+ /etc/grub.d/30_os-prober /etc/grub.d/40_custom

To undo this command:

sudo sed -i -e ‘/^menuentry /s/ –users myname {/ {/’ /etc/grub.d/10_linux  /etc/grub.d/20_memtest86+ /etc/grub.d/30_os-prober /etc/grub.d/40_custom

Save the files, run sudo update-grub, and reboot. At the Grub 2 menu, you will be presented with the normal menu. When you make a selection, a prompt will ask for the username and password.

Install MacOS theme Mac4Lin in Ubuntu 9.10(Karmic)

Mac4Lin brings the Mac OS X user interface to POSIX Operating Systems (GNU/LInux, FreeBSD, openSolaris etc.). The project is built for desktop environments based on GTK.
This tutorial shows how to install this Mac theme in ubuntu karmic and do some easy configurations.
Download and install Mac4Lin
First,let’s download the source package from:http://sourceforge.net/projects/mac4lin/files/

I download the version1.0,and my firefox store the download files in ~/Downloads.

So open up the command line console from Applications->Accessories->Terminal,type following to navigate to the folder:

cd ~/Downloads

and then uncompress and install it:

unzip Mac4Lin_Install_v1.0.zip
cd Mac4Lin_Install_v1.0/
./Mac4Lin_Install_v1.0.sh

it will ask you some questions for yes/not to install something,read the question and make your choice.
Note:There if you type yes for this question:”Do you want to enable Metacity Compositor? If you are unsure about this or use Compiz, type ‘n’ [y/n]?”.You will unable to enable compiz 3D effects again if you close them.You need to run this command:

gconf-editor

navigate to /apps/metacity/general,uncheck “compositing_manager” in right box.Log out and back in,then you can enable compiz 3D effects again.

Configure Ubuntu desktop

1.There are two Mac OS X wallpapers in “Mac4Lin_Install_v1.0/Wallpapers” folder.Right click on desktop and select “Change Desktop Background”,in Background tab click Add… and navigate to choose this two wallpapers.
2.If you are operating on 64-bit ubuntu,you need to manually install the AWN theme.In following AWN Manager window,click add and select Downloads/Mac4Lin_Install_v1.0/AWN/Mac4Lin_AWN_v1.0.tgz.
Mac_theme

3.Delete gnome default panels.I have installed AWN and make it auto-run at login,default gnome panels are useless.Run this command:

gconf-editor

navigate to

/desktop/gnome/session, double click “required_component_list” in right box and delete “panel”.
Mac_theme2

4.Min/Max/Close buttons are default in left of windows’ title bar.If you would like to move them to right,run this command again:

gconf-editor

navigate to app->Metacity->general,double click “button_layout”in right box and change its value to “menu:minimize,maximize,close” (without quotes).
Desktop:
Mac_theme1

Put Home, Computer, Network and Trash Icons on Ubuntu Desktop

f you used to be a Windows user,you should prefer the Computer,Home,Network and Trash icons on your ubuntu gnome desktop.
Press Alt+F2 key combination,and this window pop up,type gconf-editor to start configuration editor.

Navigate to apps/nautilus/desktop in next window,check the marked four checkboxes and change their icon-name as you want.

Done.

Sharevar el = document.getElementById(’share-link-845113745′);el.params = {title: ‘Put Home,Computer,Network,Trash […]

How to reset forgotten user/boot password in Ubuntu

If you forgot your ubuntu user password,or you have enabled root user and forgot the password,you can try following to reset the forgotten password.

First,start your machine and when it boots into grub menu,select “Ubuntu GNU Linux …. (recovery mode)” (just use up/down arrow key to highlight it,not press enter).

Press E to get into edit screen,there  find ro single and change it into rw single init=/bin/bash,then press Ctrl+x or b to boot into a command line.

type following command:

mount -a
 
passwd your-user-name

it will prompts to input new password.If you want to reset the root password,change the second command to passwd root.
Now,restart and login with the new password.

How-To: Redirecting network traffic to a new IP using IPtables

While doing a server migration, it happens that some traffic still go to the old machine because the DNS servers are not yet synced or simply because some people are using the IP address instead of the domain name….

By using iptables and its masquerade feature, it is possible to forward all traffic to the old server to the new IP.

This tutorial will show which command lines are required to make this possible.

In this article, it is assumed that you do not have iptables running, or at least no nat table rules for chain PREROUTING and POSTROUTING.

The first thing to do is do enable IP forwarding. This is done either by using:

# echo “1” > /proc/sys/net/ipv4/ip_forward

or

# sysctl net.ipv4.ip_forward=1

Then, we will add a rule telling to forward the traffic on port 1111 to ip 2.2.2.2 on port 1111:

# iptables -t nat -A PREROUTING -p tcp –dport 1111 -j DNAT –to-destination 2.2.2.2:1111

and finally, we ask IPtables to masquerade:

iptables -t nat -A POSTROUTING -j MASQUERADE

Optionally, you could only redirect the traffic from a specific source/network with, for a host only:

# iptables -t nat -A PREROUTING -s 192.168.1.1 -p tcp –dport 1111 -j DNAT –to-destination 2.2.2.2:1111

or for a whole network

# iptables -t nat -A PREROUTING -s 192.168.1.0/24 -p tcp –dport 1111 -j DNAT –to-destination 2.2.2.2:1111

that’s it, now the traffic to port 1111 will be redirected to IP 2.2.2.2 .
If you go on host 2.2.2.2, you should see a lot of traffic coming from the host doing the redirection.

How-To: Changing the default text editor

There is a few software that will use the editor command to find out what text editor to use. Example commands will be dch to add a new .deb changelog entry, revision control softwares when prompting for a commit message …

There is basically 2 ways for changing the default editor:

  • System wide
  • At user level

1. System Wide

Run:

$ sudo update-alternatives –config editor

And then choose whichever editor you want to be default.

2. User Level

As a user, you cannot change the setting for the whole system, but you can add an alias for editor to let say vim.

Open and edit ~/.bashrc and add:

alias editor=vim

Next time you will open a bash prompt, your default editor will be vim.