How To Migrate Linux Between Machines

There is an excellent article here:…en-machines

  • Create package list: dpkg --get-selections > ~/packagelist.txt
  • Mark packages for reinstallation on new system dpkg --set-selections < ~/packagelist.txt
    • This will mark all packages, but it won’t install them until you run:
  • apt-get -u dselect-upgrade

Bash Tips

vi ~/.bashrc #and find the first two occurrences of PS1 (color or not)
PS1='\A ${debian_chroot: #find line begining with PS1= and prepend \A as in this example
  • In RHEL

Gtk-WARNING **: Error loading icon: Couldn't recognize the image file format

Many GTK based apps failed with errors like:

Gtk-WARNING **: Error loading icon: Couldn't recognize the image file format for file '/usr/share/icons/oxygen/16x16/actions/application-exit.png'

until I ran this line to regenerate the cache:

gdk-pixbuf-query-loaders > /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache

Recover deleted files with Scalpel

This great tool enabled me to recover several hours of work.
I found it from this page:
All you have to know is the first few bytes of the file and it searches the entire hard drive free space for blocks that begin with those bytes.

The find command

Syntax for find

find . -name "*.php" -exec echo {} \;

Using Screen

Quoting options in bash paramenters

I have spend hours searching for the answer to this problem, so now I have found it I will post it.

Demonstrate problem

Suppose I have a program that takes an option in the form:

myprog -t "Title of Document"

To test this we will create a script:

echo option: «$1», title: «$2», ignore: «$3»

Webdav server setup under CentOS 6

I am about to set up a webdav server under CentOS 6.0
Here are some web sources:

Installing Microsoft Access on Crossover Office

Office 97

  1. Install package from CD
  2. From a previous Windows install, copy system.mdw into .cxoffice/Microsoft Office 97/drive_c/windows/system32
    3. Download SR1, SR2b and the jet upgrade to SR2
  3. Open the C/O bottle, find the run command and run each service pack in turn

Note that this crashed when I tried to open an Access form

Office XP

  • Installing into a Win98 bottle
  1. Install package from CD
  2. Download InstMsiA.exe - the Windows Installer 2.0 Redistributable for Windows 95, 98
  3. Download SP3 for office XP
  4. Open the C/O bottle, find the run command and run both in turn
  5. To install an ODBC connector, don’t use the run command, but use Applications/Install Software within CXO. Alternatively you can run the following:
/opt/cxoffice/bin/wine --bottle "Microsoft Office XP" --verbose --wl-app msiexec /i name-of-connector.msi
  • It seems to work so far

Office XP install into XP bottle

  1. Install Office XP SP3 from CD
  2. Install MDAC (latest version)
  3. Download and install MySQL connector

Benchmark for Linux

Here are a few CPU oriented benchmarks for Linux.

I am not sure if they are available in packages for CentOS, so I have only given the Ubuntu packages:

(Please note that you will have to enable the community repositories for these)

Syndicate content