Absolutely Tech

[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.ubuntu.com/karmic-updates/python-gtkhtml2

For maverick users, you’ll have to download and install libgtkhtml2-0 package from the following site to solve dependency issue of python-gtkhtml2 :
http://packages.ubuntu.com/lucid/libgtkhtml2-0

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] Install Opera 10.6 via PPA in Ubuntu

Opera 10.6 which was released yesterday is currently one of the fastest browsers. It has beaten Chrome in javascript speed test. It also features better support for HTML5, WebM video support.

You can now install it on Ubuntu via PPA.

Add the PPA in your repository:


sudo sh -c 'echo "deb http://deb.opera.com/opera/ stable non-free" >> /etc/apt/sources.list.d/opera.list'

Add the key:


sudo sh -c 'wget -O - http://deb.opera.com/archive.key | apt-key add -'

Update your package list:

sudo apt-get update

Finally install opera:

sudo apt-get install opera

Enjoy the all new opera!
Cheers!

[HOWTO] Reset MySQL root password on Ubuntu when you’ve forgotten it

To err is human. Humans forget things, MySQL root password is one of those things. However, its not very difficult to reset the root password if you have root access to the machine.

The tutorial does seem a bit long because of all the alternate ways to kill and start the mysqld, but trust me its simple.

Here’s in short what we will be going to do:

  • Step 1: Stop mysql server process
  • Step 2: Start mysqld with --skip-grant-tables option.
  • Step 3: Run mysql without any parameters.
  • Step 4: Change the root admin password (old password not required.)
  • Step 5: Close mysql and restart mysql server.

And here are the detailed instructions to reset MySQL root password: Read the rest of this entry »

[SOLVED] Error ‘dpkg: error processing <filename> (--unpack) trying to overwrite…

Recently I got this error after installing VLC on Ubuntu 10.10 Maverick Meerkat. Not really remembering what caused the error to be triggered in the first place, it became very difficult to find a solution for it.
When I executed sudo apt-get upgrade to upgrade my packages, it told me there was some issues and I needed to execute sudo apt-get -f install to fix them. I did as advised but it produced the following error:

Reading package lists… Done
Building dependency tree
Reading state information… Done
Correcting dependencies… Done
The following extra packages will be installed:
vlc vlc-nox
Suggested packages:
mozilla-plugin-vlc videolan-doc
The following packages will be upgraded:
vlc vlc-nox
2 upgraded, 0 newly installed, 0 to remove and 198 not upgraded.
66 not fully installed or removed.
Need to get 0B/5,258kB of archives.
After this operation, 229kB of additional disk space will be used.
Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
vlc vlc-nox
Install these packages without verification [y/N]? y
(Reading database … 206759 files and directories currently installed.)
Preparing to replace vlc 1.1.0-1~ppa1~maverick (using …/vlc_1.1.0-1ubuntu1_i386.deb) …
Unpacking replacement vlc …
dpkg: error processing /var/cache/apt/archives/vlc_1.1.0-1ubuntu1_i386.deb (–unpack):
trying to overwrite ‘/usr/lib/vlc/plugins/access/libxcb_screen_plugin.so’, which is also in package vlc-nox 1.1.0-1~ppa1~maverick
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Preparing to replace vlc-nox 1.1.0-1~ppa1~maverick (using …/vlc-nox_1.1.0-1ubuntu1_i386.deb) …
Unpacking replacement vlc-nox …
dpkg: error processing /var/cache/apt/archives/vlc-nox_1.1.0-1ubuntu1_i386.deb (–unpack):
trying to overwrite ‘/usr/lib/vlc/lua/playlist/anevia_streams.luac’, which is also in package vlc 1.1.0-1~ppa1~maverick
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/vlc_1.1.0-1ubuntu1_i386.deb
/var/cache/apt/archives/vlc-nox_1.1.0-1ubuntu1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

After some time of googling and head-scratching, I finally found a solution and it wasn’t that difficult either.
To fix it just note down the path of files which are causing the trouble. From the above mentioned error, we can clearly see that there are these two files causing the error:
Read the rest of this entry »

[HOWTO] Download youtube video from command-line

Linux is awesome and so is the terminal. Things become a lot more easy if you can just type in few commands and get your work done. Downloading youtube video has always been messy with GUI downloaders, browser extensions and web services which claim to give you the download link to that video. Now, you can download it from the terminal using youtube-dl in ubuntu. You can also download and install it in other flavors of linux. The script is written in python.

Install youtube-dl from the official repository in Ubuntu:

sudo apt-get install youtube-dl

To download a video execute the following:

youtube-dl <url>

Example screenshot:

Read the rest of this entry »

[HOWTO] Install VLC 1.1 via PPA on Ubuntu

VLC 1.1 which was released yesterday boasts lots of improvement and feature additions including:

  • GPU decoding on Windows Vista and 7, using DxVA2 for H.264, VC-1 and MPEG-2
  • GPU decoding on GNU/Linux, using VAAPI for H.264, VC-1 and MPEG-2
  • DSP decoding using OpenMax IL, for compatible embedded devices
  • Improved support for MKV HD, including seeking fixes, and 7.1 channels codecs
  • Support for new codecs, like Blu-Ray subtitles, MPEG-4 lossless and VP8
  • For complete list of new features and improvements visit http://www.videolan.org

    You can install VLC on your Ubuntu via PPA repository. Ofcourse, downloading from their site is an option but installing using repository is more convenient.

    Execute the following commands in terminal to install the latest VLC player:

    sudo add-apt-repository ppa:c-korn/vlc && sudo apt-get update
    sudo apt-get install vlc mozilla-plugin-vlc

    This will install the latest version of VLC on your computer.

    Cheers!

    Ubuntu 11.04

    The next version of Ubuntu is coming soon

    Follow me

    Sponsors