Wednesday, September 26, 2007

Turning on bind query logging

If you want to turn on the query logging for bind, you can use the rndc command.

$ rndc querylog

To see whether your querylog is on or off, use this below command:

$ rndc status
$ /etc/init.d/named status

After running the above command, you can see these lines:

[root@secondary-dns ~]# rndc status
number of zones: 5
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is ON
recursive clients: 0/1000
tcp clients: 0/100
server is up and running

Tuesday, September 11, 2007

Converting flv files to avi and mpeg

In linux we have a good tool, although text based, to convert between various video format. The tool is ffmpeg. This article will guide you on how you can convert flv format video to avi and mpg.

1. change your directory to the directory where your flv video is located.

2. run ffmpeg command:
$ ffmpeg -i input.flv output.avi
where -i stands for input and output.avi is the output file in avi or mpg.

3. For more advanced setting, you can use the command below
$ ffmpeg -i input.flv -ab 56 -ar 22050 -b 500 -s 320x240 output.mpg
-ab is audio bitrate with default of 64kbps
-ar is audio samplerate with default of 44100Hz
-b is video bitrate with delault of 2000kbps
-s is size with default of 160x128px

Wednesday, September 5, 2007

Resetting mysql root password

Sometimes you have to access a mysql database and you somehow does not know the password or the user of the database. The last resort is you have to use the root password but the password is unknown. There is always the way to solve anything and the way to reset the root password is described below. Enjoy!

1. Open a terminal and stop mysqld daemon if it has been started: $ /etc/init.d/mysqld stop
2. Type this command: $ mysqld_safe --skip-grant-tables
3. Open a new terminal, and access mysql database using root:
$ mysql -u root mysql
4. Change root password to new password: mysql> update user set password=password('newpassword') where user='root';
5. flush mysql privileges: mysql> flush privileges;
6. Exit mysql: mysql> exit
7. Close the terminal with the mysqld_safe command
8. Restart mysql: $ /etc/init.d/mysqld start