Technically Tim

Technically Tim

For all my Technical Needs

Technically Tim RSS Feed
 
 
 
 

Blog Archived

This Blog is no longer actively maintained. I am now blogging all this stuff at http://tim.purewhite.id.au/. If there are any key articles that people wish to be updated and moved to the new site please contact me and I’ll look at doing an update. This site is only here for archival purposes now.
Thank you for reading my articles and I hope you can find the information you are looking for at my new blog.

JetIB Login Tool v0.4

Next version of JetIB Login Tool
More changes. It now supports libnotify if installed.

Also, moved into SVN repository, guest access is below.

https://guest:guests@svn.labyrinthdata.net.au/jetiblogin/trunk/jetib.sh

JetIB Login Tool v0.2

Second version of JetIB script.

#!/bin/sh
#
# Jetib Login Tool (v0.2)
# 
# Author: Timothy White http://weirdo.bur.st/
# 
# This script will log you in to a jetib (Jet Internet Billing) system
#
#
# It will first attempt to load your credentials from .jetibcreds
# If this file doesn't exist, it will fall back to asking for your
# credentials first via zenity, and if zenity isn't installed then via
# normal shell input
#
# curl must be installed and in your path for this tool to work

#### Changelog
#
#   0.2
#    * Fix up string handling and screen scraping of status text
#    * Make Ctrl-C handling look cleaner
#
#   0.1 
#    * Initial Release
#
#
#
#


# Curtin University settings are as follows
#DOMAIN="jetib.curtin.edu.au"
#LOGIN_PAGE="/curtin/portal/login"
#STATUS_PAGE="/curtin/portal/popup_text_refresh"
#OGOFF_PAGE="/curtin/portal/logout"

DOMAIN="jetib.curtin.edu.au"
LOGIN_PAGE="/curtin/portal/login"
STATUS_PAGE="/curtin/portal/popup_text_refresh"
LOGOFF_PAGE="/curtin/portal/logout"

# .jetibcreds file in users home directory
# containing login credentials in the format of
# username:password
JETLOGIN="$HOME/.jetibcreds"

# User agent to pretend to be (just incase they block scripts, pretend to be a browser)
USER_AGENT="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.1 (.NET CLR 3.5.30729)"

# Find location of curl and zenity
CURL=$(which curl)
ZENITY=$(which zenity)


# Catch ctrl_c requests and logout and cleanup
ctrl_c() {
    stty echo # Turn TTY echo back ON!
    # (Maybe we caught Ctrl-c when they were supposed to be entering password)
    echo ""
    echo "Logging you off..."
    # Send logoff request
    curl -s https://$DOMAIN$LOGOFF_PAGE -c cookies.txt -b cookies.txt |grep "

"|sed -e :a -e 's/<[^<]*>/ /g;/.*'|grep -o '[0-9]*') quota=$(echo "$status_text" | grep -i quota|egrep -o ':[^<]*' |grep -o '[0-9.]*') thismonth=$(echo "$status_text" | grep -i "this month"|grep -o '[^<]*'|grep 'this'|grep -o '[0-9.]*') thismonth=${thismonth#*:} # Strip everything before : thismonth=${thismonth#"${thismonth%%[! ]*}"} # Strip White Space thissession=$(echo "$status_text" | grep -i "this session"|grep -o '[^<]*'|grep 'this'|grep -o '[0-9.]*') thissession=${thissession#*:} # Strip everything before : thissession=${thissession#"${thissession%%[! ]*}"} # Strip White Space # Display status page clear echo "Logged in as: $loggedinas" echo "Quota Remaining: $remaining MB" echo "Monthly Quota: $quota MB" echo "Used this month: $thismonth MB" echo "Used this session: $thissession MB" echo "" echo "Press Ctrl-C to disconnect" } if [ -x "$CURL" ] then if [ -r "$JETLOGIN" ] then # .jetibcreds file in users home directory # containing login credentials in the format of # username:password creds=$(cat $JETLOGIN) USERNAME=${creds%%:*} PASSWORD=${creds#*:} else # Credentials not saved, ask for them if [ -x "$ZENITY" ] then # Use Zenity to ask for credentials USERNAME=$(zenity --entry --title="Internet Login" --text="Username") PASSWORD=$(zenity --entry --title="Internet Login" --text="Password" --hide-text) else # Zenity not installed, falling back to shell to ask for credentials echo -n "Username: " read USERNAME echo "" echo -n "Password: " # trap ctrl-c and call ctrl_c() trap ctrl_c INT stty -echo # Turn off TTY echo so password is hidden read PASSWORD stty echo # Turn TTY echo back ON! echo "" # force a carriage return to be output fi fi # Submit login request to server (No error checking yet) echo "Attempting to log you into the JetIB server..." curl -s -A "$USER_AGENT" -F "targeturl=''" -F "submit=Logon" -F "username=$USERNAME" -F "password=$PASSWORD" -c cookies.txt https://$DOMAIN$LOGIN_PAGE > /dev/null echo "Verifying login..." # trap ctrl-c and call ctrl_c() trap ctrl_c INT stty -echo # Turn off TTY echo while true do # Loop updating status page every minute until Ctrl-C is pressed status_page ; sleep 1m done else echo "This Jetib login tool requires curl to be installed and in the PATH"; fi

Jetib (Jet Internet Billing system) Login Client for *nix

A simple script to login to the JetIB (Jet Internet Billing system) without using a web browser. For example, if you just want to ssh or run a backup job, or for example you are logged into a machine without a graphical browser.

Some of the organisations that may use the JetIB system are:

  • Curtin University (Bentley Campus)
  • James Cook University
  • UNSW (University of New South Wales) – ADFA (Australian Defence Force Academy) (Canberra)

You will need to modify the script for each location.

It should run on just about any Linux/Unix/BSD system that has a POSIX shell, and curl installed. It should run on a OS X Mac as well.
If you have zenity installed, it’ll use that to ask for your credentials, otherwise it’ll just ask for them in the terminal. If your credentials are stored in a .jetibcreds file in your home directory it will use them instead. (Format of username:password)

Once connected, it’ll loop around updating your shell display with the terminal of your session (this should also perform as a keep alive for your session), pressing ctrl-c will exit that loop and log you out, and clean up the session cookie.

Edit: New version available at http://weirdo.bur.st/2009/09/09/jetib-login-tool-v0-2/

#!/bin/sh
#
# Jetib Login Tool (v0.1)
# 
# Author: Timothy White http://weirdo.bur.st/
# 
# This script will log you in to a jetib (Jet Internet Billing) system
#
#
# It will first attempt to load your credentials from .jetibcreds
# If this file doesn't exist, it will fall back to asking for your
# credentials first via zenity, and if zenity isn't installed then via
# normal shell input
#
# curl must be installed and in your path for this tool to work

# Curtin University settings are as follows
#DOMAIN="jetib.curtin.edu.au"
#LOGIN_PAGE="/curtin/portal/login"
#STATUS_PAGE="/curtin/portal/popup_text_refresh"
#OGOFF_PAGE="/curtin/portal/logout"

DOMAIN="jetib.curtin.edu.au"
LOGIN_PAGE="/curtin/portal/login"
STATUS_PAGE="/curtin/portal/popup_text_refresh"
LOGOFF_PAGE="/curtin/portal/logout"

# .jetibcreds file in users home directory
# containing login credentials in the format of
# username:password
JETLOGIN="$HOME/.jetibcreds"

# User agent to pretend to be (just incase they block scripts, pretend to be a browser)
USER_AGENT="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.1 (.NET CLR 3.5.30729)"

# Find location of curl and zenity
CURL=$(which curl)
ZENITY=$(which zenity)


# Catch ctrl_c requests and logout and cleanup
ctrl_c() {
    stty echo # Turn TTY echo back ON!
    # (Maybe we caught Ctrl-c when they were supposed to be entering password)
    echo ""
    echo "Logging you off..."
    # Send logoff request
    curl -s https://$DOMAIN$LOGOFF_PAGE -c cookies.txt -b cookies.txt |grep "

" # Clear cookies file rm cookies.txt exit 0 } status_page() { # Get status page text status_text=$(curl -s https://$DOMAIN$STATUS_PAGE -c cookies.txt -b cookies.txt) # Process status page text remaining=$(echo "$status_text" | grep remaining) loggedinas=$(echo "$status_text" | grep "logged in as"|egrep -o '.*'|grep -o '[0-9]*') quota=$(echo "$status_text" | grep -i quota|egrep -o ':[^<]*' ) thismonth=$(echo "$status_text" | grep -i "this month"|grep -o '[^<]*'|grep 'this') thissession=$(echo "$status_text" | grep -i "this session"|grep -o '[^<]*'|grep 'this') # Display status page clear echo "$remaining" echo "Logged in as: $loggedinas" echo "Monthly Quota$quota" echo "$thismonth" echo "$thissession" echo "" echo "Press Ctrl-C to disconnect" } if [ -x "$CURL" ] then if [ -r "$JETLOGIN" ] then # .jetibcreds file in users home directory # containing login credentials in the format of # username:password creds=$(cat $JETLOGIN) USERNAME=${creds%%:*} PASSWORD=${creds#*:} else # Credentials not saved, ask for them if [ -x "$ZENITY" ] then # Use Zenity to ask for credentials USERNAME=$(zenity --entry --title="Internet Login" --text="Username") PASSWORD=$(zenity --entry --title="Internet Login" --text="Password" --hide-text) else # Zenity not installed, falling back to shell to ask for credentials echo -n "Username: " read USERNAME echo "" echo -n "Password: " # trap ctrl-c and call ctrl_c() trap ctrl_c INT stty -echo # Turn off TTY echo so password is hidden read PASSWORD stty echo # Turn TTY echo back ON! echo "" # force a carriage return to be output fi fi # Submit login request to server (No error checking yet) curl -s -A "$USER_AGENT" -F "targeturl=''" -F "submit=Logon" -F "username=$USERNAME" -F "password=$PASSWORD" -c cookies.txt https://$DOMAIN$LOGIN_PAGE > /dev/null # trap ctrl-c and call ctrl_c() trap ctrl_c INT while true do # Loop updating status page every minute until Ctrl-C is pressed status_page ; sleep 1m done else echo "This Jetib login tool requires curl to be installed and in the PATH"; fi

Convert HT8200 into HT8000

For any of you unlucky buyers out their that have purchased an HT8200 thinking that it was an HT8000, or that it would actually let you take your recorded files off that device and skip adds, here is how you can make it work.

The Homecast HT8000 and HT8200 are essentially identical devices, with the difference of a “Freeview” (or a, we’ll restrict your view) sticker and some slightly different hardware. Thankfully, you can convert the HT8200 back into a HT8000 with a firmware “update”. The rest of what appears below isn’t my work, and is easily found at http://members.optusnet.com.au/nis200sx/ and remains the work of that person. I am placing a copy of it here, not to try and take credit from him, but rather to preserve the information (and methods) in the event that it is removed for some reason. I may also attempt to expand on his Method 2 and 3 at a later stage.

Oh, and before you try, the .TP0 files you have recorded on the HT8200 are useless unless you watch them on the HT8200 (with the freeview sucky firmware).

Loading HT8000 Firmware onto a HT8200


Question:

  • Why would anyone want to load HT8000 firmware (software) onto their HT8200 PVR?

Answer:

  • The benefits are easier file navigation (30sec and percentage jump buttons work)

  • Plus the recordings are not encrypted (and the USB type B port works for transferring to/from a Windows PC) so they can be played on a PC and converted to DVDs etc.

Question:

  • What am I losing by doing this?

Answer:

  • The downside is that any recordings already done with HT8200 firmware will no longer be playable.

Question:

  • How do I do it?

Answer:

  • There are 3 ways to get a HT8200 to accept HT8000 firmware. Below I will outline the 3 methods, from easiest to hardest. Note: The hardest method is the best method (I’ll explain why below).

Method 1 – Easiest

Download a copy of the HT8000 firmware that has already had the Model ID number changed to match the HT8200.

The benefit of this method is that it is extremely easy and you do not need any special skills or understanding of what’s being done. The downside is that you are reliant on me, or someone else, providing you access to a suitable firmware file any time Homecast release a newer version (assuming you want to keep the firmware up to date).

This firmware file will load on a HT8200 and turn it into a HT8000: Download 8200-to-8000-1048.zip (Mirror Download 8200-to-8000-1048.zip) Well, it will still say that it is a HT8200, with SW version 1.00.9A, but it will actually be running HT8000 SW version 1.04.8A.

After updating to this file you can still update to a normal HT8200 firmware file in future (the PVR still thinks it’s a HT8200). If you want to update to a newer HT8000 version (when the next one is released) you will need download the latest 8200-to-8000 zip file from this web-site. Each time a new HT8000 version is released I will try to put a new 8200-to-8000 file online.

Method 2 – Medium (not finished)

Download a copy of the HT8000 firmware and use a hex editor to change the Model ID number yourself.

The benefit of this method is that you are not reliant on anyone else doing the editing for you, so it is easier to keep the firmware up to date.

I will update this page soon to explain how…

Method 3 – Harder (not finished)

Download a copy of softwareclean.bin and upload it to your HT8200 using Homecast’s Upgrade application and a null-modem serial cable.

The benefit of this method is that it only needs be done once. After loading softwareclean.bin your HT8200 won’t know what it is until you then load some firmware onto it. At this point you can load ANY firmware onto – Be CAREFUL!!! After loading a regular, unedited, HT8000 firmware onto your HT8200 from then on it will think that it is a HT8000, so when HT8000 updates are released in future you can just update using the regular HT8000 firmware from the Homecast website.

I will update this page soon to explain how…

(Mirror Download SoftwareClean.bin)

Categories

Archives

Tags