MODS: Queuing with Transmission BitTorrent Client

If you followed our previous article in adding a telnet utility to your Popcorn Hour C-200 and installed LTU 0.76, you also upgraded the Transmission torrent client in the process. The latest bittorrent client, Transmission 2.33, is packaged with the LTU 0.76. This is one of the strengths of having a custom package installed on the C-200. One thing to note though is that if you installed BusyBox 1.4.1 on the C-200, it conflicts with LTU 0.76. So better to uninstall BusyBox and retain LTU instead.

Having a telnet shell to the Popcorn Hour C-200 is very powerful. Here is a demonstration of how powerful and flexible having a shell access to the C-200 really is -- queuing with the transmission torrent client. The transmission bittorrent client doesn't have this feature by default, but that doesn't mean we can't do anything about it. Here's a script you can put on your C-200 that controls queuing of Transmission torrents.

#!/bin/sh

# *************
# Configuration
REMOTE="/nmt/apps/bin/transmission-remote"
USERNAME="nmt"
PASSWORD="1234"
MAXDOWN=2
MAXACTIVE=5
CONFIG="/share/.transmission/settings.json"

# *************
# Set-up variables
CMD="$REMOTE --auth $USERNAME:$PASSWORD"
MAXRATIO=$(cat $CONFIG | grep \"ratio-limit\":)
MAXRATIO=${MAXRATIO#*\"ratio-limit\": }
MAXRATIO=${MAXRATIO%*, }

# *************
# deal with downloads
DOWNACTIVE="$($CMD -l | tail -n +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 -n +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:)"
        $CMD --torrent $ID --stop >> /dev/null 2>&1
    done
else
    [ $(expr $MAXDOWN - $DOWNACTIVE) -gt 0 ] && (
    DOWNINACTIVE="$($CMD -l | tail -n +2 | grep -v 100% | grep Stopped | wc -l)"
    [ $DOWNINACTIVE -gt 0 ] && (
        DOWNTOSTART="$($CMD -l | tail -n +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:)"
            $CMD --torrent $ID --start >> /dev/null 2>&1
        done
        )
    )
fi
# Then deal with total active
ACTIVE="$($CMD -l | tail -n +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 -n +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:)"
        $CMD --torrent $ID --stop >> /dev/null 2>&1
    done
else
    [ $(expr $MAXACTIVE - $ACTIVE) -gt 0 ] && (
    SEEDINACTIVE="$($CMD -l | tail -n +2 | grep 100% | grep Stopped | awk -v ratio=$MAXRATIO '{ if (substr($0,52,4) < ratio) print $0 ;}' | wc -l)"
    [ $SEEDINACTIVE -gt 0 ] && (
        TOSTART="$($CMD -l | tail -n +2 | grep 100% | grep Stopped | awk -v ratio=$MAXRATIO '{ if (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:)"
            $CMD --torrent $ID --start >> /dev/null 2>&1
        done
        )
    )

On the above script, change the values for USERNAME, PASSWORD, MAXDOWN and MAXACTIVE. The script above contains the default values for the C-200. I tested the above script to work on my C-200. It will work on another 200 series Popcorn Hour too. A friend has tested it on his A-210 as well, and his feedback is good.

The script is working but how do you automate this? Linux just has the answer in cron. The script can be manually put in cron but the issue is, when the C-200 is rebooted, the entries get wiped out.

This is how to automate the queuing on the Transmission torrent client on the C-200. Edit the file /share/Apps/LTU/appinfo.json. Add the line:
crontab="*/5 * * * * /PATH/TO/torrent-queue.sh"

Verify that your crontab has entries above by rebooting the C-200 and check with "crontab -l". That's it folks, queuing working with the Transmission BT client. Now, imagine trying to do the same without shell access to your Popcorn Hour.

Credits: The original script was taken from http://pastie.org/632212. It was then adapted to work with the Popcorn Hour C-200.

Share:

MODS: Another Telnet Utility on the Popcorn Hour C-200

Previously we installed BusyBox on the Popcorn Hour C-200 (PCH-C200). Now we have telnet access to our network media jukebox (NMJ). Having shell access is important to make changes to the settings or create symbolic links, etc.

Just remember that this telnet access has absolute power (and absolute responsibility). In Linux/*nix, you're running as root or the super-user. And it can run anything, just like it can ruin everything.

BusyBox is a very useful tool. But the implementation on the PCH-C200 is very insecure. If you noticed, when you telnet to the box you are given a shell without having to type a password. Telnet is already insecure but this one pushes it off the charts.

A Russian by the name of Padavan developed an alternative telnet utility. He named this project Linux Terminal Utilities (or LTU). You can see more details of his project here -- translated via Google or the original Russian article. As of this writing the current version of his project is 0.76. And you may download the package from this link.

The package is a zip file that is CSI compatible. And this makes everything easy to install. Launch CSI and goto File > Install from File. Load the zip file and upload and install it on the C-200. Shutdown the C-200 via pressing the following in sequence -- Power > Delete. Once the power LED stops blinking, it is time to boot-up the unit via the Power button.



Once the C-200 has rebooted, telnet to it. And now it is a bit more secure as it will ask for a username and password. The default username and password are "root" and "1234". You may choose to change that default password once you have successfully logged in (the configuration is in /share/Apps/LTU/configure).


Packets transferred via telnet are still transmitted in clear text. So your password can be sniffed. You may choose to enable DropBear instead and access you C-200 via SSH this time. We will discuss that in the next article.

Share:

TIP: Config Baseline/Snapshot with WhatChanged

When something goes wrong or when you suspect that something is wrong, it is very difficult to pinpoint exactly what it is. Even for a seasoned system administrator, this situation can happen. Usually a scientific method followed for troubleshooting is in play but usually this method or procedure is very broad.

It is critical to establish a baseline or snapshot to compare with. And it is best to take a snapshot while the system is still healthy. One tool that can help in this is WhatChanged.

WhatChanged can take a list of files of your Windows drive and can also be configured to take a snapshot of every branch of the registry. If you suspect there is something wrong, or you got hit by a virus, compare the current state with the baseline previously taken with WhatChanged. This step can save you from a lot of time in troubleshooting what the probable cause can be. Whatever the purpose, whatchanged will list the files and registry entries that changed.

You can download WhatChanged from MajorGeeks.com or the author's website, vtaskstudio.com. It is amazing what a 96kb software can do.
WhatChanged is a system utility that scans for modified files and registry entries. It is useful for checking program installations. There are two steps for using WhatChanged:
1) First, take a snapshot to get the current state of the computer; 2) Second, run it again to check the differences since the previous snapshot.

Program interface look and feel is below.

Config Baseline/Snapshot with WhatChanged

To use it, just enumerate the drives you wish to monitor. It is recommended to put the drive where Windows is installed (usually C:). For multiple drives, just separate each drive letter with a space (e.g. C: D:). Then, tick the branches of the registry you wish to take a snapshot for baseline. For a thorough sample, tick all of the branches of the registry.

The software will then create files in the same path it resides. So make sure that the executable is stored in its own folder.

Config Baseline/Snapshot with WhatChanged

After taking a snapshot or baseline, you can backup the executable and the files it created to a USB drive or on another computer. If in the future you suspect something is wrong, just run whatchanged.exe and compare the results with the previous snapshot. More or less it should give you an idea where the problem lies or a clue where not to look (at the very least).

Share:

INFO: Intelligence Quotient (IQ) Linked to Browser Usage

Do you use Internet Explorer (or IE) in browsing the web? IE is to browsers as Windows is to the desktop. Although many would tend to disagree with that statement, it still stands as a fact. Surprisingly, browser usage is related to your intelligence quotient, or IQ.
A Vancouver based Psychometric Consulting company, AptiQuant, has released a report on a trial it conducted to measure the effects of cognitive ability on the choice of web browser. AptiQuant offered free online IQ tests to over a 100,000 people and then plotted the average IQ scores based on the browser on which the test was taken. And the results are really not that surprising. With just a look at the graphs in the report, it comes out pretty clear that Internet Explorer users scored lower than average on the IQ tests. Chrome, Firefox and Safari users had just a teeny bit higher than average IQ scores. And users of Camino, Opera and IE with Chrome Frame had exceptionally higher IQ levels.

Internet Explorer has traditionally been considered a pain in the back for web developers. Any IT company involved in web development will acknowledge the fact that millions of man hours are wasted each year to make otherwise perfectly functional websites work in Internet Explorer, because of its lack of compatibility with web standards. The continuous use of older versions of IE by millions of people around the world has often haunted web developers. This trend not only makes their job tougher, but has also pulled back innovation by at least a decade. But with the results of this study, IT companies worldwide will start to take a new look on the time and money they spend on supporting older browsers.

Microsoft created a conspiracy with Internet Explorer’s shell integration with Windows Explorer, and making its removal complicated, if not impossible. It is usually criticized that this move was made during the last moments of Windows 95 release in a haphazard manner, just to snub the competition from Netscape Navigator. In the following years Microsoft spent millions of dollars on Internet Explorer, with the aim to dominate the browser market. It succeeded to gain a huge share of over 95% for quite a few years. But recently open source browsers like Mozilla Firefox and Google Chrome have taken away a large share out of Microsoft’s pie. These browsers are not only better in performance than IE, but offer better compatibility with W3C standards.

This latest report about the intelligence levels of IE users is expected to create a storm. The company behind the study, AptiQuant is a psychometric consulting company, that offers online tools to other companies to better assess their existing/potential employees based on their mental aptitude, skills, motivation and performance. It also has self-serving tools for individuals looking to identify their skills and reach their potential.

(source: http://goo.gl/FbELp)

I never really thought that a simple computer software like the browser can relate to the intelligence quotient (IQ) of an individual. What do you think?

To view the full content of the report, you can download the Intelligence Quotient (IQ) and Browser Usage PDF file here.

IQ Linked to Browser Usage

IQ Linked to Browser Usage

(image source: http://www.aptiquant.com/IQ-Browser-AptiQuant-2011.pdf)

Share:

FAQ: Cannot Fork: No Swap Space

"There’s No Such Thing As A Silly Question" -- does the cliche sound familiar? In this part of pimp-my-rig reloaded, technical questions are answered. Mail them to me and I will post the answers here. If you have a better answer, by all means share it with us.

There are times when you run into uncharted territory, when you least expect it. A host was failing to execute commands, giving a no swap space error even though swap space was only 9% used. Commands fails to execute but work intermitently.

This happened on an IBM server running AIX 5.3.

All of our efforts to resolve this issue failed, so we called the vendor -- IBM. The error manifests itself as:

user@host# uptime 
ksh: cannot fork: no swap space 
user@host# lsps -s 
Total Paging Space   Percent Used 
4096MB               9% 


Here is a solution to the problem as provided from IBM. It is a known issue from APAR IY89941 fixed at 5.3 TL5 (bos.mp 5.3.0.53) and above. The root cause is that you are running out of 64K pages in the VMM and there is code bug when this type of scenario occurs.

The work around is to disable 64K page size support (until upgrade to higher levels of AIX). To disable run command:

root@host# vmo -r -o vmm_mpsize_support=0


This change is not dynamic. A reboot is required after making this change.

Share:

Subscribe for Latest Update

Popular Posts

Post Labels

100gb (1) acceleration (1) acrobat (1) adblock (1) advanced (1) ahci (1) airdrop (2) aix (14) angry birds (1) article (21) aster (1) audiodg.exe (1) automatic (2) autorun.inf (1) bartpe (1) battery (2) bigboss (1) binance (1) biometrics (1) bitcoin (3) blackberry (1) book (1) boot-repair (2) calendar (1) ccleaner (3) chrome (5) cloud (1) cluster (1) compatibility (3) CPAN (1) crypto (3) cydia (1) data (3) ddos (1) disable (1) discount (1) DLNA (1) dmidecode (1) dns (7) dracut (1) driver (1) error (10) esxi5 (2) excel (1) facebook (1) faq (36) faucet (1) firefox (17) firewall (2) flash (5) free (3) fun (1) gadgets (4) games (1) garmin (5) gmail (3) google (4) google+ (2) gps (5) grub (2) guide (1) hardware (6) how (1) how-to (45) huawei (1) icloud (1) info (4) iphone (7) IPMP (2) IPV6 (1) iscsi (1) jailbreak (1) java (3) kodi (1) linux (28) locate (1) lshw (1) luci (1) mafia wars (1) malware (1) mapsource (1) memory (2) mikrotik (5) missing (1) mods (10) mouse (1) multipath (1) multitasking (1) NAT (1) netapp (1) nouveau (1) nvidia (1) osmc (1) outlook (2) p2v (2) patch (1) performance (19) perl (1) philippines (1) php (1) pimp-my-rig (9) pldthomedsl (1) plugin (1) popcorn hour (10) power shell (1) process (1) proxy (2) pyspark (1) python (13) qos (1) raspberry pi (7) readyboost (2) reboot (2) recall (1) recovery mode (1) registry (2) rename (1) repository (1) rescue mode (1) review (15) right-click (1) RSS (2) s3cmd (1) salary (1) sanity check (1) security (15) sendmail (1) sickgear (3) software (10) solaris (17) squid (3) SSD (3) SSH (9) swap (1) tip (4) tips (42) top list (3) torrent (5) transmission (1) treewalk (2) tunnel (1) tweak (4) tweaks (41) ubuntu (4) udemy (6) unknown device (1) updates (12) upgrade (1) usb (12) utf8 (1) utility (2) V2V (1) virtual machine (4) VirtualBox (1) vmware (14) vsphere (1) wannacry (1) wifi (4) windows (54) winpe (2) xymon (1) yum (1) zombie (1)

RANDOM POSTS