Blog Stats
- 32,744 hits
…technical reconnaissance
The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog.
Here’s an excerpt:
4,329 films were submitted to the 2012 Cannes Film Festival. This blog had 17,000 views in 2012. If each view were a film, this blog would power 4 Film Festivals
Right from the time we started to code, we were always encouraged to appropriately comment it. I agree it is always a good practice to comment our code so that at least we, in future, recollect what the code is supposed to do, but I’ve often skipped this task for it being very uninteresting and tiresome. Skipping the comments is alright for small programs, but for large programs it is really difficult to keep track without commenting.
Recently I found something that has really encouraged me to document my code. Doxygen by Dimitri van Heesch is a documentation system for C / C++, Java, Objective-C, Python, IDL (Corba and Microsoft flavors), Fortran, VDHL, PHP, C# and to some extent D. By appropriately commenting my code, with Doxygen I am able to generate a neat-and-tidy documentation for both online (HTML) and offline (LaTeX, RTF, (MS-Word), PostScript, hyperlinked PDF, compressed HTML (.chm) and Unix man pages) purpose.
My code for a binary search tree (bst.c), as you will see, has special blocks for comments. When I run doxygen, following the output that I get in HTML.
The generated PDF file using LaTeX code (generated by Doxygen) is here.
This will give you enough motivation for using Doxygen. The user manual by the original author can be downloaded here.
Here’s the installation procedure for Doxygen. If you have installed TeXLive from an ISO, then please follow the instructions to inform package manager about the TeXLive installation. Use the following command in terminal for Doxygen installation.
sudo apt-get install doxygen doxygen-gui dots
Once you have installed Doxygen, you can start using special comment blocks in your code. In the doxygen user’s manual you will find two types of comments viz. Brief Description and Detailed Description. Whenever you need to have comment a function or a variable before declaring / defining it use the following syntax.
//! Brief descritpion. /*! Multi-line description or detailed description. */
If you need to comment after the declaration / definition then use the following syntax
//!< Brief descritpion. /*!< Multi-line description or detailed description. */
This is alright till you need to comment the contents of a file viz. variables, functions, etc. What if you need to comment the file itself? There is nothing like before the file or after the file. In this case you need to use \file like I’ve used in the following example.
//! \file bst.c A simple program to create a Binary Search Tree. This will also make me comfortable with using Doxygen. /** \file bst.c \mainpage Binary Search Tree Program \section intro Introduction A simple program to create a Binary Search Tree. This will also make me comfortable with using Doxygen. This is really comfortable. I can also generate a custom list as follows. I can also add formulae like the following one. \f${ \sqrt{ ( x_{2}-x_{1} )^{2} + ( y_{2}-y_{1} )^{2} } }\f$ I can also insert an image as follows. \image html image.jpg \image latex image.jpg "image-binary_tree" width=10cm And also create external links like <a href="http://www.computer.org/portal/web/csdl/doi/10.1109/AMS.2010.69">this</a>. \author Milind G. Padalkar \date 26-Oct-2010 */ #include<stdio.h> #include<stdlib.h>//! An ADT for Binary Search Tree. /*! This ADT consists of a link to the left subtree, data at the current vertex & a link to the right subtree. */ struct BST { struct BST *left; /*!< A pointer to the left subtree. */ int data; /*!< Data at the current node of the BST. */ struct BST *right; /*!< A pointer to the right subtree. */ };
Above were the initial few lines of the bst.c file. Now that you have your source code with appropriate comments, open the terminal and type the following command.
doxywizard
You will see something like this.
Fill in the fields appropriately (and use expert tab if required) using the guidelines in the user manual and save this configuration file. I’ve assigned the working directory, source directory and destination directory to the one containing my source code. Here’s my configuration file. You can open it in this wizard and see the various options that I have used. Once you are done with this, press the Run Doxygen button in the Run tab. For my configuration two folders named html and latex were generated. The contents of my folder before running doxygen are here. Do remove the .doc extension and extract (use tar -xzvf Binary-Search-Tree.tar.gz in terminal) it to view the contents.
After running Doxygen, go to html folder and open the index.html file in your web browser. This is all for html. Now for PDF, open the latex folder. Open doxygen.sty file and jump to lines 30 and 32. I replaced the text on these lines from Generated on Tue Jun 7 2011 09:32:31 for Binary Search Tree by Doxygen to Doxygen: Binary Search Tree by Milind Padalkar and saved this file. Now open the terminal (assuming that TeXLive is either installed as dependency or installed using TeXLive ISO), go to the latex folder and type the following command.
make all
You will see refman.pdf generated. Your neat and tidy documentation is ready. Thanks to Dimitri van Heesch, the creator of Doxygen.
Hi everyone!
Sometimes, you may want to use a specific version of a software. This version may not be available but an older version my be available in the package manager. So even if you install the newer version by compiling it locally, the package manager will not know about it. The real problem arises when this software / program is taken as a dependency by some other software / program. At such a time, even though the newer version is installed, the package manager does not detect it, and hence tries to download and install the older version, unnecessarily wasting space and bandwidth.
Fortunately I found a tool which creates an empty package that fulfils dependencies, making the package system believe that the dependencies are satisfied. The tool is called equivs. I will give you an example of creating such an empty package for an ISO installed TeXLive 2010. Note that the package will be empty and will only inform the package manager about the previously locally build program / software. It will not install any program / software.
Lets start with installing equivs from the terminal.
sudo apt-get install equivs
Now we create a control file for equivs where we fill the package information.
mkdir ~/Desktop/Equivs cd ~/Desktop/Equivs equivs-control tl2010
A file with name tl2010 will be created. The contents of this file are as follows.
### Commented entries have reasonable defaults. ### Uncomment to edit them. Section: misc Priority: optional # Homepage: <enter URL here; no default> Standards-Version: 3.6.2 Package: <package name; defaults to equivs-dummy> # Version: <enter version here; defaults to 1.0> # Maintainer: Your Name <yourname@example.com> # Pre-Depends: <comma-separated list of packages> # Depends: <comma-separated list of packages> # Recommends: <comma-separated list of packages> # Suggests: <comma-separated list of packages> # Provides: <comma-separated list of packages> # Replaces: <comma-separated list of packages> # Architecture: all # Copyright: <copyright file; defaults to GPL2> # Changelog: # Readme: # Extra-Files: additional files for the doc directory> # Files: <pair of space-separated paths; First is file to include, second is destination> # <more pairs, if there's more than one file to include. Notice the starting space> Description: <short description; defaults to some wise words> long description and info . second paragraph
I wanted to inform the package manager about the package texlive and the other packages that texlive provides. To achieve this, +I simply opened the terminal and typed sudo apt-get install texlive and pressed tab to find all the packages that it provides. Copied this list and placed it at the appropriate position in the tl2010 control file (at Provides:) with separating each package with a comma and space as follows.
### Commented entries have reasonable defaults. ### Uncomment to edit them. Section: misc Priority: optional Homepage: http://www.tug.org/texlive/acquire-iso.html Standards-Version: 3.6.2 Package: texlive Version: 2010 Maintainer: Milind Padalkar # Pre-Depends: <comma-separated list of packages> # Depends: <comma-separated list of packages> # Recommends: <comma-separated list of packages> # Suggests: <comma-separated list of packages> Provides: texlive, texlive-lang-danish, texlive-base, texlive-lang-dutch, texlive-bibtex-extra, texlive-lang-finnish, texlive-binaries, texlive-lang-french, texlive-common, texlive-lang-german, texlive-doc-base, texlive-lang-greek, texlive-doc-bg, texlive-lang-hebrew, texlive-doc-cs+sk, texlive-lang-hungarian, texlive-doc-de, texlive-lang-indic, texlive-doc-en, texlive-lang-italian, texlive-doc-es, ,texlive-lang-latin, texlive-doc-fi, texlive-lang-latvian, texlive-doc-fr, texlive-lang-lithuanian, texlive-doc-it, texlive-lang-mongolian, texlive-doc-ja, texlive-lang-norwegian, texlive-doc-ko, texlive-lang-other, texlive-doc-mn, texlive-lang-polish, texlive-doc-nl, texlive-lang-portuguese, texlive-doc-pl, texlive-lang-spanish, texlive-doc-pt, texlive-lang-swedish, texlive-doc-ru, texlive-lang-tibetan, texlive-doc-si, texlive-lang-ukenglish, texlive-doc-th, texlive-lang-vietnamese, texlive-doc-tr, texlive-latex3, texlive-doc-uk, texlive-latex-base, texlive-doc-vi, texlive-latex-base-doc, texlive-doc-zh, texlive-latex-extra, texlive-extra-utils, texlive-latex-extra-doc, texlive-fonts-extra, texlive-latex-recommended, texlive-fonts-extra-doc, texlive-latex-recommended-doc, texlive-fonts-recommended, texlive-luatex, texlive-fonts-recommended-doc, texlive-math-extra, texlive-font-utils, texlive-metapost, texlive-formats-extra, texlive-metapost-doc, texlive-full, texlive-music, texlive-games, texlive-omega, texlive-generic-extra, texlive-pictures, texlive-generic-recommended, texlive-pictures-doc, texlive-humanities, texlive-plain-extra, texlive-humanities-doc, texlive-pstricks, texlive-lang-african, texlive-pstricks-doc, texlive-lang-all, texlive-publishers, texlive-lang-arabic, texlive-publishers-doc, texlive-lang-armenian, texlive-science, texlive-lang-croatian, texlive-science-doc, texlive-lang-cyrillic, texlive-xetex, texlive-lang-czechslovak # Replaces: <comma-separated list of packages> # Architecture: all # Copyright: <copyright file; defaults to GPL2> # Changelog: # Readme: # Extra-Files: additional files for the doc directory> # Files: <pair of space-separated paths; First is file to include, second is destination> # <more pairs, if there's more than one file to include. Notice the starting space> Description: Dummy for ISO installed TeXLive 2010 This will inform Synaptic Package Manager that TeXLive 2010 is installed. . This will not install TeXLive 2010. It will only infrom the about the installation that you did from the ISO.
Now that we have the control file ready, we can create the .deb file with the following command in the terminal.
equivs-build tl2010
On the screen you will see something like what follows
dh_testdir dh_testroot dh_clean -k dh_clean: dh_clean -k is deprecated; use dh_prep instead dh_clean: Compatibility levels before 5 are deprecated. dh_testdir dh_testroot dh_install dh_install: Compatibility levels before 5 are deprecated. dh_installdocs dh_installdocs: Compatibility levels before 5 are deprecated. dh_installchangelogs dh_installchangelogs: Compatibility levels before 5 are deprecated. dh_compress dh_compress: Compatibility levels before 5 are deprecated. dh_fixperms dh_fixperms: Compatibility levels before 5 are deprecated. dh_installdeb dh_installdeb: Compatibility levels before 5 are deprecated. dh_gencontrol dh_gencontrol: Compatibility levels before 5 are deprecated. dh_md5sums dh_md5sums: Compatibility levels before 5 are deprecated. dh_builddeb dh_builddeb: Compatibility levels before 5 are deprecated. dpkg-deb: building package `texlive' in `../texlive_2010_all.deb'.The package has been created. Attention, the package has been created in the current directory, not in ".." as indicated by the message above!
Now you can simply go to the texlive_2010_all.deb file and double click to install it. If you find any error regarding conflicting package then simply remove the package name from the Provides: field in tl2010 file (or mark that package for complete removal and uninstall it completely from the package manager if you feel it is no longer required) and rebuild the tl2010 file using equivs to generate another .deb file. This should now install properly (i.e. inform the package manager about the installed program / software).
This shall now prevent the unnecessary download and install of older program / software. That’s all friends.
Here is my tl2010 file. You will have remove its extension (.doc, used to overcome uploading problem). You may check the syntax with this file.
To rename using the terminal
mv tl2010.doc tl2010
For all those who have installed TeXLive from the iso (or followed my post on Installing TeXLive2010) and want to use the gedit-latex-plugin, a bad news is that the plugin seems to use only the base texlive installation from the Ubuntu Repository. If I already have TeXLive installed, why do I need rubber? I spent nearly two days trying to configure the plugin for use with the iso installation of TeXLive 2010 and have now given up.
If anyone has a workaround then please respond to this post.
For the time being, I can still use the gedit-latex-plugin without the auto-compilation feature. This is how I managed to do it. Download the 0.2 version of gedit-latex-plugin here. Now rename, extract and move it to gedit’s folder in our home directory.
cd ~/Downloads mv LaTeXPlugin-0.2.tar.gz.doc LaTeXPlugin-0.2.tar.gz tar -xzvf LaTeXPlugin-0.2.tar.gz mkdir ~/.gnome/gedit/plugins mv GeditLaTeXPlugin* ~/.gnome2/gedit/plugins
Once this is done, we can open gedit and activate the plugin as follows. Open Gedit, go to Edit->Preferences->Plugins Tab and tick the LaTeX Plugin 0.2.
Now if you open a .tex file, you will get a screen as follows with the active tool-bar.
Now a few more useful plugins are to be installed using the terminal.
sudo apt-get install gedit-plugins
As we did earlier, open Gedit and browse to Edit->Preferences->Plugins Tab. Activate Embedded Terminal and Tag List Plugins. Now in Gedit, browse to View and activate the Side Pane and Bottom Pane. This gives you a wonderful lightweight editor. For compilation you can now use the
commands that I mentioned in my post on Installing TeXLive2010 in the Embedded Terminal (Bottom Pane).
You can use Ctrl+Space for auto-complete feature. If you accidentally open the preview window displaying the message “Preview not available…” use Ctrl+Shift+T to close the preview. In the Side Pane, you can see Documents, File Browser, Tags, Outline and Symbols. The above figure shows Outline in the Side Pane.
A one-shot command for compiling the sample.tex file (find it in my post on Installing TeXLive2010) in the embedded terminal is as given below.
cd /home/milind/Desktop/Sample\ TeX/
latex sample.tex
latex sample.tex
bibtex sample.aux
bibtex sample.aux
latex sample.tex
latex sample.tex
latex sample.tex
latex sample.tex
dvips sample.dvi -o sample.ps
ps2pdf sample.ps
evince sample.pdf
That’s all I could do folks…
Yesterday, I was curious about trying out Gnome3 on my Ubuntu 10.10 Desktop. I followed Aamir Aarfi’s post to install Gnome3 on my machine. The process was successful, but I noticed that every time I logged in, I had to manually start Gnome3 using the command
gnome-shell --replace
I therefore decided to add this command to Startup Applications (System->Preferences->Startup Applications) .
With this, I logged out and logged in again…guess what…the screen was blank and I couldn’t do anything about it. Also, upon a reboot I would had faced the same problem as the command was bound to run on each login. I wanted to find if I could remove this command from startup in any possible way using the command prompt. My problem was solved by slhck’s answer.
I immediately switched to the terminal by the key combination (Alt+Ctrl+F1) …(F1 to F6, anyone will do). Logged in and deleted the gnome-shell.desktop file. To delete the file type the following once you login to the terminal.
cd ~/.config/autostart/ ls rm gnome-shell.desktop
Now restarted my machine with the following command.
sudo init 6
Entered the password when prompted and everything was fine on reboot.
I’ve been using Ubuntu 11.04 Natty on my laptop for a few days now and I realized that the drag and drop operation is not working at all. Googled for the solution and got it here. Here’s what they suggested.
Open the terminal and type the following.
compiz --replace & exit
And you are done!!! Too simple, isn’t it? But they say that this operation has to be performed every time the system boots up. This is not much of a problem to tackle if you follow my post to create a boot script in Ubuntu. In that case, the contents of the file having the script will simply be the above line i.e. compiz –replace & exit .
Hi everyone!!!
You must be familiar with using Remote Desktop in Windows. Just start the service and you are done. Next time you start the machine, you can remotely control your PC. No need to first login into the remote machine before taking its remote-desktop on a network machine. Pretty simple!
When you use remote-desktop service (vncserver) in Ubuntu, you first need to physically go to the remote machine, login into the gnome-session and only then you will be able to take its remote-desktop on a network computer. Tedious, isn’t it? However, the Windows like functionality for remote desktop can be achieved in Ubuntu which I will explain in this post.
In your Ubuntu System, first install vnc4server and openssh-server. Open the terminal and type-in the following.
sudo apt-get install openssh-server vnc4server
Having done that successfully, you can now logout of this machine and move to your network machine from which you wish to take remote desktop of this machine.
Let the conventions be clear. Remote Machine : Machine whose Remote-Desktop is to be taken. Network Machine : Machine on which you want to access Remote Machine’s remote-desktop.Now, on the network machine (I assume it to be a Windows machine) download two packages, the Putty SSH and
VNC Free Edition Viewer for Windows.
Open Putty SSH and connect to the Remote Machine using SSH.
On prompting enter your username and password (do not panic, the password may be asked in a few seconds of entering the username) of the Remote Machine. With this you will be able to login into the Pseudo Terminal of the Remote Machine.
Now login with the username whose Desktop you need to access remotely. For me, the username is remoteuser.
su - remoteuser
Add this user to list of remote-desktop users as follows.
vnc4passwd
Create a password when prompted. Now start the vnc4server.
vnc4server -geometry 1024x768 -depth 24
This will start the vnc4server for this user. At the same time it will create .Xauthority file and .vnc/xstartup file in the user’s home directory. Open the .vnc/xstartup file and edit the following lines.
cd .vnc nano xstartup
Comment the line that reads x-terminal-emulator -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &
x-window-manager & with a # at the beginning of the line. Now just below this line type the following line.
gnome-session
Save the file and close with Ctrl+o and enter (to save) and Ctrl+x (to exit). Following are the contents of my modified file (xstartup) .
#!/bin/sh # Uncomment the following two lines for normal desktop: # unset SESSION_MANAGER # exec /etc/X11/xinit/xinitrc [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic & #x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & gnome-session x-window-manager &
Now come to the parent folder and kill the current session of the vnc4server.
cd .. vnc4server -kill :1
Once that is done, you are ready to use the remote-desktop by restarting the vnc4server on the Pseudo Terminal as follows.
vnc4server
You will see something similar to this on your Pseudo Terminal.
On the Network Machine now start the downloaded VNC Free Edition Viewer for Windows. In Options choose Full (all available colors). Enter the Remote Machine’s IP Address and the Remote-Terminal Number (as mentioned in the response to starting vnc4server). Ex. if you see New ‘milind-OptiPlex0-755:1 (remoteuser)’ desktop is milind-OptiPlex-755:1 then the port number to be entered is 5901. Similarly if you see New ‘milind-OptiPlex0-755:2 (remoteuser)’ desktop is milind-OptiPlex-755:2 then the port number to be entered is 5902 and so on. So following is what I entered and hit enter OK.
On prompting the password I enter the password that I created for vnc4passwd.
BINGO!!! You get your remote desktop!!!
When you are done with your work, simply close the vncviewer’s window and then kill that session in the Pseudo Terminal as follows.
vnc4server -kill :1
Exit from SSH session by typing
exit
You may notice that while in the Remote-Desktop session, every time the d key is pressed, everything minimizes. To solve this open gconf-editor through the terminal as follows.
sudo gconf-editor
This will open the Configuration Editor. Here, go to /->apps->metacity->global_keybindings. In the right pane under Value you will see <Super>d replace this with <Control><Alt>d. Close the configuration editor, and that’s all! This should now allow you to use the d key in the remote session.
Have a good time using Ubuntu Remote Desktop.
Hi all! This time I am introducing you all to a tool called Remastersys. With this tool you will be able to backup your entire systems to an installable Live CD/DVD. I am using an Ubuntu machine, but the procedure shall be more or less similar for other Linux distributions. For more information visit Remastersys Homepage.
We shall start with downloading and installing Remastersys with the instructions on this page. Alternatively, if you face any problems with the instructions on that page, we can start with the following procedure.
Download the Remastersys Repository and rename it to remastersysRepo.tar.gz
cd ~/Downloads/ wget http://milindpadalkar.files.wordpress.com/2011/05/remastersysrepo-tar-gz.doc mv remastersysrepo-tar-gz.doc remastersysRepo.tar.gz
Now extract the files.
mkdir remastersysRepo tar -xzvf remastersysRepo.tar.gz -C remastersysRepo cd remastersysRepo
We are now ready to install Remastersys. Install it using the following command.
sudo dpkg -i *.deb
Enter your password when prompted and you are done. This completes the installation of RemasterSys. On my system after installation I had some repository problems. To solve that I had to give the following command. If you face no problems then you may skip this command.
sudo apt-get install -f
Finally we are done with a successful installation without and inconsistencies.
The Remastersys Configuration file is located at /etc/remastersys.conf. The structure of this file is as follows.
#Remastersys Global Configuration File # This is the temporary working directory and won't be included on the cd/dvd WORKDIR="/home/remastersys" # Here you can add any other files or directories to be excluded from the live filesystem # Separate each entry with a space EXCLUDES="" # Here you can change the livecd/dvd username LIVEUSER="custom" # Here you can change the name of the livecd/dvd label LIVECDLABEL="Custom Live CD" # Here you can change the name of the ISO file that is created CUSTOMISO="custom$1.iso" # Here you can change the url for the usb-creator info LIVECDURL="http://www.geekconnection.org/remastersys"
Make sure that before you set the configuration, take a backup of this file.
sudo cp /etc/remastersys.conf /etc/remastersys.conf.bkp
Now in the configuration file we can set our required parameters using any editor (gedit, nano, vi etc). Following are the contents of my remastersys.conf file.
#Remastersys Global Configuration File # This is the temporary working directory and won't be included on the cd/dvd WORKDIR="/home/remastersys" # Here you can add any other files or directories to be excluded from the live filesystem # Separate each entry with a space EXCLUDES="" # Here you can change the livecd/dvd username LIVEUSER="liveuser" # Here you can change the name of the livecd/dvd label LIVECDLABEL="MGP Ubuntu 11.04 Live CD" # Here you can change the name of the ISO file that is created CUSTOMISO="mgp11-04.iso" # Here you can change the url for the usb-creator info LIVECDURL="http://www.geekconnection.org/remastersys"
We are now ready to create the ISO. You may check various options by typing the following in the terminal.
man remastersys
And press q to quit the manual. Since I want to create a an installable Live CD/DVD of the entire system without any user files, I give the following command.
sudo remastersys dist
Enter the password on prompting and wait patiently till the ISO file gets created. Following is what you may see on the screen during this process.
Distribution Mode Selected Reading package lists... Building dependency tree... Reading state information... The following packages were automatically installed and are no longer required: libdcerpc0 libhx509-5-heimdal python-dnspython libgssapi2-heimdal libsamba-util0 libsamdb0 libheimbase1-heimdal libsamba-hostconfig0 python-ldb libheimntlm0-heimdal python-talloc ldb-tools python-tdb libkdc2-heimdal libtevent0 libroken18-heimdal libhdb9-heimdal libkrb5-26-heimdal python-samba libhcrypto4-heimdal libndr-standard0 samba4-common-bin libldb1 wine1.0-gecko libwind0-heimdal libasn1-8-heimdal libndr0 libregistry0 libgensec0 Use 'apt-get autoremove' to remove them. The following packages will be REMOVED: popularity-contest ubuntu-standard 0 upgraded, 0 newly installed, 2 to remove and 4 not upgraded. After this operation, 258 kB disk space will be freed. (Reading database ... 182772 files and directories currently installed.) Removing ubuntu-standard ... Removing popularity-contest ... Processing triggers for man-db ... Reading package lists... Building dependency tree... Reading state information... The following packages were automatically installed and are no longer required: libdcerpc0 libhx509-5-heimdal python-dnspython libgssapi2-heimdal libsamba-util0 libsamdb0 libheimbase1-heimdal libsamba-hostconfig0 python-ldb libheimntlm0-heimdal python-talloc ldb-tools python-tdb libkdc2-heimdal libtevent0 libroken18-heimdal libhdb9-heimdal libkrb5-26-heimdal python-samba libhcrypto4-heimdal libndr-standard0 samba4-common-bin libldb1 wine1.0-gecko libwind0-heimdal libasn1-8-heimdal libndr0 libregistry0 libgensec0 Use 'apt-get autoremove' to remove them. The following NEW packages will be installed: ubiquity-frontend-gtk 0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded. Need to get 101 kB of archives. After this operation, 725 kB of additional disk space will be used. Get:1 http://ubuntu.c3sl.ufpr.br/ubuntu/ natty/main ubiquity-frontend-gtk i386 2.6.10 [101 kB] Fetched 101 kB in 4s (23.5 kB/s) Selecting previously deselected package ubiquity-frontend-gtk. (Reading database ... 182748 files and directories currently installed.) Unpacking ubiquity-frontend-gtk (from .../ubiquity-frontend-gtk_2.6.10_i386.deb) ... Processing triggers for bamfdaemon ... Rebuilding /usr/share/applications/bamf.index... Processing triggers for desktop-file-utils ... Processing triggers for python-gmenu ... Rebuilding /usr/share/applications/desktop.en_IN.utf8.cache... Processing triggers for python-support ... Setting up ubiquity-frontend-gtk (2.6.10) ... Processing triggers for python-central ... Reading package lists... Building dependency tree... Reading state information... Package ubiquity-frontend-kde is not installed, so not removed The following packages were automatically installed and are no longer required: libdcerpc0 libhx509-5-heimdal python-dnspython libgssapi2-heimdal libsamba-util0 libsamdb0 libheimbase1-heimdal libsamba-hostconfig0 python-ldb libheimntlm0-heimdal python-talloc ldb-tools python-tdb libkdc2-heimdal libtevent0 libroken18-heimdal libhdb9-heimdal libkrb5-26-heimdal python-samba libhcrypto4-heimdal libndr-standard0 samba4-common-bin libldb1 wine1.0-gecko libwind0-heimdal libasn1-8-heimdal libndr0 libregistry0 libgensec0 Use 'apt-get autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded. Reading package lists... Building dependency tree... Reading state information... metacity is already the newest version. The following packages were automatically installed and are no longer required: libdcerpc0 libhx509-5-heimdal python-dnspython libgssapi2-heimdal libsamba-util0 libsamdb0 libheimbase1-heimdal libsamba-hostconfig0 python-ldb libheimntlm0-heimdal python-talloc ldb-tools python-tdb libkdc2-heimdal libtevent0 libroken18-heimdal libhdb9-heimdal libkrb5-26-heimdal python-samba libhcrypto4-heimdal libndr-standard0 samba4-common-bin libldb1 wine1.0-gecko libwind0-heimdal libasn1-8-heimdal libndr0 libregistry0 libgensec0 Use 'apt-get autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded. Checking if the /home/remastersys/remastersys folder has been created Copying /var and /etc to temp area and excluding extra files Creating filesystem.manifest and filesystem.manifest-desktop Setting up casper and ubiquity options for dist mode Copying your kernel and initrd for the livecd Creating filesystem.squashfs ... this will take a while so be patient Adding stage 1 files/folders that the livecd requires. Parallel mksquashfs: Using 2 processors Creating 4.0 filesystem on /home/remastersys/remastersys/ISOTMP/casper/filesystem.squashfs, block size 1048576. [===================================================================================================-] 10565/10565 100% Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 1048576 compressed data, compressed metadata, compressed fragments, compressed xattrs duplicates are not removed Filesystem size 81057.71 Kbytes (79.16 Mbytes) 37.18% of uncompressed filesystem size (218002.97 Kbytes) Inode table size 139484 bytes (136.21 Kbytes) 33.40% of uncompressed inode table size (417576 bytes) Directory table size 127950 bytes (124.95 Kbytes) 39.90% of uncompressed directory table size (320679 bytes) No duplicate files removed Number of inodes 12204 Number of files 10557 Number of fragments 76 Number of symbolic links 860 Number of device nodes 0 Number of fifo nodes 0 Number of socket nodes 20 Number of directories 767 Number of ids (unique uids + gids) 25 Number of uids 11 root (0) daemon (1) lp (7) avahi (104) milind (1000) man (6) avahi-autoipd (103) gdm (106) libuuid (100) speech-dispatcher (107) messagebus (102) Number of gids 21 root (0) daemon (1) dip (30) lp (7) fuse (104) milind (1000) ssl-cert (113) admin (120) games (60) avahi-autoipd (108) mlocate (106) gdm (114) libuuid (101) sambashare (122) staff (50) mail (8) avahi (109) lpadmin (112) crontab (102) messagebus (105) winbindd_priv (124) Adding stage 2 files/folders that the livecd requires. Found a valid exportable SQUASHFS superblock on /home/remastersys/remastersys/ISOTMP/casper/filesystem.squashfs. Compression used gzip Inodes are compressed Data is compressed Fragments are compressed Xattrs are compressed Fragments are present in the filesystem Always_use_fragments option is specified Duplicates are not removed Xattrs are stored Filesystem size 81057.71 Kbytes (79.16 Mbytes) Block size 1048576 Number of fragments 76 Number of inodes 12204 Number of ids 25 Parallel mksquashfs: Using 2 processors Scanning existing filesystem... Read existing filesystem, 12203 inodes scanned Appending to existing 4.0 filesystem on /home/remastersys/remastersys/ISOTMP/casper/filesystem.squashfs, block size 1048576 All -b, -noI, -noD, -noF, -noX, no-duplicates, no-fragments, -always-use-fragments, -exportable and -comp options ignored If appending is not wanted, please re-run with -noappend specified! No recovery data option specified. Skipping saving recovery file. [=================================================================================================|] 117294/117294 100% Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 1048576 compressed data, compressed metadata, compressed fragments, compressed xattrs duplicates are not removed Filesystem size 1472130.56 Kbytes (1437.63 Mbytes) 44.56% of uncompressed filesystem size (3303672.65 Kbytes) Inode table size 2041751 bytes (1993.90 Kbytes) 25.42% of uncompressed inode table size (8031565 bytes) Directory table size 1983917 bytes (1937.42 Kbytes) 40.95% of uncompressed directory table size (4845312 bytes) No duplicate files removed Number of inodes 199865 Number of files 131559 Number of fragments 2209 Number of symbolic links 47194 Number of device nodes 3 Number of fifo nodes 0 Number of socket nodes 20 Number of directories 21089 Number of ids (unique uids + gids) 31 Number of uids 11 root (0) daemon (1) lp (7) avahi (104) milind (1000) man (6) avahi-autoipd (103) gdm (106) libuuid (100) speech-dispatcher (107) messagebus (102) Number of gids 28 root (0) daemon (1) dip (30) lp (7) fuse (104) milind (1000) ssl-cert (113) admin (120) games (60) avahi-autoipd (108) mlocate (106) gdm (114) libuuid (101) sambashare (122) staff (50) ssh (107) mail (8) avahi (109) lpadmin (112) crontab (102) messagebus (105) winbindd_priv (124) shadow (42) tty (5) nogroup (65534) utmp (43) utempter (118) src (40) Calculating the installed filesystem size for the installer Making disk compatible with Ubuntu Startup Disk Creator. Creating md5sum.txt for the livecd/dvd Creating mgp11-04.iso in /home/remastersys/remastersys Creating mgp11-04.iso.md5 in /home/remastersys/remastersys /home/remastersys/remastersys/mgp11-04.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 1.5G /home/remastersys/remastersys/mgp11-04.iso It is recommended to run 'sudo remastersys clean' once you have burned and tested the mgp11-04.iso
You will find the generated ISO in /home/remastersys/remastersys/ folder. You may test the ISO in your Virtual Machine (VirtualBox, VMware etc). Following is what you may see in your virtual machine.
Note : If the contents of the ISO are growing more than the capacity of a DVD then the complete process may fail.
Once you have tested the ISO file, you will have to run the following command. Make sure that you have copied the ISO to some other location or burnt it on disc. The following command cleans up the entire contents of /home/remastersys/ directory.
sudo remastersys clean
That’s all!!! You are ready to keep this backup of your Entire System and reinstall to the current state in case you face system crash.
Thanks a lot Remastersys!!!
Note : If the contents of the ISO are growing more than the capacity of a DVD then the complete process may fail.
All the people who wish to run scripts at boot time in Ubuntu, here’s the solution.
I will demonstrate a simple script that will copy the /var/log/syslog file onto my Desktop every time my machine boots. Open the terminal and do the following.
cd ~/Desktop nano cpsyslog
Here I type the following lines. The first line is to copy the syslog file to my Desktop. The second line is to change the ownership of the copied file to user milind and group milind.
cp /var/log/syslog /home/milind/Desktop/syslog chown milind.milind /home/milind/Desktop/syslog
Close the editor and exit.
ctrl+o and enter ctrl+x
With this I have successfully created a script (cpsyslog) to copy the /var/log/syslog file to my Desktop. This file needs to be placed in /etc/init.d/ folder.
sudo cp cpsyslog /etc/init.d/
The copied script needs to be made executable. This can be done as follows.
sudo chmod +x /etc/init.d/cpsyslog
Now update rc.d with default values for the script.
sudo update-rc.d cpsyslog defaults
And you are done. Your script will be executed every time your machine is booted.
What if at some point of time you feel that running the script at boot time is no longer required? You just need to remove the symlink to your script using the following command.
sudo update-rc.d -f cpsyslog remove
Optionally, you may also delete the script from /etc/init.d/ folder it you never want to activate this script in future.
sudo rm /etc/init.d/cpsyslog
And you are done!!!