Absolutely Tech

[HowTo] Enable or disable modules in Apache

You can enable or disable any apache module using a2enmod and a2dismod. You don’t need to edit the conf file for that unless you are having some problem with this method. The syntax of these commands is really simple:
To enable a module:

sudo a2enmod module_name

To disable a module:

sudo a2dismod module_name

Read the rest of this entry »

[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] 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!

[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 »

[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] Use local phpmyadmin with remote MySQL

My host recently started allowing remote connections to its mysql database. It was a really useful feature – I could not change database settings from my own computer. Since it started allowing remote connections from my IP, I could use any mysql client to connect to it. I fired up terminal and tried to connect using the command:

mysql --host=69.89.31.242 --user=username --password=password

It connected. This was just to test the connection. I wanted to connect my phpmyadmin with this remote host. For that I edited /etc/phpmyadmin/config-db.php file and changed:

$dbserver=”;

to

$dbserver=’69.89.31.242′;

I loaded the url http://localhost/phpmyadmin, entered the database username and password and I got in. I could administer my database from my local phpmyadmin installation.

Cheers!

13 cool themes for Linux

Those of who are bored of the dull themes of Linux, I found 13 cool new themes for Linux.

Bisigi Themes provide 13 free themes, each has its own icon-set, wallpaper, and color scheme. Just a few terminal commands are needed to install them.

Installation instructions of Bisigi Themes

Few people have complained that the link above does not open, so I’ll give the instructions here as well.

Add the key for repository:

gpg --keyserver hkp://keyserver.ubuntu.com:11371 --recv-key 881574DE && gpg -a --export 881574DE | sudo apt-key add -

Read the rest of this entry »