Tag: Linux

Standard samba configuration

Ubuntu 9.10 – > 10.4 Samba configuration

No authentication required
4 read only shares
1 read and write

sudo gedit /etc/samba/smb.conf
[global]
workgroup = WORKGROUP
netbios name = DAVE-PC
security = share
wins support = yes
announce version = 5.0
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE
SO_RCVBUF=8192 SO_SNDBUF=8192
null passwords = true
username map = /etc/samba/smbusers
name resolve order = hosts wins bcast
syslog = 3
syslog only = yes
printing = cups
printcap name = cups
load printers = yes

[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
public = yes
guest ok = yes
writable = no
printable = yes

[Downloads]
comment = ReadWrite
path = /home/dave/Downloads
writable = Yes
guest only = Yes
guest ok = Yes
read only = no
public = yes
browsable = yes

[Films]
comment = ReadOnly
path = /media/films/Films
read only = Yes
guest only = Yes

[Series]
comment = ReadOnly
path = /media/series/Series
read only = Yes
guest only = Yes

[Documentaries]
comment = ReadOnly
path = /media/series/Documentaries
read only = Yes
guest only = Yes

[Mp3s]
comment = ReadOnly
path = /media/mp3s
read only = Yes
guest only = Yes


AIB Account status

PHP curl script to fetch your aib accounts (Compilments of Jon (kudos) Cremin)

updated to work with visa validation by me!

Linux users can display this infromation neetly on your desktop using such applications as http://conky.sourceforge.net

Screenshot

Code

regnumber = $regnumber;
		$this->challenge_phone = $challenge_phone;
		$this->challenge_visa = $challenge_visa;
		$this->challenge = "";
		$this->pac = str_split($pac);
		array_unshift($this->pac, null);
		$this->ch = curl_init();
		curl_setopt( $this->ch , CURLOPT_RETURNTRANSFER , 1 );
		curl_setopt( $this->ch , CURLOPT_SSL_VERIFYPEER , 0 );
		curl_setopt( $this->ch , CURLOPT_COOKIEFILE , ".cookiefile" );
		curl_setopt( $this->ch , CURLOPT_COOKIEJAR , ".cookiefile" );
		curl_setopt( $this->ch , CURLOPT_FOLLOWLOCATION , 1 );
		curl_setopt( $this->ch , CURLOPT_USERAGENT , "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-gb) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Safari/530.17" );
	}

	public function balances()
	{
		curl_setopt( $this->ch , CURLOPT_URL , "https://aibinternetbanking.aib.ie/inet/roi/login.htm" );
		$output = curl_exec( $this->ch );

		preg_match( '@id="transactionToken" value="(.*)"@' , $output , $token );

		curl_setopt( $this->ch , CURLOPT_POST , 1 );
		curl_setopt( $this->ch , CURLOPT_POSTFIELDS , "jsEnabled=TRUE&transactionToken=" . $token[1] . "®Number=".$this->regnumber."&_target1=true" );
		curl_setopt( $this->ch , CURLOPT_URL , "https://aibinternetbanking.aib.ie/inet/roi/login.htm" );
		$output = curl_exec( $this->ch );

		preg_match( '@id="transactionToken" value="(.*)"@' , $output, $token);
		preg_match( '@@' , $output , $pac1 );
		preg_match( '@@' , $output , $pac2 );
		preg_match( '@@' , $output , $pac3 );

		$this->challenge = preg_match( "/home phone number/" , $output ) > 0 ? $this->challenge_phone : $this->challenge_visa ;

		$postinfo = "_finish=true&transactionToken=" . $token[1];
		$postinfo .= "®Number=" . $this->regnumber;
		$postinfo .= "&pacDetails.pacDigit1=" . $this->pac{$pac1[1]};
		$postinfo .= "&pacDetails.pacDigit2=".$this->pac{$pac2[1]};
		$postinfo .= "&pacDetails.pacDigit3=" . $this->pac{$pac3[1]};
		$postinfo .= "&challengeDetails.challengeEntered=".$this->challenge;

		curl_setopt( $this->ch , CURLOPT_POST , 1 );
		curl_setopt( $this->ch , CURLOPT_POSTFIELDS , $postinfo );
		curl_setopt( $this->ch , CURLOPT_URL , "https://aibinternetbanking.aib.ie/inet/roi/login.htm" );
		$output = curl_exec( $this->ch );

		if( preg_match( "/continue to account overview/" , $output ) > 0 )
		{
			preg_match( '@id="transactionToken" value="(.*)"@' , $output , $token );
			curl_setopt( $this->ch , CURLOPT_POST , 1 );
			curl_setopt( $this->ch , CURLOPT_POSTFIELDS , "iBankFormSubmission=false&transactionToken=" . $token[1] );
			curl_setopt( $this->ch , CURLOPT_URL , "https://aibinternetbanking.aib.ie/inet/roi/accountoverview.htm" );
			$output = curl_exec( $this->ch );
		}

		$output = str_replace( "\n" , "" , $output );
		$output = str_replace( "\r" , "" , $output );		

		preg_match_all( '@expand(.*?)(.*?)@s', $output , $names );
		preg_match_all( '@

(.*?)

@s' , $output , $bal ); for( $i = 0; isset( $names[2][$i] ); $i++ ) { $accounts[] = array( "name" => $names[2][$i] , "balance" => str_replace( " " , "" , str_replace( " " , "" , $bal[1][$i] ) ) ); } return $accounts; } public function __destruct() { curl_close( $this->ch ); } } $regnumber = "88888888"; $challenge_phone = "4444"; $challenge_visa = "2222"; $pac = "77777"; $aib = new aib($regnumber, $challenge_phone, $challenge_visa, $pac); $accounts = $aib->balances(); foreach((array)$accounts as $account) { echo trim($account['name']) . "\${goto 150}" . trim($account['balance']) . "\n\n"; } ?>

Smart Broadband Usage Desktop application

This application is a GTK# smart broadband usage checker tray application.
It is entended to be a desktop interface for http://support.smarttelecom.ie/forums/smart_usage.

The program currently is a desktop tray application that checks your usage details and downloads the images associated with your broadband usage. For convient quick access

Download Smart Telecom broadband usage viewer

Requirements

Mono 2.4
Gtk Sharp

Screenshots


Zork

As part of my computer systems course we were required to write our own Zork project
Its a Linux C++ implementation, using Pthreads and a few other unix libraries!

Download ZorkTrek

install the following packages

sudo apt-get install build-essential libsdl-image1.2-dev libsdl-ttf2.0-dev libsdl-mixer1.2-dev
cd /source
sh make.sh

Game on!

Screenshots


Local Mini Python

This application is a port of my C# application called localmini.
It is entended to be a desktop interface for localhostr.com and minihref.com.

This is my first program in PyGTK.
The program currently is a desktop tray application that monitors urls in your clipboard and prompts you using dbus,
issuing the option of fetching a minihref from minihref.com.

Once fetched the minihref will be placed in your clipboard for usage in IM conversations, forums boards etc.
It Also uploads files to through the right click menu context on the tray icon
This upload option i hope to add to the nautaulis context menu also.

Just like the C# appliation it will soon have extended functionality of reading urls from firefox, uploading files and
screenshots to
localhostr.com, email link functions and hotkeys, hotcorner and other functionailty.
Basic functionality is there, preferences dialog is basically a shell, awaiting link up to the underlying classes.

Screenshots

Tray View

Dbus Link Notification

Dbus Fetch in progress Notification

Dbus minhref recieved Notification

Dbus upload to localhostr progress

Dbus upload to localhostr complete

Preferences Gui

Requirements

Any linux system with Gnome DE
Python
PyGtk >=2.0
Dbus
Curl
PyCurl

Download

Download Localmini Pygtk