Today I found on PC-World magazine a very interesting, cool, Unix-like tool to use in Windows Vista: Switcher! Download it: http://insentient.net/
Posts Tagged ‘techniques’
Google : cleartype tuner, then you will go to this website : ClearType Tuner Step 1: Turn on Windows XP ClearType . Follow the instruction to turn on the feature that would bring you a new world of displaying text on your screen.
Try this easy way dial *#7370# after that it will ask for security code dial 12345 it’s by default!
Without windows, you can use:
With X-Windows you can use:
There are several possible editor to use:
* vim: is a simple editor that can be interesting because it does not use any windowing system. The difficulty is to learn the commands because there is no menu, of course. If you learn some command it is in fact a powerful editor with syntax highlighting.
* gedit: is a simple editor from gnome but it can recognize the syntax of most languages.
* kedit: is the editor of the KDE environment. It is less interesting than gedit for software because ther is no syntax highlighting.
You can also use integrated environment:
kate: seems a nice environment
kdevelop: the environment from KDE
eclipse: initially developed for Java. Now work with C and C++. Seems well integrated and advanced.
UML diagrams can also be created and edited:
umbrello: seems to be a nice software for UML diagram edition.
Selecting is equivalent to copy. To paste use the middle button.
The usual command for connecting to a unix machine is ssh. Example:
If you need to login in with a different default name just put it before the machine name. Example:
If you need a graphical environment for your remote program, you need an X-Windows server to be up and runing. It depends on the system you are using:
Unix: an X server is up by defaut. Nothing special needed.
MacOs: an X server is available but must be manually lauched (X11).
Windows: no X server are available by default. One must download the software X-WIN32 from core web site.
Once your X windows server is up and running you can add the ”-X” option to the ssh login command so to have access to windowed software. Be careful: display are thought the network and hence are slower than on the server screen. Example:
ssh -X ipal-server2
Then you can lauche a gnome program like:
NB: the character ”&” is used to put this program on the background of your shell.
The command to use is normally:
This means “secure copy”. For copying directories uses the option ”-r”. See manual for more details. Important: one must have the right to read the source and to write the destination. Example: copy the whole SHARE directory from one machine to location /home/ipal on ipal-server2 machine, under the user name “chevalet”.
scp -r SHARE chevalet@ipal-server2:/home/ipal
WARNING: progress meter is display for each file and can slowdown the transfer of a lot of small files.
Backing up a server is mandatory for a safety usage. Nowadays as disks are not expensive, using external disk is a simple backup solution. This external disk should have the exact size of the disk to be backup.
In a Unix system on need two command:
an incremental copy command to save the changed files.
an daemon that execute the backup automatically.
The command to use for the incremental copy is “rsync”. The deamon that execute any script is called “cron”.
This is a simple example of script that do a backup. This script should be put in an accessible location like ”/root/bin”.
# This is the path where the backup disk should be mounted
# email adress to send in case of error
# Check if the disk is mounted
mounted=`df -a|grep $dest`
if [ "$mounted" ]
# Do the backup
/usr/bin/rsync -a --delete /home/ipal/ $dest/ipal/
# Disk not mounted: send an email
/bin/mail -s "Cannot do backup" $email <<-EOF Message from $0
The disk $dest is not mounted in $HOSTNAME.
Backup not done at $now.
Then to activate this script, use the command:
Then one can add the automatic launch of the script every day at 1AM using the line below, providing the script is named “backup.sh” and is located at ”/root/bin”.
00 01 * * * /root/bin/backup.sh>>/var/log/backup.log
The output is automatically added to the log file backup.log.
The hostname is managed by the network administrator. It enable to automatically associate the name of the machine to an IP address and alleviates the necessity to remember the IP number. On the machine the hostname has to be changed manually by modifiying the file /etc/hosts.
See also : http://www.cpqlinux.com/hostname.html
When run SSH, the terminal they give us may sick us due to the ugly interface. To have a proper one, as if run directly on the Unix server, is gnome-terminal.
Run a console and call the following commands :
A GUI-explorer : nautilus
Text editor with syntax highlight: kate
File manager – a very powerful & useful tool to work with your files: krusader
A great IDE application: eclipse
If you want to continue on your current terminal-console, you should run the application in background by adding the & at the end of the program name. E.g.:
The followings format the prompt of the terminal to the form of username@workingFolder and also colorize it.
export PS1="\[$usernameColor\]\u\[$default$pathColor\] \w $ \[$defaultColor\]"
Colorful ls command
alias ls='ls --color'
Note: The above scripts should be put in the .bashrc file in your home folder, e.g. /home/vgnam/.bashrc
google:bash perl replace -> One-line shell script for find and replace
Using perl-like command:
perl -pi -e 's/find/replace/g' *.txt
Used with multiple files:
find . -name '*.txt' |xargs perl -pi -e 's/find/replace/g'
Another way using sed Use the sed command with inline option and regular-expression as :
sed -i -e 's/source/destination/g' *.html
Simply press Ctrl-Shift-X
Firts, extract and copy fonts to:
Login as root user. Then, continue to use the command:
# your program that need to measure time runs here
elapsed=`echo $time2-$time1 | bc`
echo "Elapsed time: $elapsed seconds."
find . -type f -name "yourPatter" -delete
How to get numbers of lines of a huge file? Call the wc command with -l option :
I need to know the memory size, RAM size, of the server which is a Linux OS. I look on the web and found this quite not easy since the input keyword must be precise.
There u can see the line that says: MemFree : ### kB (or mB) is where the free memory is showed. For a brief information output let’s used :
cat /proc/meminfo | grep MemFree
This will show only the MemFree line! What a command!
#The followings set the prompt to show username workingFolder with color
export PS1=”\[$usernameColor\]\u\[$default$pathColor\] \w $ \[$default\]”
#variables used for CLEF experiments
#colorful ls command
alias ls=’ls –color’
Use Lemur by Java + Eclipse
Start coding that uses Lemur’s libraries
In eclipse, new a project.
Then go to that project “Build path” (by right click on the project name, choose “Build path…” (or Menu:Project-Properties-Java build path) )
At “Libraries” tab, add the lemur.jar file.
Run written code that uses Lemur’s libraries
At “Order & export” tab, make sure to check the box lemur.jar
Then run it. It should work!
Re-run index note!
If index data destination is already exists, no thing create or the current data is keep, and new data is appended into it!
You should clean up that folder so as new results could be created!