View Battlefield 3 Statistics on Mobile Web

Battlefield 3 (BF3) is a first-person shooter video game developed by EA Digital Illusions CE (DICE) and published by Electronic Arts (EA). Released for PC, PS3 and XBOX 360, the game is the next installment for the Battlefield franchise. The game features Campaign, Cooperative and Multiplayer game modes, check for more info.

Battlefield 3 Stats on Mobile Web
For those who are familiar with Battlefield series, the multiplayer mode of Battlefield 3 is among the best in it’s class. But it can get a bit expensive and with the recent diablo 2 items for sale, I was able to buy and explore the game for the better.  In terms of gameplay mechanics, the multiplayer mode is more focused on teamwork rather than opponent kills. Battlefield 3 introduces Battlelog where players can view their game statistics.

Now the game statistics are also available through your mobile web browser, via View your upcoming weapon unlocks, upcoming medals, and other stats.

Enjoy your gaming session. Hooah!

View your Battlefield 3 Stats on Mobile Web.

Like to win Battlefield 3, but tired of keep losing your battles? What do you think it is that makes the best players so good? Click Here to get Battlefield 3 strategy guide.
Limited time offer!! The only guide that comes with HD videos.

Don’t forget to check the pro-skins boosting options for all your favorite games.

How to Stream Movies to your iPhone or iPad

I have just found a way to successfully stream movies (avi, mkv, mp4, etc) to my iPhone. It’s via an app called AirPlayer.

First, set up a media server on your home network (for example, PS3 Media Server, like what I have explained in my previous post, “How To Share Media Between PlayStation 3 and Linux”). Then, just access your movies through the AirPlayer app. Everything just works, without much setting or config changes.

Create Your Own Web App to Execute Linux Command

Let say you need to run a command (which you use frequently) on your headless Linux box, such as, copying files, start/stop services, reboot, etc. However too lazy to go to the physical machine or open a ssh command from another pc.
Would it be nice if we have a web application that can easily be accessed through a web browser (even from a mobile web browser), to execute those commands. All we have to to is type the url (http://my-server-ip-address:myportnumber), and click on a link.
All these could easily be achieved using very simple service using Python.

1. Create a simple Python script. The Python script will be using WSGI to serve HTTP request/response.


2. A sample of the Python script below:

import os
from cgi import parse_qs, escape

def hello_world(environ, start_response):
    parameters = parse_qs(environ.get('QUERY_STRING', ''))
    if 'type' in parameters:
        mycommand = escape(parameters['command'][0])
        mycommand = ''
    start_response('200 OK', [('Content-Type', 'text/html')])

    if mycommand == 'copyfile1':
	#your linux command here. Example below
	os.system('cp myfile1.txt mynewfile.txt')
    elif mycommand == 'copyfile2':
	os.system('cp myfile2.txt mynewfile.txt')

    return ['''Command to execute:  %(mycommand)s 
    <a href='?command=copyfile1'>Copy file 1</a>
    <a href='?command=copyfile2'>Copy file 2</a>
    ''' % {'mycommand': mycommand}]

if __name__ == '__main__':
    from wsgiref.simple_server import make_server
    #put your own server ip address and port here
    srv = make_server('',81, hello_world)

3. Make the Python script run on every startup. Create a bash script for this:
vi myserver

4. Here’s the script for the bash file:

#! /bin/sh
# /etc/init.d/myserver

# Carry out specific functions when asked to by the system
case "$1" in
    echo "Starting myserver "
    python /home/username/
    echo "[OK]"
    echo "Stopping myserver "
    kill -9 `pidof python`
    echo "[OK]"
    echo "Usage: /etc/init.d/myserver {start|stop}"
    exit 1

exit 0

5. make the bash script executable.
chmod +x myserver

6. copy myserver script to /etc/init.d
sudo cp /wherever/you/saved/myserver /etc/init.d/myserver

7. update the startup folders to include the new script.
sudo update-rc.d myserver defaults

8. To test your Python web app, open a web browser, and type:

How to Queue Torrents in Transmission

Currently there’s no queue features in Transmission. Luckily we can improvise this with the help of transmission-remote, a command based client for transmission, and along with some Linux bash scripting.

Below I have created a simple bash script:

1. Install transmission remote:
sudo apt-get install transmission-cli

2. Copy the script below, and save as , (or whatever name you prefer, but note the .sh extension).

# *************
# Configuration
# *************
# Set-up variables
LOGCMD="/usr/bin/logger -t transmission-queue "
MAXRATIO=$(cat $CONFIG | grep \"ratio-limit\":)
MAXRATIO=${MAXRATIO#*\"ratio-limit\": }
# *************
# deal with downloads
DOWNACTIVE="$($CMD -l | tail --lines=+2 | grep -v 100% | grep -v Sum | grep -v Stopped | grep -v Verifying | grep -v Will\ Verify | wc -l)"
if [ $MAXDOWN -lt $DOWNACTIVE ]; then
    DOWNTOSTOP="$($CMD -l | tail --lines=+2 | grep -v 100% | grep -v Sum | grep -v Stopped | grep -v Verifying | grep -v Will\ Verify | tail -n $(expr $DOWNACTIVE - $MAXDOWN) | awk '{ print $1; }')"
    for ID in $DOWNTOSTOP; do
        NAME="$($CMD --torrent $ID --info | grep Name:)"
        $LOGCMD "< << $ID: ${NAME#*Name: }"
        $CMD --torrent $ID --stop >> /dev/null 2>&1
    [ $(expr $MAXDOWN - $DOWNACTIVE) -gt 0 ] && (
    DOWNINACTIVE="$($CMD -l | tail --lines=+2 | grep -v 100% | grep Stopped | wc -l)"
    [ $DOWNINACTIVE -gt 0 ] && (
        DOWNTOSTART="$($CMD -l | tail --lines=+2 | grep -v 100% | grep Stopped | head -n $(expr $MAXDOWN - $DOWNACTIVE) | awk '{ print $1; }')"
        for ID in $DOWNTOSTART; do
            NAME="$($CMD --torrent $ID --info | grep Name:)"
            $LOGCMD ">>> $ID: ${NAME#*Name: }"
            $CMD --torrent $ID --start >> /dev/null 2>&1
# Then deal with total active
ACTIVE="$($CMD -l | tail --lines=+2 | grep -v Sum | grep -v Stopped | grep -v Verifying | grep -v Will\ Verify | wc -l)"
if [ $MAXACTIVE -lt $ACTIVE ]; then
    TOSTOP="$($CMD -l | tail --lines=+2 | grep 100% | grep -v Stopped | grep -v Verifying | grep -v Will\ Verify | tail -n $(expr $ACTIVE - $MAXACTIVE) | awk '{ print $1; }')"
    for ID in $TOSTOP; do
        NAME="$($CMD --torrent $ID --info | grep Name:)"
        $LOGCMD "< << $ID: ${NAME#*Name: }"
        $CMD --torrent $ID --stop >> /dev/null 2>&1
    [ $(expr $MAXACTIVE - $ACTIVE) -gt 0 ] && (
    SEEDINACTIVE="$($CMD -l | tail --lines=+2 | grep 100% | grep Stopped | awk -v ratio=$MAXRATIO '{ if (strtonum(substr($0,52,4)) < ratio) print $0 ;}' | wc -l)"
    [ $SEEDINACTIVE -gt 0 ] && (
        TOSTART="$($CMD -l | tail --lines=+2 | grep 100% | grep Stopped | awk -v ratio=$MAXRATIO '{ if (strtonum(substr($0,52,4)) < ratio) print $0 ;}' | head -n $(expr $MAXACTIVE - $ACTIVE) | awk '{ print $1; }')"
        for ID in $TOSTART; do
            NAME="$($CMD --torrent $ID --info | grep Name:)"
            $LOGCMD ">>> $ID: ${NAME#*Name: }"
            $CMD --torrent $ID --start >> /dev/null 2>&1

Save the script on any location you prefer.

3. Create a cron job to run the script. Open the entry to crontab:
crontab -e

4. Let say you want to run the script 5 minutes, the entry on your cron job should be as below:
*/5 * * * * sh /location_to_my_script/

Script courtesy of

How To Share Media Between PlayStation 3 and Linux

A while ago I have posted on How To Share Media Between XBOX 360 and Linux. It also can be as easy with PlayStation 3 and Linux, with PS3 Media Server. Below are the steps that diablo 2 items suggests which can let you achieve that.

Install necessary codex or media player:
sudo apt-get install vlc ffmpeg mencoder mplayer

Install Sun Java:
sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts

Download PS3 Media Server. Then extract the downloaded tar to any location:
tar xzf pms-generic-linux-unix-1.20.412.tgz

Go to the folder that you have just extracted:
cd pms-linux-1.20.412/

Run the PS3 Media Server simply by:
Command above will open the PlayStation 3 Media Server user interface.

Movie Subtitles on Ubuntu 10.10
The yesgamers is the d2 store points out that the subtitle broke for Ubuntu 10.10. This is due to Mplayer needs to know the location of a TrueType Font to show movie subtitles. Command below will fix it:
sudo apt-get install ttf-bitstream-vera

ln -sv /usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf ~/.mplayer/subfont.ttf

Disable ASS/SSA subtitles:
1. Go to PS3 Media Server user interface. Go to “Transcoding Settings” tab.
2. Uncheck ASS/SSA subtitles checkbox.