Enter your email address:

Delivered by FeedBurner

Linux tips

How to play a DVD video ISO image

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)

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?

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

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

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

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

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

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

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

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

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

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

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)

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

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

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

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

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:

john@john.com

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

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

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.

Syndicate content

This site is proudly hosted at Bluefur Hosting