Skip to content

Recover deleted files in Linux photorec – Recover lost files from harddisk, digital camera and cdrom

16-Nov-09

/usr/sbin/testdisk testdisk – Scan and repair disk partitions
/usr/sbin/photorec photorec – Recover lost files from harddisk, digital camera and cdrom

NAME
photorec – Recover lost files from harddisk, digital camera and cdrom

SYNOPSIS
photorec [/log] [/debug] [/d recup_dir] [device|image.dd|image.e01]

photorec /version

DESCRIPTION

PhotoRec is file data recovery software designed to recover lost files including video, documents and archives from Hard Disks and CDRom and lost pictures (Photo Recovery) from digital camera memory. PhotoRec is safe to use, it will never attempt to write to the drive or memory support you are about to recover lost data from.

OPTIONS

/log create a photorec.log file

/debug add debug information

More in details at http://serversignature.com/serversignature/docs/html/testdisk.html

How to test your java installation.

15-Nov-09

Please visit the following link to test your java installation.

http://www.java.com/en/download/help/testvm.xml

How do I download and install Java for my Linux computer?

15-Nov-09

To get Sun Java under Ubuntu on Intel, you should enable the Universe repository in Add/Remove programs, and install either the openjdk-6-jre package or the sun-java6-bin package.

root@laptop:~# apt-cache search jre
default-jre - Standard Java or Java compatible Runtime
default-jre-headless - Standard Java or Java compatible Runtime (headless)
docbook-xsl - stylesheets for processing DocBook XML files to various output formats
docbook-jrefentry - DocBook XML JRefEntry DTD
kaffe - A JVM to run Java bytecode
libjrexx-java - automaton based regular expression API for java
icedtea-6-jre-cacao - Alternatve JVM for OpenJDK, using Cacao
openjdk-6-jre - OpenJDK Java runtime, using Hotspot JIT
openjdk-6-jre-headless - OpenJDK Java runtime, using Hotspot JIT (headless)
openjdk-6-jre-lib - OpenJDK Java runtime (architecture independent libraries)
openoffice.org - full-featured office productivity suite
openjdk-6-jre-zero - Alternatve JVM for OpenJDK, using Zero/Shark
sun-java5-bin - Sun Java(TM) Runtime Environment (JRE) 5.0 (architecture dependent files)
sun-java5-fonts - Lucida TrueType fonts (from the Sun JRE)
sun-java5-jre - Sun Java(TM) Runtime Environment (JRE) 5.0 (architecture independent files)
sun-java5-plugin - The Java(TM) Plug-in, Java SE 5.0
sun-java6-bin - Sun Java(TM) Runtime Environment (JRE) 6 (architecture dependent files)
sun-java6-fonts - Lucida TrueType fonts (from the Sun JRE)
sun-java6-jre - Sun Java(TM) Runtime Environment (JRE) 6 (architecture independent files)
sun-java6-plugin - The Java(TM) Plug-in, Java SE 6

You probably have multiple java versions installed. You need to change the default java version to use. This typically involves changing the /usr/bin/java symlink.

On Ubuntu you can write:

sudo apt-get install sun-java6-jre

Once you have installed Java, make sure it is available from the command line. You can verify this by opening a new terminal window and typing:

java -version

Reference : http://www.java.com/en/download/help/5000010500.xml

OpenDNS is a free DNS resolution service

14-Nov-09

OpenDNS is a free DNS resolution service

OpenDNS nameserver IP addresses are:

208.67.220.220
208.67.222.222

Some routers and devices need a third or fourth nameserver IP address. Use these if necessary (identical service to the original two):

208.67.220.222
208.67.222.220

OpenDNS offers DNS resolution for consumers and businesses as an alternative to using their Internet service provider’s DNS servers. By placing company servers in strategic locations and employing a large cache of the domain names, OpenDNS usually processes queries much more quickly, thereby increasing page retrieval speed. DNS query results are sometimes cached by the local operating system and/or applications, so this speed increase may not be noticeable with every request, but only with requests that are not stored in a local cache.

Is OpenDNS running a proxy?

Yes. Some software, including your (and our) beloved Google Toolbar, intercepts requests made via the address bar so that DNS requests never occur. This creates some usability issues, including making shortcuts (which require DNS requests to be made from the address bar) unreliable. We’ve designed a simple proxy that ensures the best of Google and OpenDNS work without causing problems.

Add the above name servers to /etc/resolv.conf and then visit – http://welcome.opendns.com to check the status.

rsync all your home and mysql db to new server.

14-Nov-09

Some time you may want to backup your home directory and mysql databases to a new server, we can do that using rsync script. The below script when run from your new server will, rsync all your home dir to your new server.

#!/bin/bash
#by-admin@serversignature.com
#Old Server IP
IP=192.168.0.1
#Scrit is run from the new server to move the home and mysql data.
rsync -vrplogDtH --exclude=virtfs/ --progress -e ssh root@$IP:/home/ /home/
rsync -vrplogDtH --progress -e ssh root@$IP:/var/lib/mysql/ /var/lib/mysql/
#To backup individual mysql database.
cd /var/lib/mysql
rsync -vrplogDtH --progress -e ssh root@$IP:/var/lib/mysql/user_database .

Adding the Google Linux Software Repositories to Ubuntu

13-Nov-09

Adding the Google Linux Software Repositories to Ubuntu

Get key

wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -

apt-get update

Add the following rule to e.g. /etc/apt/sources.list, or if your distro has the /etc/apt/sources.list.d/ directory, add it to a file called google.list in that directory:

deb http://dl.google.com/linux/deb/ stable non-free main

then use apt

sudo apt-get update
sudo apt-get install picasa

ubuntu@ubuntu-desktop:~$ apt-key
Usage: apt-key [command] [arguments]

Manage apt’s list of trusted keys


apt-key add - add the key contained in ('-' for stdin)
apt-key del - remove the key
apt-key export - output the key
apt-key exportall - output all trusted keys
apt-key update - update keys using the keyring package
apt-key net-update - update keys using the network
apt-key list - list keys
apt-key finger - list fingerprints
apt-key adv - pass advanced options to gpg (download key)

In Detail

ubuntu@ubuntu-desktop:~$ wget https://dl-ssl.google.com/linux/linux_signing_key.pub
--2009-11-14 07:57:04-- https://dl-ssl.google.com/linux/linux_signing_key.pub
Connecting to 16.158.235.10:8080... connected.
Proxy request sent, awaiting response... 200 OK
Length: 1745 (1.7K) [text/plain]
Saving to: `linux_signing_key.pub'
100%[=========================>] 1,745 846B/s in 2.1s
2009-11-14 07:57:08 (846 B/s) - `linux_signing_key.pub' saved [1745/1745]

ubuntu@ubuntu-desktop:~$ sudo apt-key add linux_signing_key.pub
[sudo] password for ubuntu:
OK

Search

ubuntu@ubuntu-desktop:~$ apt-cache search google-chrome
google-chrome-unstable - The web browser from Google

Install


ubuntu@ubuntu-desktop:~$ sudo apt-get install google-chrome-unstable
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
google-chrome-unstable
0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
Need to get 12.8MB of archives.
After this operation, 50.4MB of additional disk space will be used.
Get:1 http://dl.google.com stable/main google-chrome-unstable 4.0.245.1-r31796 [12.8MB]

Download the Ubuntu One software

12-Nov-09

Install and configure your computers

9.04 (Jaunty) subscribers

Please follow the instructions at https://one.ubuntu.com/support/installation/ to download the Ubuntu One software, install it, and configure each of your computers.

9.10 (Karmic) or later subscribers

The Ubuntu One software is pre-installed in 9.10 (Karmic) or later versions of Ubuntu so no download is needed. All that is left is to configure your computers to talk to Ubuntu One for synchronization.

1. Go to Applications >> Internet and click Ubuntu One.
2. If you are not already logged into Launchpad, you will be asked to do so.
3. Click "Add your computer" in your web browser.

Your computer will now synchronize files.


How to change mysql time zone

07-Nov-09

How to change mysql time zone

Edit /etc/my.cnf and change your time zone.

root@box1 [/var/lib/mysql]# cat /etc/my.cnf
[mysqld_safe]
timezone = Europe/London
~
[mysqld]
set-variable = max_connections=500
safe-show-database

Login to mysql and check the time now.

root@box1 [/var/lib/mysql]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 369
Server version: 5.0.81-community MySQL Community Edition (GPL)
~
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
~
mysql> select now();
+---------------------+
| now() |
+---------------------+
| 2009-11-07 17:28:51 |
+---------------------+
1 row in set (0.00 sec)
~
mysql> quit
Bye

root@box1 [/var/lib/mysql]# date
Sat Nov 7 17:29:06 GMT 2009

How can I tunnel a local MySQL server through SSH?

06-Nov-09

Setting up the Tunnel

The most common methods of setting up a tunnel are through putty or through command-line SSH.

To open an SSH tunnel via the command line, run:

ssh -L3307:127.0.0.1:3306 -p 22 -N -t -x user@myhost.com

Connecting with MySQL

You can connect to the MySQL server!
You want to choose 3307 for your local port so that it does not conflict with your existing local copy of MySQL.

mysql -u username -ppassword -h 127.0.0.1 -P 3307

How to configure to use RPMforge ?

06-Nov-09

How to configure to use RPMforge ?

Reference: http://dag.wieers.com/rpm/FAQ.php#B2

It’s very easy. Just install the latest rpmforge-release package for your distribution and architecture.

This will automatically install the configuration and GPG keys that are for safely installing RPMforge packages.

The configuration of Yum is inside the rpmforge-release package.

You need to install it yourself.

If you’ve done that, the rest is simple. Upgrade your system by doing:

yum update
You can add new software by typing:
yum install
Or update installed software:
yum update
Or search for software in the local repository meta-data:
yum search
Or simply list all available software:
yum list available
From time to time you may want to save some diskspace:
yum clean