Audio conversion with ffmpeg

Hi Guys!

Do you ever stuck with DVD’s or CD’s player while playing your favourite audio’s?
If yes, you are in right place. I will told you how to convert your audio formats with this simple trick in one go.

So, first you all need to know about ffmpeg.
ffmpeg : It is a free software which helps you to convert your audio formats.

To use this, you have to compile it on your system. Follow this below given link.

After compilation, you can convert any type of audio and video according to your requirement.

Basic command to run ffmpeg is

ffmpeg -i inputfilename..mp3 outputfilename.m4a

Here -i means input file.

So simple, isn’t it.

Well if you want to play with ffmpeg, like setting its bit rate, channel and frequency.
You need to compile ffmpeg with libfdk_aac library for high quality output.

I will tell you by giving some examples.

To convert .wav to .aac

ffmpeg -i song003.wav -c:a libfdk_aac -ar 44100 -ab 128000 -ac 2 wav.aac

ar to set frequency
ab to set bitrate
ac to channel like stereo or mono.

To convert .m4a to .aac

ffmpeg MediaCoder.m4a -c:a libfdk_aac -vbr 4 m4a.aac

vbr stands for variable bit rate. It may vary from 1 to 5. For further detail you can check this link.

To convert .wma to .aac

ffmpeg -i Kronke.wma -c:a libfdk_aac -vbr 4 wma.aac

Above given commands convert your audio file specifications to Stream #0:0: Audio: aac (LC), 44100 Hz, stereo, fltp, 128 kb/s.


Install Laravel on Ubuntu


Laravel is a free, open source PHP web application framework, designed for the development of MVC web applications.


1. Latest version of PHP,MySQL and Apache Web Server must be installed on your system.

2. You need to ensure that you have mod_rewrite enabled on your web server.

$ sudo a2enmod rewrite

3. Install the PHP JSON extension.

$ sudo apt-get install php5-json.


1. Download the latest version of laravel framework and extract its contents into a directory on your server. Don’t forget to give permissions to it.
2. Laravel utilizes Composer to manage its dependencies,we need to install Composer (again, this means downloading it into your project)

$ curl -sS | php

Note: If the above fails for some reason, you can download the installer with php instead.

$ php -r "readfile('');" | php

4. Next, run below given command to install all of the framework’s dependencies and the framework dependencies as mentioned in composer.json file.

$ php composer.phar install

Note : Run this command from the root of your application.

5. Lastly, we’ll need to setup a virtual host for Laravel. Add the domain,, to our hosts files i.e /etc/hosts

Note: we are not buying an actual .com domain, but just making one at local installation.

This will inform our machine that the domain will resolve to, which is the local computer.

6. In the Laravel files you should see a directory, called public, which is where all publically accessible files should go. In addition to that, we need to make sure that our domain, only points to the public folder and nowhere else. Edit /etc/apache2/sites-available. Add following lines to it.
(i) Copy deafult file as a new file.

$ cp default laravel

(ii) Edit /etc/apache2/sites-available/laravel. Add below given lines to it.

<VirtualHost *:80>
DocumentRoot "/var/www/laravel-master/public"
<Directory "/var/www/laravel-master/public">

(iii) Run below given command after it.

$ sudo a2ensite laravel

7. Reload apache Server.

$ sudo service apache2 reload

8. Run on your browser. It display “You have arrived”. That’s all.



I have recently listen presentation on Typography delivered by Inderpreet Singh. He delivered in such a way that he enforced audience to think upon every minute while reading or writting any material.

Typography is how to present written material in well manner. It is not about designing or decorating, it is about problem solving. Typograpghy is justfont, which change mood of readers. Every font say something, and every font has special meaning, just to recognize it which font where needed.
Most of the webpages filled with content in bad typography, that makes reader uncomfortable.

Typography change the look of material in such a way that reader kept on reading with interest. It is the heart of articles, blogs and webpages.

Before listening to this presenatation I have never think about Typography.
Now I came to know, how much Typograpghy matters.
Need to think how we can read books continuosly, specially novels.
Need to think that how small things made change from good to excellence.
Without typograpghy is just like forget to put maggie masala into maggie.

Install Ubuntu Server

Take backup of your data.

Make tar file:

# tar -cvzf maketarfile.tar.gz ./*

To know about tar more, try “man tar” in your command window.

./* use to give path of directory of which you make tar file. 
. is current directory
/ current directory inside
* consider everything

Copy to USB media:

# cp -r maketarfile.tar.gz /media/media_name

Unmount media after copied tar files:

umount mount point
ex : unmount /dev/sdb1

Install Ubuntu Server

Get USB media either bootable CD or pendrive of Ubuntu Server.
Insert USB in USB port.
Press favourable function key to enter boot menu.
Language setting : English US
Detect keyboard layout : NO, in our case. 
Keyboar layout setting : US

After loading additional components
hostname- Define hostname example abc.local
Creating manual partitions :
delete primary and logical partitions if exist.

  • create a new partition for home
  • Mount point /home
  • create a new partition for var 
  • Mount point /var
  • create a new partition for boot
  • Mount point /boot
  • Create a new partition for root
  • Mount point /

Done with disk patitioning.

Manage upgrades:
Softare Default Install Server
Install SSH Server
Install the GRUB boot loader to the master boot record

Finish Installation

Network Configuration for static IP

Open the /etc/network/interfaces file. I have used vi, but you can choose a different editor.

# vi /etc/network/interfaces

auto eth0
iface eth0 inet static

you can customize this to your network.

Set DNS nameserver either Open DNS and Google DNS:

Open DNS
Google DNS

# vim /etc/resolv.conf

Now you will just need to restart the networking components

# /etc/init.d/networking restart

Reboot you system

# sudo reboot

Six Month Training Experience

Before training, I have planned going to chandigarh for my 6 moths training. I wanted to work in an IT Company and side apart an IELTS Course. I have tried to find an IT Company, but unfortunately I did not have any relations with an IT Person. As my Training application submit date had come closer, I asked my friends where they would be joining. One of my friend Jaspreet Kaur Sarao replied and suggested me to join training in college campus, under Dr. H.S.Rai Dean of Testing & Consultancy Cell, Guru Nanak Dev Engineering College. Many questions were arising in my mind, as which language would be taught there?, On which technology we will work? Jaspreet answered all my questions. She told about her 6 weeks training. That she worked on open source Softwares and Linux. IT companies used windows or proprietry softwares, which is not good. She also gave example of old Trainee under Dr. H.S.Rai, is Parveen Arora. Who have selected in GSOC. Then I made up my mind to get trained under Dr. H.S.Rai, with hope of my best output. I have experienced various technical lectures on some language in my 6 weeks training are HTML, CSS, JavaScript,Ajax, PHP, MySQL learned from outside in an Institute. This was the only teaching method I knew.

At the time of Training, apart from my projects, which I experienced is not less then any IT company or a dream workplace. The best thing is “Environment”. Trainees shared their experience, ideas, problems on mailing list. Training has not based on any language, it has based on project-oriented approach or problem-oriented approach. The working technique has to get project and understand requirements. On the basis of requirements, learning process has begin. Searching on Internet is a first choice, and which made me feel independent. Tools and Techniques are practiced well from internet. The main part is code, which requires language, is choice to chose by self. Rule to use Open Source. I am Working on a linux Operating system and useing FOSS. I learned to manage code on github. Work is properly documented and blogged. Write daily diary during Training time which made me worked. I am updated with the new technology by attending seminars and Discussions on mailing list. I rely on Open Source, want to work with an Open Source organization, participate in GSOC.

After Training, I felt change in me, I no more need any institute to work on. I am self motivated. This change is only made because of my mentor Dr. H.S.Rai, which spend their valuable time on us. I always wish to remain his student for my lifetime. The most important thing is now I have learned how to work, how to solve my problems.

LDAP authentication in WordPress


Install LDAP
Install WordPress from 2.2 to 3.4 version


1. Create Users and Groups in LDAP.
2. Install wpDirAuth plugin in WordPress.
3. Configure wpDirAuth plugin. Steps to do this.
(i) Go to Directory Auth from settings menu.
(ii) Enable Directory Authentication to Yes if you want that WordPress authenticate LDAP users.
(iii) Requires SSL Login to Yes if you want WordPress login to do encryption.
(iv) Directory servers(Domain Controllers) means DNS or IP address. In my case I installed LDAP on my local server that is localhost.
(v) Account Filter means attribute of LDAP which authenticates WordPress login. In my case I chose cn(common name).
(vi) Base DN(distinguish name) contains the name of LDAP group of users you used to register in WordPress. In my case I have given ou=people,dc=navdeep,dc=bagga. Where ou=people is LDAP group of users.
(vii) Bind DN value contain admin of LDAP. Below given command displays the admin of your LDAP.

$ ldapsearch -x -b dc=debuntu,dc=local

In my case it is cn=admin,dc=navdeep,dc=bagga

(viii) Bind Password is a password of LDAP.

4. Save your settings by clicking on Update Options.
5. Go to Users menu and Click on ‘Add Directory Authenticated User’.
6. To register your LDAP user in WordPress, give filter attribute value in SSOID field which you have given in Account filter at the time you have configured plugin.In my case I have given name neha which is the value of cn in my LDAP. Define your role which you want to give to that member. Click on Add New User.
7. Open your login window in WordPress. Give ldap Username and password which you have registered in WordPress(step 6).

Configure gateway on ubuntu

Before configure gateway first install kannel

Configuration of gateway can be divided into two parts.

Bearerbox : bearerbox is a gateway, interface towards the phones. Its work is to keeping an eye on the gateway while it is running and use http interface to control the gateway.

smsbox : It handles sms gateway functionality. It contain sms-services, sendsms-user group which helps sms center to build.

sqlbox : (optional) sqlbox is used for DLR(delivery report) storage. Use to store logs of incoming and outgoing SMS in database.

Purpose of Using kannel : To send and receive sms for your application.

Requirements : GSM phone or modem (link to compatible.shtml)

Attach your phone or modem to the computer through USB cable.

Enter the following command in your terminal.

$ wvdialconf
 Note : run command with sudo user

If it display : No modem was detected.

Then your phone is not compatible with kannel.

If it display : Found an USB modem.

Then your phone is compatible with kannel.

Your connected device configuration written to /etc/wvdial.conf

Open wvdial.conf file in your favourite editor.

$ vim /etc/wvdial.conf

Value of Init1 ,Init2, Modem Type, Modem use in gateway configuration

Lets write configuration file for kannel.

Edit kannel.conf file on your desktop or anywhere you want in your file system.

core group is used for general bearerbox configuration. dlr-storage value is depend on which DBMS is used.

group = core
 admin-port = 13003
 admin-password =
 admin-allow-ip = ""
 dlr-storage = mysql //where to store the logs of sms
 smsbox-port = 13016
 log-file = "/var/log/kannel/bearerbox.log"
 access-log = "/var/log/kannel/access.log"
 box-allow-ip = ""
 log-level = 0

smsc group include all variables which used to set SMS center in kannel. smsc-id value is name of device which is connected. modemtype and device change according to Modem value in wvdial.conf file

group = smsc
 smsc-id = Nokia
 smsc = at
 modemtype = USB Modem
 device= /dev/ttyACM0
 my-number = +919888888887
 connect-allow-ip =
 sim-buffering = false
 log-level = 0

mysql-connection group is used when mysql database is used to store data values. database,username,password variables values are database name,database username and password respectively.

group = mysql-connection
 id = mydlr
 host = localhost
 username = boot
 password = abc
 database = key
group = dlr-db
 id = mydlr
 table = dlr
 field-smsc = smsc
 field-timestamp = ts
 field-destination = destination
 field-service = service
 field-url = url
 field-mask = mask
 field-status = status
 field-boxc-id = boxc

Modem group is used to define Modem configuration. init- string variable value change according to Init value in wvdial.conf file

group = modems
 id = Nokia
 name = Nokia
 detect-string = "Nokia"
 init-string = "ATZ"
 init-string = "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
 message-storage = SM
 message-start = 0

smsbox group must define to use SMS Kannel

group = smsbox
 smsbox-id = mysmsbox
 bearerbox-host = localhost //hostname
 bearerbox-port = 13020
 sendsms-port = 13013
 global-sender = +919888888887 //your modem number
 access-log = "/var/log/kannel/smsbox-access.log"
 log-file = "/var/log/kannel/smsbox.log"
 log-level = 0
 mo-recode = true

smsbox route group is develop an interface between smsbox and bearerbox.

group = smsbox-route
 smsbox-id = mysmsbox
 smsc-id = Nokia

sendsms-user group is used to push SMS through browser. Variables username and password are used for authentication purpose.

group = sendsms-user
 username =
 password =
 concatenation= true
 max-messages = 10000

sms-service group is provide services to incoming SMS. Accepted-smsc variable means which SMS center used to accept as incoming SMS.

group = sms-service
 keyword-regex = .*
 catch-all = true
 accepted-smsc = Nokia
 max-messages = 99
 get-url = "http://localhost/api/sms.php?phone=%p&text=%a"

Edit sqlbox.conf file where your kannel.conf file is placed.

sqlbox group used to tell kannel about sms log table and insert table. The sql-insert-table is used to store SMS which we want to send and sql-log-table is show logs of sms which are send through kannel and log of delivery reports.

group = sqlbox
id = sqlbox-db
global-sender = "+919888888887"
bearerbox-host = localhost
bearerbox-port = 13016
smsbox-port = 13020
smsbox-port-ssl = false
sql-log-table = sent_sms
sql-insert-table = send_sms
log-file = "/var/log/kannel/kannel-sqlbox.log"
log-level = 0

mysql-connection group explained before

group = mysql-connection
id = sqlbox-db
host = localhost
username = boot
password = abc
database = key

Lets send SMS through kannel through http(browser) and application. Excited 😉

Start kannel service: Run these commands on seperate Terminals sequentially with sudo user.

$ bearerbox -v 1 kannel.conf
$ sqlbox -v 1 sqlbox.conf
$ smsbox -v 1 kannel.conf

Set verbosity level
0 is ‘debug’.
1 is ‘info.
2 ‘warning’.
3 ‘error’.
4 ‘panic’.

Send SMS through browser : Open your favorite browser and type below given on address bar.


13001 is an admin-port number which is defined in core group.
username and password value which is define in sendsms-user group.
to value contain phone number to whom we want to send SMS.
text value contain content of SMS.

Send SMS through application : To send through application is just do one entry in send_sms table of defined database in config files.

Method : Write sql query which insert sender, receive number and message data in send_sms table. kannel automatically check send_sms table and send SMS.

sql code of tables



All the Best!

User and Group Management in ldap through command line

Create a new user :

# ldapadduser george example

This will create a user with uid george and set the user’s primary group (gid) to example

It gives error
Cannot resolve group example to gid : not found

Error solved
First create group then add user in it

Create group:

# ldapaddgroup qa

Add user to group:

# ldapadduser george qa

Change password of user:

# ldapsetpasswd george
Changing password for user uid=george,ou=People,dc=example,dc=com
New Password: 
New Password (verify):

Delete user:

# ldapdeleteuser george

Delete group:

# ldapdeletegroup qa

Add user to group:

# ldapaddusertogroup navdeep telephonedirectory

Delete user from group:

# ldapdeleteuserfromgroup george qa

Terminal screen while performing operations

meow@meow-Ideapad-Z570:/etc/ldapscripts$ sudo ldapadduser george qa
Successfully added user george to LDAP
Successfully set password for user george
meow@meow-Ideapad-Z570:/etc/ldapscripts$ sudo ldapsetpasswd george
Changing password for user uid=george,ou=People,dc=navdeep,dc=bagga
New Password: 
Retype New Password: 
Successfully set password for user uid=george,ou=People,dc=navdeep,dc=bagga
meow@meow-Ideapad-Z570:/etc/ldapscripts$ sudo ldapdeleteuser george
Successfully deleted user uid=george,ou=People,dc=navdeep,dc=bagga from LDAP
meow@meow-Ideapad-Z570:/etc/ldapscripts$ sudo ldapadduser navdeep qa
Successfully added user navdeep to LDAP
Successfully set password for user navdeep
meow@meow-Ideapad-Z570:/etc/ldapscripts$ sudo ldapaddgroup telephone directory
Error adding group telephone to LDAP
meow@meow-Ideapad-Z570:/etc/ldapscripts$ sudo ldapaddgroup telephonedirectory
Successfully added group telephonedirectory to LDAP
meow@meow-Ideapad-Z570:/etc/ldapscripts$ sudo ldapaddusertogroup navdeep telephonedirectory
Successfully added user navdeep to group telephonedirectory
meow@meow-Ideapad-Z570:/etc/ldapscripts$ sudo ldapdeleteuserfromgroup george qa