Linux tips
How to play a DVD video ISO image
Submitted by ggarron on Mon, 06/09/2008 - 03:47.I have this new video camera Sony that records on mini DVDs, and I got a video from my daughter dancing for the mother's day, I copied it as an image to the hard disk of my Linux Operating System machine
cat /dev/dvd/ > $HOME/video.iso
But now how to play that iso image from my disk with out using my DVD player?
These are the simple commands needed.
sudo mkdir /media/iso
To create a mount point
sudo mount -t iso9660 -o loop /home/ggarron/dvd_video.iso /media/iso
How to find files, using command line (locate)
Submitted by ggarron on Wed, 05/21/2008 - 20:27.Continuing reviewing some of my old posts, I found this one Examples of find command, now I want to show you a faster and easier way to find files.
We are going to use the commands updatedb and locate
updatedb
Which runlevel are you in?
Submitted by ggarron on Wed, 05/21/2008 - 20:06.I wrote a little runlevel explanation, now I will show you how to know in which runlevel your Linux Operating System is actually running.
Which runlevel are you in?
Enter the following command:
sudo runlevel
My output is:
N 2
Switch to other runlevel
To do that enter:
telinit [number of runlevel]
Showing line numbers on vim
Submitted by ggarron on Tue, 05/20/2008 - 13:45.Sometimes you really need to see the number of the line where you are while editing a text file, if you like vi / vim, this will help you how to turn on and off the numbering of lines.
How to find which service is listening on a given port
Submitted by ggarron on Mon, 05/19/2008 - 14:39.It is really important to know which ports are open in your PC, this is not only useful for Linux, but also for other operating systems, Linux has a lot of tools to check which ports are open, the most common is nmap which is a command line tool, but also exist a Graphical frontEnd for it if you prefer that way.
So to scan you own PC and find open ports you can enter:
sudo nmap -T Aggressive -A -v 127.0.0.1 -p 1-65000
Another way to populate your apt-cacher
Submitted by ggarron on Fri, 05/16/2008 - 21:56.If you have some Debian machines already installed, and you plan to install some others, you maybe are going to use the net-install CD, which is the most common way to install Debian.
That may take a long time, to install all the Desktop Gnome or KDE, all the applications or servers, etc, and if you have just installed your apt-cacher server as me, you will not be able to use it this first time .... unless you populate it.
wget - Resume downloads, limit the speed and much
Submitted by ggarron on Thu, 05/15/2008 - 23:09.wget is a command line tool used to download files, or complete webpages, it is a great utility with lots of options, as you can see if you read the wget man page
Some months ago, I have written about how to download files with wget, now I want to add some other tips to those already explained that day.
Resume a download
The /etc/default/rcS file
Submitted by ggarron on Thu, 05/15/2008 - 19:40.There is some behavior of your Linux Operating System which is easy to change, but not too common to know how.
The things you can change are:
- Frequency to erase /tmp/ directory
- Use UTC or local time
- How Verbose are the boot messages of your Linux
- If a disk error should be always repaired while booting automatically
There are more than those, but I will touch only those, for the rest, you can enter:
man /etc/default/rcS
Tip: Importing your /var/cache/apt/ files to apt-cacher database
Submitted by ggarron on Thu, 05/15/2008 - 14:46.Yesterday, I wrote about apt-cacher, and when you first install it, its database is empty, and of course the server where it is installed could have a lot of .deb files, in the /var/log/apt/archives/, so it would be great to use those packages in our new ATP proxy.
To do that we need one of the perl scripts that come with apt-cacher, and that are stored in:
/usr/share/apt-cacher
The right script for this task is: apt-cacher-import.pl , so run:
Cut or trim mp3 files with Linux, mpgsplit and mp3cut
Submitted by ggarron on Mon, 05/12/2008 - 20:51.Some months ago I have posted an article showing how to use audacity to edit mp3 files with Linux, this time it is almost the same but we will use our Linux Operating system command line to do that.
We are going to see two different options:
1. mpgtx
To install this program under Debian
sudo aptitude install mpgtx
Now if you want to trim a mp3 file into 10 pieces just enter this command
mpgtx -10 input.mp3 -o output
Small tip, how to install startx command
Submitted by ggarron on Mon, 04/28/2008 - 14:44.Today, I was "playing" with the Linux configuration (as usually) and using tasksel on my Debian I remove the Desktop section, and installed it again, when I tried to use startx I just could not, there was no startx command.
After reading a while I found that I needed to install xinit package to have startx in my machine.
so:
sudo aptitude install xinit
cpufreqd - How to configure you cpu speed
Submitted by ggarron on Sun, 04/13/2008 - 06:21.cpufreqd is a Linux daemon, that lets you control the speed of your CPU(s), depending on some variables, or also be set manually, you can set it to act dynamically or manually, you can define a lot of profiles and rules, which will control your CPU speed, the variables could be the temperature of your CPU, the amount of charge in your battery if AC is connected or not.
First thing you need to do is to install the daemon, in Debian / Ubuntu
sudo aptitude install cpufreqd
Problems using OpenOffice documents on a NFS drive
Submitted by ggarron on Mon, 04/07/2008 - 18:05.I am using OpenOffice 2.3 with Debian Lenny, and using a drive over NFS and OpenOffice seems to fail locking the file, so it "hangs" for a while and suddenly comes to life again but the file opened is only in read mode.
First I went to check my /etc/exports file and then to check if everything in the /etc/hosts.deny and /etc/hosts.allow files and all was correct, so after googling a while I found the solution.
You need to change the file:
/usr/bin/soffice
and make these lines look this way:
Trash can or Recycle bin in Linux Desktop (managed from console)
Submitted by ggarron on Fri, 04/04/2008 - 20:21.Linux Desktops, at least Gnome and KDE has a trash can, where your deleted files go, (only when deleted from a Desktop utility).
Now if you want to manage it from the console, you can, first we need to know that the trash can is only another folder in the File system structure and it is located at:
$HOME/.Trash
so you can send files to Trash just moving them to there, as an example, lets suppose you have a file in your home called balance.ods and want to move it to the trash can.
mv $HOME/balance.ods $HOME/.Trash/
How to assign a password to root user in Ubuntu
Submitted by ggarron on Wed, 04/02/2008 - 11:41.Ubuntu by default has no root password, and you can also configure Debian in that way if you choose the advanced installation option, and decide not to use the root password.
But what to do if later you need the root user? well you just need to assign a password to the root user and then you will be able to switch to root user.
sudo passwd
Type a good strong password twice, and you are done.
su -
Type the root password and voila! you are logged as root, you know you have to be carefull on what you do being root right?
apt-get, aptitude, autoremove and orphans
Submitted by ggarron on Thu, 03/13/2008 - 15:58.Until some weeks ago I used to use only apt-get, and then I realized that aptitude is better in taking care of orphan packages.
I am no expert here, but this is the way I think they both work, at least on Debian Etch, I have heard that in Lenny both works more or less the same, I use Lenny, and yes they can do the same thing but in different ways.
Reading compressed Files
Submitted by ggarron on Thu, 03/13/2008 - 14:39.I did not know this, but if you need to show a compressed text file on the screen, you do not actually need to uncompress it.
You can use zcat to send the file to the standard output, uncompressed, but the original file remains untouched.
The syntax of the command is:
zcat file.gz
or you can also use,
gunzip -c file.gz
Copying all your emails to another account
Submitted by ggarron on Mon, 03/10/2008 - 13:44.If you are like me, and administer your own email in a Linux box, and do not have set CPanel or any other similar tool, you can still forward your email to another account or, just send a cc to another account.
Let's say you are:
And the email for john.com is managed by a Linux server with sendmail, or Postfix, and you may want all your incoming email to john@john.com to be copied to john@gmail.com just have to edit or create the .forward file in your home directory
vim $HOME/.forward
Enabling sound in my Light weight Debian - Fluxbox Laptop
Submitted by ggarron on Sun, 02/17/2008 - 20:09.Continuing with my Lightweight Debian configuration, today I wanted to add sound and music to it, I have 4 Gigs of MP3, and I needed to hear them.
checkinstall - trace your .tar.gz installations, and make/create your .deb or .rpm files
Submitted by ggarron on Fri, 02/08/2008 - 03:33.I always prefer to use the package manager instead of compiling from sources, mmh maybe compiling is more creates more efficient programs, than using binaries, but in that case, we better use Gentoo or Sabayon, but if we are using Debian/Ubuntu, or Centos/Fedora, I still think is better to use binaries.



