Download of the day: VLC media player

last updated in Categories Download of the day, Linux desktop, OpenBSD, OS X, RedHat/Fedora Linux, Solaris, Suse Linux, Ubuntu Linux, Windows, X server

The VLC media player is an open source and my favorite media player is out with a new version.

It is a highly portable multimedia player, encoder and streamer that supports many audio and video codecs and file formats (MPEG-1, MPEG-2, MPEG-4, DivX, mp3, ogg, …) as well as DVDs, VCDs and various streaming protocols. It is able to stream over networks and to transcode multimedia files and save them into various different formats.

It can also be used as a server to stream in unicast or multicast in IPv4 or IPv6 on a high-bandwidth network.

Supported oses:
=> Linux
=> Microsoft Windows
=> Mac OS X
=> BeOS
=> *BSD
=> Windows CE
=> Sun Solaris

Highly recommend even if you are using Windows XP.

Download VLC

=> VLC 0.8.6 download Link

Cross-platform GUI and command line mp3 wrapping and splitting without decoding

last updated in Categories Download of the day, FreeBSD, Linux desktop, OS X, Suse Linux, Ubuntu Linux, Windows

Mp3Wrap is a free command-line utility, which wraps two or more mp3 files in one large playable file, without losing filename and ID3 informations. It’s useful to make large files easy to download on internet and then easy to split again in few seconds 😀

Mp3Wrap will create a file named: OUTPUTFILE_MP3WRAP.mp3. It’s important you don’t remove the MP3WRAP string, because this will tell the split program Mp3Splt that the file is wrapped and can be splitted just with -w option.

Mp3Splt is a free command-line utility that allows you to split mp3 and ogg files from a begin time to an end time. It works on:

  • GNU Linux
  • *BSD
  • MacOS X
  • BeOS
  • Windows etc

So don’t spend your time downloading shareware or other sort of applications. This one is free and open source software. It works from command line and GUI environments.
Cross-platform GUI and command line mp3 wrapping and splitting without decoding

Task: Install mp3wrap and mp3splt command line utilities

Use apt-get command to install mp3wrap and mp3splt utilities under Debian or Ubuntu Linux:
$ sudo apt-get install mp3wrap mp3splt
OR
# apt-get install mp3wrap mp3splt

Task: Wraps two or more mp3 files in one large playable file

General syntax is as follows:
mp3wrap myalbum.mp3 file1.mp3 file2.mp3 file3.mp3 ?.

Let us add two mp3 file
$ mp3wrap myalbum.mp3 LetsGetItStarted.mp3 Summer-Son.mp3Output

Mp3Wrap Version 0.5 (2003/Jan/16). See README and COPYING for more!
Written and copyrights by Matteo Trotta - 
THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!

  50 %  --> Wrapping LetsGetItStarted.mp3 ... OK
  100 % --> Wrapping Summer-Son.mp3 ... OK

  Calculating CRC, please wait... OK

myalbum_MP3WRAP.mp3 has been created successfully!

You can play myalbum_MP3WRAP.mp3 file using standard player:
$ mplayer myalbum_MP3WRAP.mp3

Task: List all files wrapped into an Mp3Wrap file

Pass -l option to mp3wrap command (doesn’t extract anything):
$ mp3wrap -l myalbum_MP3WRAP.mp3Output:

Mp3Wrap Version 0.5 (2003/Jan/16). See README and COPYING for more!
Written and copyrights by Matteo Trotta - 
THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!
Check for file integrity: calculating CRC, please wait... OK
List of wrapped files in myalbum_MP3WRAP.mp3:

LetsGetItStarted.mp3
Summer-Son.mp3

Task: Append or add new mp3 to existing MP3 album

Pass -a option to mp3wrap command so that files are appended and the index is updated:
$ mp3wrap -a myalbum_MP3WRAP.mp3 Remix-KayKay.mp3Output:

Check for file integrity: calculating CRC, please wait... OK

Copying files from input file... 100%

  100 % --> Adding Remix-KayKay.mp3 ... OK

  Calculating CRC, please wait... OK

myalbum_MP3WRAP.mp3 has been created successfully!

Now list all files:
$ mp3wrap -l myalbum_MP3WRAP.mp3

Task: mp3/ogg splitting without decoding

mp3splt is a free command-line utility that allows you to split mp3 and ogg files from a begin time to an end time, without need of decoding and reencoding. It’s useful to split large mp3/ogg to make smaller files or to split entire albums to obtain original tracks. Try to split myalbum_MP3WRAP.mp3 so that you can get back all 3 files:
$ mp3splt -w myalbum_MP3WRAP.mp3Output:

Detected file created with: Mp3Wrap v. 0.5
Check for file integrity: calculating CRC please wait... OK
Total files: 3

  33 % -> LetsGetItStarted.mp3... OK
  66 % -> Summer-Son.mp3... OK
 100 % -> Remix-KayKay.mp3... OK

Further readings

=> Read man pages of mp3wrap and mp3split
=> Download mp3splt for Windows/MAC OS X/Linux version
=> Download mp3splt for Windows/Linux

Setting Up a Linux Game Server with BZFlag

last updated in Categories Linux desktop, Linux Games, OS X, Windows

BZFlag is a free multiplayer multiplatform 3D tank battle game. The name stands for Battle Zone capture Flag. It runs on Irix, Linux, *BSD, Windows, Mac OS X and other platforms. It’s one of the most popular games ever on Silicon Graphics machines.

Linuxjournal is offering a how to that explains Setting Up a Linux Game Server with BZFlag.

From the article:
While the number of popular commercial computer games for Microsoft Windows still far outstrips those available for Linux, as a gaming server, Linux is an extremely popular platform. Linux server software is available for hundreds of commercial games, allowing your Linux server to bring together dozens or hundreds of online gamers at a time.

From the pure, open source standpoint, there are some fun games that have completely free client and server software that you can set up and play against others on your LAN or over the Internet. These include board games (such as Go and Atlantik), strategy games (such as freeciv), and battle games (such as BZFlag).

To try your hand at setting up and playing from your own gaming server, I describe how to configure Battle Zone capture the Flag (BZFlag). BZFlag is a fun 3D tank battle game, designed to be played against others over a network. After you set up a BZFlag server, you can have players battle each other over the network using clients on other Linux, BSD, Mac OS X, or Windows systems.

Read more at Setting Up a Game Server with BZFlag [linuxjournal.com]

How To Lighttpd Create Self Signed SSL Certificates

last updated in Categories lighttpd, Linux, OS X, Security, UNIX
Lighttpd logo

If you are testing an application (web based) or just want secure login page for your application, you can create a self signed SSL Certificates. I have already explained the procedure for installing real third party signed SSL certificate.

Procedure is as follows:

Step # 1: Create self signed SSL Certificates

Create a directory to store SSL certificate:

# mkdir /etc/lighttpd/ssl/domain.com -p
# cd /etc/lighttpd/ssl/domain.com
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# chown lighttpd:lighttpd /etc/lighttpd/ssl -R
# chmod 0600 /etc/lighttpd/ssl/domain.com

You need to provide information such as country name, your domain name etc.

Step # 2: Configure Lighttpd

Open lighttpd configuration file:
# vi /etc/lighttpd/lighttpd.conf Add config directives as follows:
$SERVER["socket"] == "192.168.1.100:443" {
server.document-root = "/home/lighttpd/domain.com"
ssl.engine = "enable"
ssl.pemfile = "/etc/lighttpd/ssl/domain.com/server.pem"
}

Make sure you replace ip 192.168.1.100 with your actual IP address.

Step # 3: Restart Lighttpd

Test config file for errors:
# lighttpd -t -f /etc/lighttpd/lighttpd.conf
Now Restart lighttpd:
# /etc/init.d/lighttpd restart

Make sure port 443 is open
# netstat -tulpn | grep :443

Configure firewall/iptables and open port 443. Following is sample iptabables rules. You need to append code to your iptables shell script:
SERVER_IP="192.168.1.100"
iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d $SERVER_IP --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -s $SERVER_IP --sport 443 -d 0/0 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT

Redirect plain text login page to secure login page

Let us assume you would like to redirect all incoming wordpress requests http://domain.com/blog/wp-login.php request to https://domain.com/blog/wp-login.php
Add following code snippet to your lighttpd.conf file’s port 80 section:
$HTTP["url"] =~ "^/blog/wp-login.php*" {
url.redirect = ( "^/(.*)" => "https://www.domain.com/$1" )
}

You may need to modify your login page to submit form over SSL.

Linux or UNIX: HowTo Find Out or Display The Ethernet Address (MAC)

last updated in Categories FreeBSD, Linux, Networking, OpenBSD, OS X, Solaris, UNIX, Windows server

Media Access Control (MAC) address is a unique identifier attached to most networking devices (such as router, Ethernet cards, servers, nas devices, switches and so on).

This blog posts demonstrates how to get the Media Access Control (MAC) address for an ethernet adapter under Linux, Unix, Apple OS X, and *BSD operating systems using command line options.

Tutorial: How to write cross-platform GUIs using wxWidgets

last updated in Categories C Programming, Linux, Open source coding, OS X, UNIX, Windows
wxWidgets logo

Windows and X widgets (wxWidgets) is an open source, cross-platform widget toolkit; that is, a library of basic elements for building a graphical user interface (GUI)

wxWidgets lets developers create applications for Win32, Mac OS X, GTK+, X11, Motif, WinCE, and more using one codebase. It can be used from languages such as C++, Python, Perl, and C#/.NET. Unlike other cross-platform toolkits, wxWidgets applications look and feel native. This is because wxWidgets uses the platform’s own native controls rather than emulating them. It’s also extensive, free, open-source, and mature.

With this tutorial you will learn how to use the wxWidgets toolkit to create elegant and highly useful GUIs in your programming language of choice.

But why use wxWidgets? Because you want to be able to write a GUI quickly and easily that runs across platforms. You also want to be able to use the programming language of your choice, and you want your GUI looks cool or same on all platform.

Personally, I prefer to use QT toolkit. But I will give a shot to wxWidgets 😀

Switching Back to Desktop Linux from Apple OS X

last updated in Categories Linux, News, OS X

I am sure this article will generate some (perhaps ugly) reaction between both (Mac and Linux) fans… 😉

FTA “…Almost everyone at O’Reilly owns an iBook or PowerBook and almost everyone runs Mac OS X. It’s not everyone’s ideal operating system, however. Recently, free software editor chromatic explained to Mac editor Derrick Story why he switched back to desktop Linux. Here’s what he wants in a usable Unix desktop…

Read more at linuxdevcenter.com… | Found via Lxer

Running Commands on a Remote Linux / UNIX Host

last updated in Categories CentOS, Debian Linux, FreeBSD, Gentoo Linux, Howto, HP-UX, Linux, Monitoring, Networking, OpenBSD, OS X, RedHat/Fedora Linux, Security, Shell scripting, Solaris, Tips, Ubuntu Linux, UNIX

You would like to execute a command on a remote Linux/FreeBSD/Solaris/UNIX host and have the result displayed locally. Once result obtained it can be used by local script or program. A few examples:
=> File system and disk information

=> Get user information

=> Find out all running process

=> Find out if particular service is running or not etc

You can use rsh or ssh for this purpose. However, for security reason you should always use the ssh and NOT rsh. Please note that remote system must run the OpenSSH server.

Syntax for running command on a remote host:
ssh [USER-NAME]@[REMOTE-HOST] [command or script]

Where,

  • ssh: ssh (SSH client) is a program for logging into a remote machine and for executing commands on a remote machine.
  • USER-NAME: Remote host user name.
  • REMOTE-HOST: Remote host ip-address or host name, such as fbsd.cyberciti.biz.
  • command or script: Command or shell script is executed on the remote host instead of a login shell.

Examples

(A) Get disk information from a server called www1.cyberciti.biz:
$ ssh vivek@www1.cyberciti.biz df -h

(B) List what ports are open on remote host
$ ssh vivek@www1.cyberciti.biz netstat -vatn

(C) Reboot remote host:
$ ssh root@www1.cyberciti.biz reboot

(D) Restart mysql server (please note enclosed multiple command line arguments using a single or double quotes)
$ ssh root@www1.cyberciti.biz '/etc/init.d/mysql restart'

(E) Get memory information and store result/output to local file /tmp/memory.status:
$ ssh vivek@www1.cyberciti.biz 'free -m' > /tmp/memory.status

(G) You can also run multiple command or use the pipes, following command displays memory in format of “available memory = used + free memory” :
$ ssh vivek@debian.test.com free -m | grep "Mem:" | awk '{ print "Total memory (used+free): " $3 " + " $4 " = " $2 }'

See how to configure ssh for password less login using public key based authentication.

=> Related: shell script to get uptime, disk usage, cpu usage, RAM usage,system load,etc. from multiple Linux servers and output the information on a single server in a html format.