Absolutely Tech

[SOLVED] “Ignoring file ‘.distUpgrade’ / ‘.save’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension” on Ubuntu 10.10

Recently apt-get update started throwing notices which read:

Ignoring file 'opera.list.distUpgrade' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
Ignoring file 'opera.list.save' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension

It occured because sources.list.d directory isn’t supposed to contain files with .distupgrade and .save extensions, but since I upgraded my distribution from 10.04, backup copies of the source files were made with .distUpgrade appended to them. Similarly .save files were not supposed to be in the directory which made it throw this error. Fortunately you can suppress this error by executing the following command:

sudo sh -c "echo 'Dir::Ignore-Files-Silently:: \"(.save|.distupgrade)$\";' > /etc/apt/apt.conf.d/99ignoresave"

This will suppress the error. Next time you run sudo apt-get update you wouldn’t see those errors.

Cheers!

[SOLVED] No sound in tuxguitar

Tuxguitar stopped working after upgrading to Ubuntu 10.10 Alpha. Many people seem to be having this problem after a distribution upgrade.

The fix is simple. Install timidity and tuxguitar-jsa package.

sudo apt-get install timidity tuxguitar-jsa

After the install, run tuxguitar and play a file. You should hear the sound. If you still cannot hear it play, goto Tools->Settings->Sound
In the MIDI Sequencer drop down list, select ‘Real Time Sequencer’. In the MIDI Port field, select ‘Gervill’ and click on Ok. Click on Yes when it asks for confirmation.

Try and play sound again, and you should here it this time.

Ubuntu 11.04 named ‘Natty Narwhal’

Ubuntu 11.04, which is to be released in April 2011, has been named Natty Narwhal as mentioned on Mark Shuttleworth’s blog.
Check out the entire blog post here.

Seems reasonable, as weird sounding as all previous names. Ubuntu, you never disappoint me!

[Solved] vlc: missing mandatory argument `–user-agent=”VLC media player”‘

Yesterday after upgrading the packages VLC refused to start giving out following error message:

VLC media player 1.1.1 The Luggage (revision exported)
vlc: unknown option or missing mandatory argument `--user-agent="VLC media player"'
Try `vlc --help' for more information.

To solve the error, just reinstall vlc:

sudo apt-get install vlc

Cheers!

[HowTo] Use mutt with msmtp

Mutt is a small but very powerful text-based mail client for Unix operating systems. Msmtp is a smtp client which is available for Linux as well as windows.
Configuring mutt to work with msmtp is fortunately quite easy. Here’s a tutorial teaching the same.
Step 1:
Find the executable path of msmtp:

which msmtp

Step 2:
Just open ~/.muttrc using a text editor and add the following code to it:

send2-hook '~f fromaddress@example.com' 'set sendmail="PATH"'

Replace PATH with the executable path of msmtp and replace fromaddress@example.com to the FROM address you want in your email address to appear. For me the code looks like the following (on Ubuntu 10.10):

send2-hook '~f dpac.mittal2@gmail.cm' 'set sendmail="/usr/bin/msmtp"'

Try sending a mail with mutt and it should succeed.

Cheers!

[HOWTO] Send emails(using mail function) from localhost in PHP through msmtp (using gmail account) on Linux

There’ve been lots of times when I wanted to use the mail() function on my local server. I am sure lots of you would’ve been wanting it too but most of you would’ve settled for PHPMailer or just used a web host to test the code instead. I myself had been doing the same until recently when I finally decided to do some research and get it to work.

Here are the steps in short for the geeks who like to do things on their own:
All I did was used smtp client called msmtp, configured it to work with my gmail account and configured PHP to use msmtp to send emails.

This tutorial is only applicable for linux users. I’ll write another article for windows users soon when I get my hands on a windows box.
All the commands used in the instructions are for Ubuntu, however you may use corresponding commands for your distro (for eg; you can use yum install instead of apt-get install on fedora, redhat, centos.

Step by step instructions:

Read the rest of this entry »

[HowTo] Configure msmtp to work with gmail on linux

Msmtp is a small but powerful and highly customizable smtp client. You can access gmail smtp using msmtp, which is exactly what I’ll teach in this tutorial.

Step by step instructions:

  1. Install msmtp and ca-certificates for use with SSL:
    sudo apt-get install msmtp ca-certificates
  2. Read the rest of this entry »

[SOLVED] No module named gtkhtml2

I came across this error while trying to run BloGTK.

I tried installing it from repositories but it failed:

sudo apt-get install python-gtkhtml2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package python-gtkhtml2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package python-gtkhtml2 has no installation candidate

There’s a bug filed for this.

To solve the error, I downloaded the appropriate .deb package from here and installed it:
http://packages.debian.org/testing/python/python-gtkhtml2

Cheers!

[HowTo]Extract almost any archive through terminal using a single command in linux

I came across this simple script on ubuntuforums which I thought was really very useful and worth sharing it on my blog. You can either make a function out of it and put it in .bashrc file or make an executable script and put it in /usr/bin/.

Method 1:

Open your ~/.bashrc file using any editor.

gedit ~/.bashrc

Copy and paste the following code at the end of it:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
extract-file () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjvf $1 ;;
*.tar.gz) tar xzvf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjvf $1 ;;
*.tgz) tar xzvf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "'$1' cannot be extracted via extract-file" ;;
esac
else
echo "'$1' is not a valid file"
fi
}

Now you can use the following command to extract any archive:

extract-file

The command extract-file would be available only to terminals which have been opened after saving the .bashrc file with the above code. Also this code is user-specific, so if another user logs in he cannot use this command.

Method 2:

Use the following command to create a new file in /usr/bin directory and launch the gedit.

sudo gedit /usr/bin/extract-file

Read the rest of this entry »

[HOWTO] 5 methods to find out your linux distribution name and version through command line

There are lots of commands to find out your ditribution name and distribution version. Some work on some distros, some work on others. Here are some of the methods:

  • lsb_release -a

  • cat /etc/*release

  • cat /etc/issue

  • cat /proc/version

  • uname -a

One of these methods will surely tell you your linux distribution name and current version.

Cheers!