Tuesday, January 18, 2011

Connect to console sessions using Remote Desktop Connection on the Mac

Found this today, and its very useful indeeed.  I missed the ability to connect to the console session of a Winblows box from the mac version of RDC.  However, it can be done.

Save your session to file.

Edit the file

Add the line:

connect to console:i:1

Open that saved session and connect.

Monday, August 30, 2010

Numark iDJ2 Track Rating Tool

I found it a bit annoying that all my hard work rating tracks in iTunes seemed to be wasted when playing said tracks from my iDJ2.  Yeah OK, I could setup playlists like "Rated 3 or More" and they would be available on the iDJ, but I really wanted the ratings to be visible on the iDJ2 when browsing.

I have written a simple piece of software to tackle this. Here is a shot of the iDJ2 console after running the software:

Tracks on the iDJ2 after running iDJTools.exe


As you can see, having your rating for each track makes browsing and choosing on the iDJ2 much easier.

Download iDJTools here.

iDJTools was written using Mono and requires the Mono SQLite client libraries.  Unless you know better, it is probably best to just install the latest version of Mono for your OS from here.

To use iDJTools:
  • Rate your tracks in iTunes
  • Run Numark Librarian
  • Open a console
  • cd to the location of iDJTools.exe
  • Type iDJTools.exe -i path to you iTunes Music Library.xml file -d path to your iDJ2 datbase file
  • Press return
For example:

> cd c:\documents and settings\bob\Desktop\iDJToools
> iDJTools.exe -i "c:\documents and settings\bob\Music\iTunes\iTunes Music Library.xml" -d "i:\.library\database"

By default the rating is added to the end of the track name, if you prefer the rating to be prepended (as in the screen shot) just add a -p to your command line, as so:

> iDJTools.exe -i "c:\documents and settings\bob\Music\iTunes\iTunes Music Library.xml" -d "i:\.library\database" -p

Please feel free to comment on this post suggesting other useful functions iDJ2 could perform.

I will probably come up with a nice Windowsy GUI at some point.

iDJTools was written in Mono on the Mac, it should work on Mac, Windows and indeed Linux.

I should of course point out that neither myself or this software are affiliated with Numark. Numark do not endorse it in any way and any damage caused by using it is your own fault and nobody else can be blamed.  Bla bla...

Thursday, May 06, 2010

iPad and iPhone Jailbreak

Last night I decided to jailbreak both my new iPad and my iPhone. The process was very simple indeed using the Spirit Jailbreak from www.spiritjb.com. I made sure both devices were fully backed up and synced with iTunes, connected them and simply ran the software.

Spirit is an untethered jailbreak, meaning you don't have to run it
every time you boot your device.

My primary reason for jailbreaking is so that I can try out the "MyWi" app from the Rock store. This enables you to turn your iPhone into a mobile WiFi hotspot, allowing you to get data on your WiFi iPad practically anywhere. Strictly I did not need to jailbreak the iPad to use this, but the prospect of running multiple applications using "Backgrounder" was enough to persuade me!

Wednesday, May 05, 2010

Uk iPad user - First Impressions

Its here! Finally!

So I couldn't wait until Apple decided to grace us with the ipads presence and instead decided to get one early off bay. So I might have paid over the odds, but who knows? Apple may decide it's worth one squillion pounds to us UK'ers...

I opted for the 32gb wifi only version as there are loads of ways of getting online without the 3G version. The jailbroken iphone app MyWi to name just one... Who needs another data plan!?

First impressions are that it feels like a quality piece of kit... Not too heavy, but not so light that it came out of a kinder egg. Size wise, go look it up, but its not quite as big as a piece of A4.

When you turn it on for the first time you will need to pug it into an updated version of iTunes. Then the usual setting of sync options and away you go.

The first thing I did was to set up push with gmail, just like on my iPhone. The mail application is great! 2 diffent display layouts depending on the orientation you choose. In fact this is the same for most ipad apps, hold it one way you get one view, another and you get a different view.

If you are an iPhone user, you need no introduction to the iPad and will be buzzing around in no time. The interface is really simple and very intuitive.

Typing on the screen's keyboard is really very good. So good in fact that I'm writing this on it. Landscape mode of course.

The absolute winner for the iPad so far for me is the Internet browsing... Google already seem to have skinned their apps for the iPad, so gmail in a browser looks awesome. The pad feels so natural in your hands and having the web right there in all it's glory is indeed very good.

Sound quality for the built in speaker is surprisingly good, and certainly better than the iPhone.

Google maps is kind fun, almost as big as an old fashioned a-z! The location services (not gps) had me pinned in seconds.

iTunes is a real treat! If you are addicted to spending loads of 79ps on your iPhone then this device could seriously ruin your credit rating!

iPhone apps on the ipad are kinda weird as they are so small. Apple have given us a 2x button to scale it up, but that looks wierd too... Soon enough though there will be native ipad versions of pretty much everything anyway.

Bad points: no built in camera... WTF!!??

One thing I'm really looking forward to as an amateur photographer is getting my hands on the camera connection kit. Shoot on the slr and review on the iPad. That's gonna be great!

So I guess the big question is "will it replace my netbook?". So long as I can get decent native remote desktop and ssh apps then I honestly cannot see why not.

I'm probably gonna be jail breaking this puppy soon, so I'll let you all know how that goes...

Friday, March 19, 2010

Agile Practices

I really enjoyed reading this agile white paper outlining the ins and outs of Iteration planning Iteration Planning Guide

Wednesday, December 16, 2009

Mindless Regurgitation

It really gets my back up reading other peoples blogs where all they they do is regurgitate other peoples thoughts or research. Too may people seem to think that if they post up someone else's 'musings', add a few (normally irrelevant) thoughts along the way (perhaps add a few pictures of some technical looking books as well) that it will somehow make them look intellectual. It does not. Go away, understand your topic and come up with something for yourself.

Sorry about the rant, now, off to check my old postings to make sure I'm not being hypocritical!

Tuesday, December 15, 2009

Blackra1n 3.1.2 05.11.07

Assuming you are on baseband 05.11.07 and 3.1.2 you can use blackra1n to jailbreak.

HOWEVER

You will need to use blackra1n to boot your blower _every_ time.... Not a problem if you never run out of battery, or always have a pc with you.

You can always use iTunes to restore if you get annoyed with all of this, so as long as you are all backed up, no problemo.

You will need:
1 x blackra1n
1 x iPhone
1 x Mac (Intel)

Goto http://blackra1n.com, download the mac version.

--- THIS IS THE BOOT PROCESS YOU HAVE TO FOLLOW EVERY TIME ---
Make sure iTunes & iTunes helper are NOT running:
Properly close iTunes(right click, quit), then open a terminal and type:
ps -A | grep iTunes
You will see the id of the process running iTunes helper (1st col). Type:
kill 186
Where 186 is the process ID
Then, plug in your iphone, run blackra1n and press "Make it ra1n"
Your phone will reboot and a lovely piccy will show up
Done!
--- END OF BOOT PROCESS ---

You then have blackra1n as an app, use this to install Cydia (the unofficial app store)

Thanks goes to Geohot

Monday, December 07, 2009

Ubuntu users get 2gb free online storage

Users of Ubuntu > 9.04 get 2gb of free online storage with "Ubuntu One". Ubuntu One comes pre-integrated with version 9.10 and seamlessly mirrors a local folder of all authorised machines with the users online storage. You can also get a paid upgrade to 50gb. Access is via mirrored folder when in Ubuntu, but files can also be uploaded / downloaded using a web client. Read more here.

Thursday, October 01, 2009

Install XP on a Dell Inspiron 1545

To install Windows XP on a Dell Inspiron 1545 you need to switch the machine to use ATA instead of AHCI under System Configuration > Sata Operation in the BIOS. Press F2 at startup to enter the BIOS settings screen.

Friday, July 17, 2009

Homeward Bound

Thursday, our last day. We are pretty gutted really, as we have had a FANTASTIC time out here. New York is a hell of a place. The people are so friendly and the whole place has an amazing energy and buzz. Contrary to popular belief, Manhattan is now a safe place. I would not and did not have any trouble wandering around at night after dark in places that we were not familiar with. The police presence here is very impressive. Literally wherever you look there is either a police car, a couple of cops on the beat or a mounted police man.

Having said all of this, nowhere have I seen a starker contrast between the people who have, and the people who do not. The classic New York "Bum" unfortunately does still exist and there are all too many people sleeping on park benches and eating out of bins. On the other side of the street, millionaires are being helped out of their chauffeur driven limo and ushered into their 5 star hotel. In a city with 8.5 million residents its not surprising that you can be shoulder to shoulder with people from ALL walks of life in the space of one city block.

We managed to arrange a car back to JFK and when we arrived we were pleasantly surprised to be give a free upgrade on our flights! :) We left JFK at 18:00 and arrived in Gatwick at 05:00. Apparently the trick is to now stay up until a reasonable bed-time tonight. That could be rather tricky :(

Wednesday

We took the tube up to Midtown and walked down Madison Avenue to find a place for lunch. We had a chicken Fajita "Pressata" in a place called Europe cafe. Definitely worth trying if you get the chance.

After lunch we walked about the West Village / Greenwich Village which is very different to the central parts of Manhattan, very much the residential part of the city, and quite picturesque. We stopped in at an old wooden floored bar called the "White Horse" on Bank Street for a drink, and then wandered down the hudson river back to the hotel.



In the evening we discovered the south harbor on the lower east side where we stopped at a really nice seafood restaurant for dinner. After dinner we took a 30 minute night cruise out to the statue of liberty and back again. the views of the statue at night are amazing. Not to mention the classic Manhattan night skyline and Brooklyn Bridge.

Wednesday, July 15, 2009

Views n' Booze

We took a walk along the rivers edge down town last night and got some fantastic views of the sunset over New Jersey. We also saw Fire Flies, which were cool!




After our walk we headed up to the club for some free beers, of course after a few free ones the club shut so we went downstairs to the hotel bar. After drinking free beer upstairs, paying $18 for 2 beers, and then another $16 for a Makers Mark stung the wallet somewhat! We got chatting to a local guy about the baseball on the TV and decided we wanted more "local banter" so headed off to a local bar in seek of more conversation at more reasonable prices. We stumbled into a local Irish Pub called "The Dubliner" after a while we got chatting to the bar maid and her boyfriend - Loren and Chuck. Great people who were only too pleased to give us tips on where to go and what to see. We were also joined by another guy called Anthony. We all had a great time chatting and swigging, so today Anne and I have been rather green :(

After a long lie in today, we took a half-hearted walk about the park (we had our portraits done!) before heading back uptown. We had dinner in an Italian, which was rubbish, and then wandered into Central Park again in search of some sunsets... To our suprise (well, kind of) we soon learned that the NY Philharmonic Orchestra was playing. The park was heaving, people jammed in shoulder to shoulder on the "Great Lawn" and surrounding areas. We tried to find a place to sit and listen, but in the end we opted to escape to the west side and jump on the subway back to the hotel.

Monday, July 13, 2009

Monday Night

Had a good walk about town and hit Central Park again. We had a few slices of real American Pizza!

Too tired to blog a lot now, however, here are some more photos of our trip so far to keep you entertained!






Sunny Sunday

What a scorcher it has been today! 28 to be precise...

Today we traveled over to Staten Island using the free 24 hour ferry. The views of the Statue of Liberty from the boat are amazing. The crossing takes 25 minutes, and is a really nice way to see the harbor and Manhattan skyline.



During the wander back to the hotel through Battery Park we stumbled upon a street show, which was brilliant.



We then headed back up to Central Park via the subway and on to the Boat House to grab a bite to eat. The Boat House is surrounded by some really great outdoor musicians, and waiting in the queue to hire a row boat was almost a treat!



We love central park, there is so much going on, and so many different types of people. We saw, Live Jazz, Acrobats, A Roller Disco, Volleyball, Photo Shoots, Horses and Karts, people sunbathing in "Sheep Meadow" and a man playing his walking stick... Anne has decided its her favorite place!



After the park we walked down to the Rockerfeller center to take in some city views. I was actually a bit disappointed by the views marred with greasy hand-prints on 2 inch plate glass... Far too busy too. Bloody tourists...

Later we came back to the "Top of the Rock" to get the same views at night and it was even busier, I got a few snaps but nothing to write home about. Ironically, I took the photo below from the hotel room just before we left...



We walked back to have dinner and hail a cab and saw Times Square at night.... CRAZY place, its like daylight with all those bulbs! My Dad would go MAD!!!!

Sunday, July 12, 2009

Just to let you know...

All the NY photos on this blog are straight out of the camera.... I'll be fixing them and posting ALL our photos to Flickr in the coming weeks if you are interested...

Saturday - Walkabout


After a FREE breakfast in the "Club" we had a chat with one of the doormen (New Yorkers are so friendly and helpful) & decided that we would try to walk up towards Central park from the hotel. We walked up Broadway, past Wall St and on towards City Hall Park. The streets are very clean and tidy, until you hit Chinatown that is... Through little Italy, Soho and up to Madison Square and then found our way on to 5th Avenue.



We walked past the Empire State Building and then stopped in at the NY Public Library. I wanted to see some of the places that Ghostbusters Was filmed, but to be honest the Library did not ring any bells, although I did recognise the 2 Lions, named "Patience" and "Fortitude". We then headed over to Grand Central Terminal which is like taking a step back in time.



When we came to Times Square; we didn't know what had hit us! I have never seen so many people crammed into one place in all my life. After some deliberation we chose a place to eat and grabbed some lunch. (Anne wants me to tell you that I had a footlong hotdog and she had deep fried macaroni cheese).



After lunch we walked up to the entrance to Central Park and jumped onto a "Pedi-Cab" or "Rickshaw", this was a great way to see the highlights of the park, and the massively varying activities and cultures within.



After seeing the park, we tended to our blisters and hobbled back to the beginning of Downtown and hailed a cab back to the hotel.

On the way back we spotted my own personal shop, and an advert for a rather delicious sounding snack. . .

Saturday, July 11, 2009

Morning - Sat

Morning, afternoon, evening, whatever it is :)

We slept very well last night in our HUGE bed (seriously, I have never seen anything like it!). However we were up VEEERY early this morning... The view out of the window was AMAZING though...




We now need to hatch a plan for today!

Friday, July 10, 2009

The Ritz

OK, so when we arrived at the Ritz in Battery Park they hadn't actually heard of us... Thanks BA! But the attitude of the reception staff was incredible. It's true what they say about the service in America, it really is something else. It took them all of 8 minutes to get us sorted, and in that time we were given drinks and nibbles in the bar, on the house. Its a hard life!

So, the room: We have a 12th floor room looking out over battery Park, the Hudson, Statue of Liberty and Ellis island..... Its Amazing! When they say 5 star, they really mean it! We also have access to the "Club", which apparently means we get to drink, eat and relax as much as we like..... FOR FREE!!!! HA!



A short walk round the park and a listen to the "Battery Park Drum Jamming Session on the Hudson" (people turn up, sit on the grass and bang bongos) and we are pretty pooped... Its 19:30 local time, but our bodies don't really believe it!


Above, the Battery Park Drum Session, and the Ritz in the background

Forgot to mention, we saw "Dr Fox" in Gatwick airport this morning... He was giving away thousands of pounds to holiday makers who were willing to get up and sing on stage... We missed out on a few hundred quid there as I had an "Anne" in tow which means we were late... As usual! Better make up for it in "The Club" :)

Downtown

So we finally touched-down at about 2pm NYC time. After waiting in line for about 40 minutes at passport control I got my first glance at a New York Yellow Cab! However, we had already decided that we did not want to get a cab to the hotel, as that could run to about $75. So we spotted a Bus that apparently went to Manhattan and jumped on, being assured by the practically non-english speaking driver that her would tell us later how to get to our hotel.... During the journey we managed to establish that we would probably be dropped at Grand Central - Midtown. From there we scrambled for our bags and jumped down the nearest subway to do battle with Manhattan's public transport system. First we needed to work out what train to get on, and then how to actually buy a ticket :) We managed to jump onto a train and jumped off again on Wall St - Downtown. We then strolled down Broadway to Battery Park and with a little help from the NYPD we found our hotel.

On the Way

Hi! I'm typing this about 3 hours into the flight, but I'm not sure when I will be able to post it. Perhaps not until we get to the hotel.

The extra leg room seats are GREAT. We did have a rather smelly old lady sitting with us, but she seems to have gone now, which is nice... The cabin crew overheard us telling her it was our Honeymoon, and gave us some Champagne! :)

The plane we are using is a Boeing 777, and it's very comfortable. This particular flight has "personal entertainment", which is basically a touch screen TV screen on an arm, where you can find and watch or listen to a whole host of movies, TV and CDs. Very nice. No Internet though... Quite why we don't have wireless net access on our planes yet I don't know.



So, at least another three hours to go... I guess I'll watch another movie...

*****************

Now less that one hour to go! We have been fed, again... The service on this BA flight has been impeccable. If I ever come over again, it will be BA I fly with for sure. Started to watch "Watchmen" but it looks pretty crud.... Ah well....

I'll try and post this from JFK, before we start our "make it up as we go along" commute to the hotel.... taxis are boring, public transport puts hairs on ya chest :)

New York here we come!

On the plane now waiting to take off..... Surrounded by loads of American people already!
Managed to get extra leg room, so thats sweet! No window though :(

Friday, June 05, 2009

River Drive gets Softpedia thumbs up

I recently received an email from the Softpedia team informing me that River Drive had been added to their software database and fully tested by their software labs!

Probably sad, but I'm chuffed!

Monday, January 12, 2009

Hidden GPS in Dell Mini 9 (3G Model)

The Dell Mini 9 netbook with built-in 3G connectivity uses the Dell 5530 wireless card for connectivity. This card also has GPS functionality built right in!

To use the GPS unit in Ubuntu Linux; add an entry to your wvdial.conf that looks like this:

[Dialer gps]
Modem = /dev/ttyACM2 (or /dev/ttyUSB4 if you are using the option module)
Init1 = AT*E2GPSCTL=1,2,1
Init2 = AT*E2GPSNPD

Start the GPS unit with
# wvdial gps
then ctrl+c out.

To use the GPS, install gpsd and run it:
# sudo apt-get install gpsd
# gpsd /dev/ttyACM2

# gpspipe -r
will read raw data from gpsd and dump it to the screen, useful for debugging.

A great Free gpsd compatible mapping app is "tangoGPS", which you can grab from their site: http://www.tangogps.org.

Thanks to Barry John Williams for the AT info.

Monday, December 15, 2008

Get the built in hsdpa modem working on the Dell Mini 9 with Ubuntu 8.10

The Dell Mini 9 is a great little netbook with the advantage of having a hsdpa modem built in. Of course, this is all supported under Windows by a whole ream of drivers and dial-up software. Ubuntu 8.10 supports the Mini 9 very well, with wireless working out of the box. The hsdpa modem needs a nudge, but will work without too much difficulty.

In order to get the built in hsdpa (3G) modem in the Dell Mini 9 working under Ubuntu 8.10 (Intrepid Ibex) you need to perform a number of simple steps.

1. Patch the stock "option" USB serial driver to add support for the Dell hardware and build it.
2. Blacklist the kernel module which is attempting to handle the hardware by default.
3. Automatically load the newly built "option" module at boot.
4. Use wvdial to turn on the built in RF circuit (essentially enabling the modem)
5. Use wvdial to start a ppp connection.

If you are unfamiliar with Linux (or can't be bothered to do all this yourself) then I have attached an archive containing the recompiled option kernel module, a blacklist and modules list file and the wvdial scripts. There is also an install script. It is IMPORTANT to only use this archive if you are running stock 8.10 Intrepid Ibex with kernel version 2.6.27-7-generic. You can check this by typing uname -r on a terminal. If you are running a different (later) version of the kernel, you will most likely need to patch the "option" module yourself. The patch is also in the archive.

To use the archive, save it to your home directory, open a terminal and type:

# cd
# tar -zxvf mini9_hsdpa_intrepid_2.6.27-7-generic.tar.gz
# cd mini9_hsdpa_intrepid_2.6.27-7-generic
# chmod +x install.sh
# sudo ./install.sh


To enable the modem, enter:

# sudo wvdial On

and to dial:

# sudo wvdial Connect

If you wish to carry out the steps yourself, the patch can be found in the archive. The module to blacklist is cdc-acm. Check the included wvdial script for the codes to enable the hardware.

Hope this helps.

mini9_hsdpa_interpid_2.6.27-7-generic.tar.gz

Thanks to "craigmain" for this post.
Thanks to Dan Williams for the patch.

Thursday, November 20, 2008

Windows Azure

Microsoft's jump onto the cloud bandwagon is obviously following a typical Microsoft pattern...

Friday, September 26, 2008

Operating System Theme Parks

You can tell its Friday; the team and I were discussing what theme parks would be like if they were modeled after popular operating systems.

We decided that:

In the Windows theme park the rides would be REALLY slow and the roller coaster cart would fall off half way round . . .

On the Linux / Unix / BSD roller coaster it would be really fast, very smooth and you could get the spanners out and customize your ride half way round. If you could work out how to get on in the first place that is . . .

And the Apple theme park would be just like the Linux / Unix / BSD park, but it would cost a fortune to get into and would look all shiny with a fresh lick of paint.

Friday, September 12, 2008

Hug a Developer

I saw this, and realized how true it is! Take note all you "Business" people out there . . .


Tuesday, July 15, 2008

Using a USB 3G modem with Ubuntu Linux on the MSI Wind / Advent 4112

After purchasing the Advent 4112 / MSI Wind, the first thing I had to do was get Ubuntu up and running. This was very straight forward using the 8.04.1 iso.

Ubuntu supports the 3 Huawei E220 modem out of the box, so all I had to do was install and configure gnome-ppp to do the dial-up for me.

To install gnome-ppp, open a terminal and type:
sudo apt-get install gnome-ppp

Then run gnome-ppp from the Internet menu.

Here are the settings I use for gnome-ppp:

First Screen:

User: user
Pass: pass
Remember password: yes
Phone number: *99#

Setup Screen:
Device: /dev/ttyUSB0
Type: USB Modem
Speed: 460800
Phone Line: Tone
Volume: off
Dial Prefix:
Dial attempts: 1
Wait for dialtone: yes

Init Strings:
Init2: ATZ
init3: ATQ0 V1 E1 S0=0&C1 &D2 +FCLASS=0

Networking Tab:
Dynamic IP Address
Automatic DNS

Options Tab:
All unchecked except:
Dock in notification area
Abort connecting if no dialtone
Check default route
Ignore terminal strings (stupid mode)
Idle time (0) disabled

Sunday, July 13, 2008

MSI Wind / Advent 4211

I have just driven a three hour round trip to the only store in the south of England which has the Advent 4211 in stock.

The Advent 4211 is the MSI Wind, only re branded and in different colors. The specs and dimensions are exactly the same.

Weighing in at just about .2 of a kilo more than the Eee and only slightly larger its still very much a mobile PC. The keyboard however is much more usable than the Eee. Having an 80gb hard drive does give the advantage of dual-boot possibilities, however you do lose some of that "no moving parts" shock proof factor or the Eee.

The Advent comes pre-installed with Windows XP, and although I'm not a fan, XP does feel snappy enough running on the Atom processor with 1Gb of RAM (and so it should!)

I have taken some pictures of the Advent / Wind along side the Eee PC 701 and a HP pavillion tx 1000 for comparison purposes.



Installing Ubuntu Linux on the Wind was fairly straight forward, however ensure you use at least 8.04.1 (the .1 being the important bit) wireless drivers and install instructions can be found here.

In terms of practicality, the Wind's 80Gb hdd and larger keyboard probably puts it in front of the Eee, however for battery life and "Geek Chique" the Eee still has it.

Thursday, July 03, 2008

Amazon Simple Storage

I have recently been playing with Amazon's Simple Storage Solution or "S3". The service provides users with unlimited, secure and reliable storage for about 10 US dollar cents per gig per month. Which is cheap. The service is aimed at developers and does not provided would be "home" users with any front ends for uploading or downloading files. Only API's. The service supports REST and SOAP and is pretty easy to use, once you have got your head around signing your requests.

I have developed a "home user friendly" Windows and Linux compatible front end for the service which can be used to browse your storage area, upload, download and delete files. It looks similar to Windows Explorer and supports drag and drop. The software (River Drive) can be found over at www.TristanPhillips.com under the projects section. To use the software you will need to sign up to the S3 service, but you only pay for what you use, and there is no minimum charge.

Monday, May 19, 2008

Tether your iPhone and your EeePC

If you own an iPhone in the UK, chances are that you are on an unlimited data contract with a rather large mobile service provider. Why not take advantage of that data connection from your EeePC. Unlike mobile 3G which requires a 3G datacard to use on the Eee, your iPhone and Eee can talk to each other using their built in WiFi connections. You will need to have your iPhone "Jail Broken" so you can install the required proxy software.

Start by installing TinyProxy on your iPhone, this can be found in the network section of the installer app. I think you will need the BSD subsystem too, I have.

Once you have installed TinyProxy, setup a new AdHoc wireless connection on your Eee. To do this choose "Network" from the internet panel, Press "Create", Choose "Local Area Network - Wireless", Press "Next" as the default card is the right one, Choose "Static IP Address" and press "Next". Enter "192.168.1.2", "255.255.255.0", "192.168.1.1". Press "Next". Enter "192.168.1.1", press "Next". Press "Next" again. Enter a SSID such as "EeePC", choose "Ad-hoc" and press "Next". Leave "Any" checked and press next. Tick "Enable encryption" and enter a WEP key. This will stop others stealing your (very limited) internet bandwidth. Then name your connection. I have called mine "iPhone", hit "Next". Then "Finish".

Cool, now start that wireless network by going into "Network" (you may already be there) choosing iPhone, press "Connection" > "Connect". After a dialog box, you should now be hosting a new wireless network.

On your iPhone, choose "Settings", "Wifi" > Select the "iPhone" network and press the ">". Press the "Static" tab and enter "192.168.1.1", "255.255.255.0". Press "Wireless Settings" to save your setup.

Back on your Eee, press Ctrl+alt+T and in the console enter "ping 192.168.1.1", hit return and you should see the ping replying. If not, check your settings.

Now to use the iPhone connection you need to tell Firefox to use the iPhone as its proxy server. Hit "Edit" > "Preferences" > Network tab > "Settings", choose "Manual proxy configuration" and enter "192.168.1.1" port "8080", tick "Use this proxy server for all protocols". press "OK", "Close".

Now, try google! If it does not work, make sure your ping is working, and if still no luck, reboot your iPhone, I had to a couple of times. I leave the ping pinging as a visual confirmation of the link between my toys.

You may need to leave your iPhone "awake" to use the connection, so modify the "auto lock" setting to suit you. The connection really is quite slow, but OK for emergency stuff.

I'm writing this on the train using my Eee and iPhone. Bloomin' marvelous!

Monday, April 21, 2008

Ubuntu 8.04

Ubuntu is a community developed, Linux-based operating system that is perfect for laptops, desktops and servers. It contains all the applications you need - a web browser, presentation, document and spreadsheet software, instant messaging and much more. www.ubuntu.com

The Ubuntu developers are constantly bringing you the absolute latest and most stable software that the open source and free software communities have to offer. This is their latest result: the Ubuntu 8.04 LTS release candidate, which brings a host of excellent new features.

Friday, April 11, 2008

Disable memory trimming in VMWare Server to reduce IO queues

I was suffering from an ab-normally high %wa figure in top. Disabling memory page trimming in my VMWare guest seems to have solved the issue.

You can disable memory trimming for a guest in the virtual machine settings editor (VM > Settings > Options > Advanced). In the Settings section of the Advanced panel, select Disable memory page trimming.

Tuesday, February 12, 2008

Router Monitoring Script

If you have a Netgear DG* router and wish to automatically reconnect / reboot when your connection drops, try adding this script to your cron.hourly:

#!/bin/sh

# CheckRouterStatus
# Tristan Phillips
# Checks the status of a netgear DG* router and reconnects / reboots if not connected.
# Licensed under the terms of the GNU.

# Arguments:
# $1 = Ping target, use www.google.co.uk
# $2 = Router IP, normally 192.168.0.1 or 192.168.1.1
# $3 = The router username (admin)?
# $4 = Router password (password)?

# Check arguments are present
if [ "$1" = "" ] || [ "$2" = "" ] || [ "$3" = "" ] || [ "$4" = "" ]; then
echo usage: CheckRouterStatus.sh PingTarget RouterIP RouterUser RouterPassword
exit
fi

# Try the ping
echo Attempting to ping $1
ping -W 10 -c 8 $1 >/dev/null 2> /dev/null

# Check result
if [ $? -ne 0 ]; then

# The ping failed! Get Stats and disconnect the router
echo Ping failed, dumping stats and disconnecting router . . .
echo `date` Ping failed, here are the router stats: >> /var/log/RouterReboots
wget --user $3 --password $4 "http://$2/setup.cgi?next_file=stattbl.htm"
# Execute the first router command twice as authorization tends to fail...
wget --user $3 --password $4 "http://$2/setup.cgi?next_file=stattbl.htm"
grep ttext setup.cgi?next_file=stattbl.htm >> /var/log/RouterReboots
echo `date` Disconnecting router >> /var/log/RouterReboots
wget -q --user $3 --password $4 "http://$2/setup.cgi?todo=disconnect" > /dev/null 2> /dev/null

echo Waiting . . .
sleep 10

echo Connecting router . . .
echo `date` Connecting router >> /var/log/RouterReboots
# Async call to connect incase of timeout
wget -q --user $3 --password $4 "http://$2/setup.cgi?todo=connect" > /dev/null 2> /dev/null &
echo Waiting . . .
sleep 20

# Try again
echo Attempting to ping $1
ping -W 10 -c 8 $1 > /dev/null 2> /dev/null
# Check results
if [ $? -ne 0 ]; then
echo Ping failed . . .
echo `date` Disconnect / Connect cycle did not correct the issue! Trying a reboot . . . >> /var/log/RouterReboots
wget -q --user $3 --password $4 "http://$2/setup.cgi?todo=reboot" > /dev/null 2> /dev/null
else
echo Ping OK, Connection issue solved!
echo `date` connection issue solved. >> /var/log/RouterReboots
fi

# Be nice and logout
wget -q --user $3 --password $4 "http://$2/setup.cgi?todo=logout" > /dev/null 2> /dev/null

else
echo Ping OK
fi

#clean up
rm setup.cgi*

exit 0

Tuesday, December 18, 2007

Skype 2 Beta on the eee supports video calling

I'm not the first to post this, but hey, the more the merrier....

If you want to try video calling on the eee, download the Xebian skype 2 package from skype.com. Install it with:

sudo dpkg -i [PackagePath]

Activate the on board camera with:

echo 1 > /proc/acpi/asus/camera

Then configure Skype to use the detected camera and you should be good to go.

Ultramobilegeek and JKOnTheRun seemed to have a few stability issues, but I have used this for hours on end with no problem at all!

Saturday, November 17, 2007

3G on the Eee PC

I just nipped down to the 3 shop and picked up a Huawei USB 3G modem. I literally popped it into the Eee and setup a new connection in "Network". No extra drivers, no complicated configuration. It even found all the "3" setting for me.

This could not have been any easier, and will work with any provider using the Huawei E220 USB modem (Most).

Can you imagine things being so easy on Windows!? I think not!

Asus Eee PC

Its arrived!

Finally the wait is over for me... I got my new white Asus Eee PC delivered this morning. If you are reading this; you will have read loads of shining reviews about this little wonder, so I won't bore you with another one. Suffice to say I LOVE it. However, while I was waiting for this unit to arrive; I was quite frustrated at the lack of images out there showing the actual scale of this machine. So here you go:



I'm writing this on the Eee and am already used to the scale of the keyboard. Linux really does boot in about 15-20 seconds and the interface is really easy to use, so as well as geeks like myself who will no doubt have the thing in bits (metaphorically) within five minutes; this would make a great homework PC for the kids.

I think 2008 is going to be a truly great year for Linux!

Friday, September 21, 2007

www.TristanPhillips.com

I have finally put up a page where I can post links to some of the utilities I have put together.

www.tristanphillips.com

Includes a number of useful command line applications developed by myself:

Tools for password testing, printer hacking, account enumeration, port sniffing, photo organization, event log monitoring, command line email, file expiration, hashing, SQL data exporting, automated FTP and port forwarding.

The tools are intended as proof of concept / testing utilities and should not be used for illegal / questionable purposes.

C# TCP Checksum

Recently I have been developing some code that needed to calculate the checksum for a TCP packet before transmission.

The TCP checksum is the 16 bit one's complement of the one's complement sum of all 16 bit words in the TCP header and text. A 96 bit pseudo header is also taken into account when calculating the checksum. This pseudo header is constructed from the IP src address, dst address, protocol and TCP header length. For the purposes of calculating the checksum, the checksum word in the TCP buffer is set to 0's.

There seems to be very little information in regarding this floating about, and certainly no C# examples; so here is the working code, should you need it:

// Calculates the TCP checksum using the IP Header and TCP Header.
// Ensure the TCPHeader contains an even number of bytes before passing to this method.
// If an odd number, pad with a 0 byte just for checksumming purposes.
static ushort GetTCPChecksum(byte[] IPHeader, byte[] TCPHeader)
{
uint sum = 0;
// TCP Header
for (int x = 0; x < TCPHeader.Length; x += 2)
{
sum += ntoh(BitConverter.ToUInt16(TCPHeader, x));
}
// Pseudo header - Source Address
sum += ntoh(BitConverter.ToUInt16(IPHeader, 12));
sum += ntoh(BitConverter.ToUInt16(IPHeader, 14));
// Pseudo header - Dest Address
sum += ntoh(BitConverter.ToUInt16(IPHeader, 16));
sum += ntoh(BitConverter.ToUInt16(IPHeader, 18));
// Pseudo header - Protocol
sum += ntoh(BitConverter.ToUInt16(new byte[] { 0, IPHeader[9] }, 0));
// Pseudo header - TCP Header length
sum += (UInt16)TCPHeader.Length;
// 16 bit 1's compliment
while ((sum >> 16) != 0) { sum = ((sum & 0xFFFF) + (sum >> 16)); }
sum = ~sum;
return (ushort)ntoh((UInt16)sum);
}

private static ushort ntoh(UInt16 In)
{
int x = IPAddress.NetworkToHostOrder(In);
return (ushort) (x >> 16);
}

Tuesday, June 19, 2007

Ubuntu says no to M$

After the recent deals made by a number of Linux vendors with M$ regarding patent threats, I am extremely glad to hear that Ubuntu (Canonical) has told M$ to shove it.

Mark Shuttleworth of Canonical blogs:

Allegations of "infringement of unspecified patents" carry no weight whatsoever. We don't think they have any legal merit, and they are no incentive for us to work with Microsoft on any of the wonderful things we could do together. A promise by Microsoft not to sue for infringement of unspecified patents has no value at all and is not worth paying for. It does not protect users from the real risk of a patent suit from a pure-IP-holder (Microsoft itself is regularly found to violate such patents and regularly settles such suits). People who pay protection money for that promise are likely living in a false sense of security.

Tuesday, May 22, 2007

Microsoft takes on the Free world

Its no secret amongst my friends, family and collogues that I am a fanatical Free software supporter and Linux user. Until now I have refrained from using this Blog as a political ranting ground. However after I saw this, I couldn't help myself.

Microsoft is trying to claim that Free software, such as Linux infringes on 235 of its "patents". (Yes those quotations are meant to be there.)

Read about it here

Perhaps if they invested as much time and money in their products (Vista anyone?) as they do trying to cream off profit from other honest peoples hard work, they may have an operating system worth using?

I have just got a new laptop, dual AMD 64's, 2Gb of RAM and it takes about 10 minutes to restart to a "usable" Vista UI. Is it any wonder that the first thing I did was to install the FANTASTIC Ubuntu 7.04?

Its time people realised what a monopolising bully M$ really is and made a bid for Freedom.

Friday, March 23, 2007

WebJam

WebJam, a new Web 2.0 site looks pretty cool.... You can create your own page, add pre-built "modules" and allow others in your community to edit it. Question is, do I move my blog over, or link it in? ;)

They are listed in "25 UK Web 2.0 startups to watch in 2007" which is here

Sunday, December 10, 2006

SDL Games Programing

I have recently been working on a remake of the Nintendo classic "Mario". The remake is written in C++ using the SDL library. SDL stands for Simple DirectMedia Layer. Although I am writing and testing the code on Linux at the moment, I hope the game to be cross-platform if ever completed. ;)
In my search for documentation for SDL, as well as the excellent documentation found at www.libsdl.org I found a site called Lazy Foo' Productions. This site hosts an excellent games tutorial for people who may not have very much experience in game writing. Highly recommended: http://lazyfooproductions.com/SDL_tutorials/index.php

Tuesday, September 12, 2006

Homesight Remote V0.31

Homesight Remote version 0.31 has been released. This release includes the previously omitted "Hasher" application for changing the servers login credentials.

Enumerating user accounts with LookupAccountSid() and LookupAccountName()

Recently I was wondering about enumerating account names on a remote machine. This can be done with the 2 windows API functions LookupAccountSid() and LookupAccountName().
LookupAccountSID finds the SID for a named account and LookupAccountName finds the named account for a SID. Using the method described by Evgenii Borisovich Rudnyi (writer of user2sid and sid2user) in 1998 it is possible to find the name of the administrator account on a remote machine.

First, find the SID for any account on the machine using LookupAccountSID(). Guest is a good bet. The SID will look something like this: S-1-5-21-1482476501-963894560-682003330-123
Once you have found any old SID, take the last section of the SID (Called the RID) and replace it with 500. 500 will ALWAYS be the administrator account.
Then call LookupAccountName() passing in the new SID. That will return the name of the administrator account.
You can enumerate all the accounts on the machine by looping through RIDs 500 to say 4000.

This is functionality provided by the Win API for use by anyone. No hacking here.

I have recently written an implementation of the methods described in above .NET. Here is the output from this tool:

SidTool v0.1 - Tristan Phillips

SidTool -? for help

Querying machine: Local
Starting Account: Guest
Filtering Results: False
From RID: 400
To RID: 3000

Looking for Guest Sid . . .
Found Guest Sid: S-1-5-21-1482476501-963894560-682003330-501
Using Guest Sid as reference to find Administrator Sid . . .

Found administrator account called: XXXXXX\Administrator (SidTypeUser)
@ S-1-5-21-1482476501-963894560-682003330-500

Enumerating RID's from 400 to 3000 . . .

500 XXXXXX\Administrator (SidTypeUser)
501 XXXXXX\Guest (SidTypeUser)
513 XXXXXX\None (SidTypeGroup)
1000 XXXXXX\HelpAssistant (SidTypeUser)
1001 XXXXXX\HelpServicesGroup (SidTypeAlias)
1002 XXXXXX\SUPPORT_388945a0 (SidTypeUser)
1004 XXXXXX\IUSR_PCL001424 (SidTypeUser)
1005 XXXXXX\IWAM_PCL001424 (SidTypeUser)
1006 XXXXXX\Debugger Users (SidTypeAlias)
.
.
.

You get the Idea.
Also, if you start out with a domain account, you will find the name of the domain administrator. To query a remote machine you can try creating a null connection the the IPC$ share first.

Ill post the utility here soon.

The moral?: Although it is good practice to change the name of the Administrator account on a machine, you should not rely on this obscurity as a means of security. Anyone familiar with the methods above can easily find your new "secret" name.

Monday, June 12, 2006

Xgl Rocks

Recently I undertook the geek mission of getting Xgl working on my desktop at home. Xgl is the 3D accelerated xserver built on top of OpenGL.

Check it out at: Xgl on Wikipedia

I achieved my goal by upgrading my Suse installation from 10 to 10.1 (which was very smooth). To get Xgl working you need to choose Xgl and Compiz in Yast. Compiz is the 3d enabled window manager.

Getting Xgl working on my nvidia card was not as easy as I had hoped, however, after getting the drivers from nvidia and telling Sax to enable 3d acceleration, I got it working.

Later I installed Suse 10.1 on my Laptop which uses an Intel graphics card. Xgl and compiz worked out of the box!

Friday, April 21, 2006

Homesight Remote v0.2

Homesight Remote v0.2 has been released to Sourceforge. This release adds full support for camera captured images. You can get the software at http://homesightremote.sourceforge.net

Saturday, April 15, 2006

Homesight Remote v0.1

Following my last post I have release version 0.1 of Homesight Remote. The software allows you to view the last 20 events in your Homesight event log via any web browser. You can read about / download the software here: http://sourceforge.net/projects/homesightremote/

Wednesday, March 29, 2006

Motorola Homesight

The first thing I wanted to do after buying and installing my Motorola Homesight system was to gain remote access to the captured images and event logs. It would of course be possible to gain access to the system remotely using something like Terminal Services or VNC, but I wanted a solution that would allow me to access the information using any web browser.

After a little poking about I discovered that the Homesight system uses the Mckoi Database, an open source Java SQL database system published under the terms of the GNU license (although Motorola do not redistribute this license for some reason?). It is relatively easy to find the database username and password by looking at the database files in the data directory. The default on my system was:
user: Xanboo password: 115West30th

I decided to write a small Java app to query the structure of the Homesight database. Here is what I found:

archives
--------
Archive Time
Archive Date
Archive Type
Archive Device Type
Archive Device Name
Archive File Type
Archive File Name
Archive Timestamp
Archive Note

profiles
-------
NotificationType
Address


txtprofiles
----------
NotificationType
Address

The interesting data was stored in the archives table. A simple select on this table produces the following information (example)

13:04:28, 28 Mar 2006, 5, 6, Door-Window Sensor 2B, 1, , 2006-03-28 13:04:28.403, closed
13:04:26, 28 Mar 2006, 2, 12, Camera - Day 2D, 2, c:/progra~1/motoro~1/./data/archive/image32923.jpg, 2006-03-28 13:04:26.684, Triggered by schedule 'Camera - Day 2D660 S34734'
13:04:24, 28 Mar 2006, 2, 12, Camera - Day 2D, 2, c:/progra~1/motoro~1/./data/archive/image32922.jpg, 2006-03-28 13:04:24.793, Triggered by schedule 'Front Door Alert'

As you can see, included in the logs is also a link to any images or videos captured by the system.

Once I gained access to this information, it was a straight-forward task to write a web application allowing access from any browser.

If you would like to learn more, feel free to leave me questions.

Friday, March 17, 2006

Mini-ITX Rundfunker

I have just seen this project on mini-itx.com. Well worth a mention:
Mini-ITX.com is a fantastic site for the geeky minded!

Thursday, March 16, 2006

Hasher

Using the "hasher" utility you can:

  • Create MD5 / SHA1 / Base 64 hashes for strings and files.
  • Ensure files you have downloaded have not been modified or corrupted.
  • Reverse engineer a hash using a word list & Apply common password modification guesses to the word list.

This utility demonstrates intelligent dictionary cracking and highlights the need for a strong password.

Important: I have developed this utility for demonstrational / educational purposes only. I cant be held responsible if you use it to do something stupid.

Sample output:

C:\>hasher -m MD5 -h -f "C:\HasherV0.2.zip"

Hasher V0.2 - ^&*%$@

C:\HasherV0.2.zip is 144118 byte(s)
MD5 Hash = 368f17ee1588c7c04de83b7fe3ce59d8

C:\>

C:\>hasher -m SHA1 -h -v "Please hash this string"

Hasher V0.2 - ^&*%$@

SHA1 Hash = 1fd49c1b5dd1011d6596cded625b1ca95762e0

C:\>

C:\>hasher -D -v "htskz8kp9UdGhWSyAv9Eccc9Bx8=" -l dict.txt -a "JBloggs"

Hasher V0.2 - ^&*%$@

Attempting to reverse hash htskz8kp9UdGhWSyAv9Eccc9Bx8=
Using: SHA1 with wordlist dict.txt
Input is in: Base64
Appending: JBloggs to the guess

62.99%

Found: orange03

C:\>

C:\>hasher -?

Hasher V0.2 - ^&*%$@

Usage: hasher [-D -v <value> -p <text> -a <text> -l <path> -m
<method>
-h -s -?]

Valid arguments are:

-D - Attempt reverse hash using word list
-v - <value> Value for hashing or reversing
-p - <value> Prepend value to value for hashing
-a - <value> Append value to value for hashing
-l - <value> Path to wordlist file
-m - <SHA1/MD5/B64> hash method (default SHA1)
-h - Produce hex output rather than base 64
-s - Do not try common password modification methods
-? - Show this message

C:\>

Hasher is Mono compatible!

Download Hasher from www.TristanPhillips.com

Wednesday, March 15, 2006

acpi=off

I recently got myself a nice new Philips x60 laptop. Being a huge fan of the penguin, the first thing I did was to shrink the windows partition right down and install Suse Linux 10.0.

People often complain about the lack of device support in Linux, however Suse supported every device this laptop had, right out of the box. Display, Modem, Wireless LAN, Sound everything. Apart from, it would seem, the laptops cooling system.

After a few hours gazing lovingly at my new toy, I noticed that my thighs were starting to get a tad warm. I also noticed the lack of any fan noise. After booting into Windows the fan started up as expected. Oh Dear :(

Panic not! Linux is extremely flexible, and with the help of a few newsgroups / handy blog postings, most problems can be ironed out fairly easily.

ACPI is an interface that allows the operating system to control power management on computers. This includes cooling. Evidently acpi did not support my laptops cooling systems and needed to be disabled. Disabling acpi allows the hardware (BIOS) to manage the cooling. There is an argument that says all power management should be left to the hardware anyway...

To disable acpi in Linux add acpi=off to your kernel arguments. This can be achieved in the configuration of your boot loader (probably GRUB, so grub.conf). In Suse you can use Yast.

Visual Studio 2005

I recently made the mistake of completing a project in the all new Visual Studio 2005. I was drawn in by the new controls and language features... Now I find myself in a "World of Pain"!

You need to avoid it until they have released some service patches / hot fixes. Its TERRIBLE! In my experience it crashes all the time, especially when working on forms which use visual inheritance. I now find myself forced to do all form editing in code. Its just lucky the project is practically finished.

I would be interested in hearing from anyone who has had the same issues / managed to find a fix. Bill?

Tuesday, October 11, 2005

Add a Cygwin command as a Windows service

If you want a Cygwin app (Apache or Webmin for example) to start when windows does, there is a useful tool that you should know about. "cygrunsrv" comes as standard with Cygwin and can be used to create Windows services.

For example, to have Apache run when Windows boots:

cygrunsrv -I service_name-p /usr/local/apache/bin/httpd.exe [-a arguments] \ [-e VAR=VALUE] [-t auto manual] [-u user] [-w passwd]

Show The Progress of an SQL Database Restore

Add the STATS option below, the numeric being a percentage value. The following restore command will display a progress after each 1% of the database restored.
Brilliant!

RESTORE DATABASE Bla
FROM DISK='D:\DB Backup\BLA'
WITH
MOVE 'Bla' TO 'D:\Data\Bla.mdf',
MOVE 'Bla_Log' TO 'D:\Data\Bla.ldf',
STATS = 1

Thursday, October 06, 2005

The Send To Menu

Here is a cool tip;

Opening unknown file types can sometimes be really annoying, especially if you just want to take a look at the contents in notepad.

Add a shortcut to notepad/wordpad in the SendTo directory in C:\Documents and Settings\username\SendTo.
When you have done that, you can right click on any file, choose send to, then notepad to see the contents of the file.

You can of course add any useful applications to your send to menu. Easy!

Tuesday, July 27, 2004

Mono

If you have ever wished that writing applications for Linux was a little easier, then your dreams just came true.
Recently Novell have released version 1 of their .NET framework titled "Mono". Which means "Monkey" in Spanish.

Mono V1 includes a C# compiler, an ECMA compatible runtime engine and a whole host of class libraries. These libraries include ADO.NET, ASP.NET and Gtk#. Gtk# is a set of .NET bindings for the gtk+ toolkit allowing you to build fully native Gnome applications, and also includes support for UIs built with the Glade toolkit.
The release also includes an IDE, debugger and help library.

I downloaded and installed the Mono v1 packages with no problems at all using Fedora core 2. 

A nice point to note is that Mono includes support for Windows.Forms via Wine, so if you want to write applications in windows and compile them in Linux you can do this without any issues.
However lets face it, with support for Gnome you'd have to be mad to stick with Windows!

www.Mono-Project.com


What's coming in ASP.NET 2?

ASP.NET 2 or "Whidbey" will be released with the next version of the Microsoft .NET framework. It will be a major release including a number of significant changes providing a large increase in the level of functionality. For developers who do not plan to upgrade all their application to the latest version of .NET, the good news is that this release is 100% backward compatible with the current version.

Some of the new features include:

Master Pages
Themes
New Data Controls
Better Data Binding, including Business Objects
Login Controls
Membership and Role Management Services
Site Navigation Controls
Personalization Services
Web Part Controls
Integrated Mobile Support
Pre-Compilation of Applications
New MMC Snap-In
Configuration APIs
Richer Application Tracing
Heath Monitoring
Auditing

For more information on the new features available, and for beta information, check out the Whidbey home page at: http://msdn.microsoft.com/asp.net/whidbey/default.aspx.

Tuesday, May 18, 2004

Shaped forms in .NET

Shaped forms are often used nowadays to increase the visual appeal of an application, when done correctly and combined with some good graphics they can look extremely good. A common example is Windows Media Player.
Using some very simple code, it is possible to implement form shaping in .NET, the following examples are in C#.

The basic idea behind form shaping in .NET is as follows:
1. Create a new "GraphicsPath" object.
2. Add a shape to the new GraphicsPath object.
3. Set your forms "Region" property to be a new "Region" object using your new GraphicsPath object as the constructor argument.
Its as simple as that.

The GraphicsPath object has a number of methods to aid in adding shapes, for example:
AddArc
AddBezier
AddClosedCurve
AddCurve
AddEllipse
AddLine
AddPie
AddPolygon
AddRectangle

The "AddPolygon" method is especially useful as this allows you to create any shape you like, by adding an array of points to the GraphicsPath.

I have created an example application that will allow you to create any shaped form you like, by clicking or "drawing" out the regions of your desired form. To download the example click here (coming soon, I promise!).

Here is a simple example that will provide a circular shaped form, place it in your forms Load event:

GraphicsPath p = new GraphicsPath();
p.AddEllipse(0,0,200,200);
newForm.Region= new Region(p);


Monday, May 17, 2004

Stop Kudzu hanging your system at boot time

A small number of laptop Linux users may find that their system hangs at boot-up during the "Checking for new hardware" stage.
This is caused by Kudzu, the hardware probing tool.
This issue affects HP and Compaq machines in particular.

To stop this:
1. Boot from your Linux installation CD.
2. Type "linux rescue" at the first prompt.
3. Choose your language and region.
4. Select "no" when asked if you wish to start networking.
5. Select "Continue".
6. You will be told where your system has been mounted, probably
"/mnt/sysimage", change to this directory "cd /mnt/sysimage".
7. Type "cd etc/init.d"
8. Type "rm kudzu"
9. Reboot your machine and the problem should be solved.

Tuesday, May 11, 2004

Automate FTP Uploading and Downloading

A feature of the windows console ftp client that not a lot of people know of is the ability to run a script.
This can be really useful for automating web site content release. Just write a script to upload all your regularly changing files to your server, and you can release with a double click!
Not only can you automate file transfers, but also the login / logout process.

Here is an example script:

open [your server address]
[username]
[password]
put default.asp
put links.asp
get trace.xml
bye

To use this script, simply enter

ftp -s:[scriptfilename]

You could write a bat file with the above line, to enable a double click release.

SQL Server Collation Settings

To ensure the collation order of a new SQL server install is "Latin1_General_Ci_AS"
You must follow these steps;
1. Set your regional settings to be "English (United States)"
2. Choose custom in SQL server setup.
3. Choose "Dictionary Order, Case Insensitive for use with 1252 Character Set"

Monday, April 26, 2004

.NET Forms Authentication

When creating a website which needs security for certain areas (or all areas) developers have always had a number of choices. One is to use the built in IIS standard of Windows authentication, however this can be a little difficult if you don't have full access to the sever your application is running on. This leaves most developers having to design and implement their own security methods, often for every site they create.
Forms-based authentication is an ASP.NET authentication service that enables applications to provide their own logon UI and do their own credential verification. ASP.NET authenticates users, redirecting unauthenticated users to the logon page, and performing all the necessary cookie management.

Forms authentication also allows:
  • Management of users and their passwords in the web.config file, thus eliminating the need for database based credential storage.

  • Encryption for users passwords

  • Cookie data protection

  • Cookie expiration timeout specification

  • Page or directory based security attributes. i.e allow all users to see Default.aspx but only signed in users to participate in the chat forum.


  • To use Forms Based Authentication:

    Modify your Web.config file to include the following (please excuse the br's):

    <authentication mode="Forms">
    <forms name="FBAuth" loginUrl="logon.aspx" path="/" protection="All" timeout="1">
    <credentials passwordFormat="SHA1">
    <user name="Tris" password="AC2B12B76A945DD9FDD7E58FBDD010D5AFA10F33"/>
    </credentials>
    </forms>
    </authentication>

    <authorization>
    <deny users="?" />
    </authorization>
    This tells ASP.NET to use Forms authentication, and that it should deny access to all users that are not signed in. As a result all users will be directed to the specified login page "login.aspx" for authentication.

    By including the following code in your login buttons on click event, ASP will attempt authenticate the user details specified against the credentials specified in the Web.config file, and if successful, create a cookie and redirect the user to the page they originally requested:

    private void cmdLogin_Click(object sender, System.EventArgs e)
    {
    if (FormsAuthentication.Authenticate(txtUser.Text, txtPass.Text))
    {
    FormsAuthentication.RedirectFromLoginPage(txtUser.Text,true);
    }
    else
    {
    lblBadLogin.Text = "Invalid Username or Password! Try again:";
    }
    }
    When a user whishes to sign out, you can just call
    FormsAuthentication.SignOut();ASP.NET will then manage the removal of the clients cookie.

    It is also possible to specify access permissions for particular files and folders if required, ensure the following config settings are added after the existing
    </system.web>in your Web.config

    <location path="default1.aspx">
    <system.web>
    <authorization>
    <allow users ="*" />
    </authorization>
    </system.web>
    </location>
    This will allow all users to access "default1.aspx" even if they are not signed in. You can specify files or folders in the path parameter and can use allow or deny in conjuntion with *, or ?.
    ? meaning not signed in and * meaning everyone.

    ASP.NET Forms Authentication is extremely easy to implement and use, and should put and end to the authentication hell of previous web development.

    Friday, April 23, 2004

    Pocket PC Printing

    Ever wanted to print your documents from your Pocket PC via IR or Bluetooth?
    All you need is the HP PocketPC printing utility found at www.hp.com/go/pocketpcprint
    This clever little app allows you to print via IR, Bluetooth or your network connection to a variety of different printers. Simple!

    nDOC

    nDoc generates class library documentation from .NET assemblies and the XML documentation files generated by the C# compiler.
    Documentation in the past has been a truly grueling task, especially if you want it to look any good. Who needs documentation when you have good code comments?
    With the introduction of XML comments in C# and nDOC, you can ensure your code comments are complete, and create great looking documentation files all in one foul swoop.
    nDoc works with the XML comment file produced by the C# compiler and can output your documentation in many different formats, including MSDN style and javaDoc style. These files can be routed to compiled help files, or straight HTML.
    A truly brilliant addition to any .NET programmers toolbox.
    Find out more at http://ndoc.sourceforge.net/wiki

    Http -> Https Redirection

    Had LOADS of trouble getting this to work on our site. We took the customer error page approach, creating a new page called redirect.htm and pointing the 403.4 error to the new file. However no matter what permissions we set on the file, we ALWAYS got an access denied error.
    We managed to hack out way out of this by editing the real 403.4 error file and putting our redirect script block at the bottom.

    If anyone has any cunning plans or advice, please post a reply!