Wednesday 3 December 2008

C, C++, Objective C, where will it end ?

To my absolute amazement I find I'm writing in C & C++ on my iPhone app. Many moons ago when I was a "programmer", the C guys used to laud it over us 3rd Gen people, their superiority for working with the arcane. So HA! I finally caught up.

Generally I find c++ fine, I did do some utility apps on KDE a long time ago, so it's not a big jump to use it again. C is hmm, well like anyone else I get confused with my pointers.


What is interesting, is reading Unix Network Programming and Advanced Unix Programming, it's funny how much of the unix noise you blot out in the terminal without really wondering what it means..

I'm writing pThreads at the moment, for some background processing, I'm finding it more challenging to think outside the Cocoa Framework that has become home. I must buy Programing with Posix Threads when I can afford it, a page turner.

Saturday 8 November 2008

xBox and iPlayer

I finally bit the bullet and upgraded xbmc on the xbox to the latest version.

The best new feature is the plugin layouts. I've added bbc iPlayer ( from google code ) and ITV catchup.
Such an amazingly useful piece of hardware now, I can watch my torrents, dvd's, play music, a/v streams and even my photos.
Haven't figured out the connection to iTunes yet.

It was a bit confusing, and here's how I needed to do it, just in case I break it again.

Boot up Splinter Cell and select the saved linux game.
Boot into linux
Copy over xbmc into E:/xbmc

reboot

Election

Well, I stayed up the whole of the night watching the election results in the USA, found it all quite emotional which I wasn't expecting. Can't help but feel that the world has changed, and hopefully for the better.

Major disappointment, the passing of Proposition 8 in California. What a terrible thing to do. Maybe the solution needs to be different but a great slap in the face when the Obama result represents the next page in the Civil Rights movement. How ironic.

Hopefully change is coming.....

Monday 27 October 2008

MacBookPro Matte Display Petition

http://www.PetitionOnline.com/38djhak2/petition.html

Probably won't have any effect but give it a go.

Sunday 12 October 2008

Ftp Server / Servlet for cocoa

Before I got interested in Lighttpd I had been working on an Ftp Server for my projects.

I've decided that lighttpd is to complex for me to incorporate at the moment, so I'm releasing my source code to my server and hope that people might find it useful.

I'd also be very glad if people help make it better.

You can find it at http://code.google.com/p/diddyftpserver/


upload/download works from filezilla and transmit. i havent implemented all of ftp's commands yet

I've opened a google group for discussing the server code you can find it here
http://groups.google.com/group/diddyftpserver

Saturday 11 October 2008

Finding Shared libraries

Have you ever wished you could work out what program uses which libraries. On os x the tool is otool.



I found the information here and its been a great help Al Hoangs blog

Friday 10 October 2008

Compiling lighttpd for iphone

After writing my own ftp server for my app, I decided that webdav was a way better solution as so many have found out.  Using the instructions at http://latenitesoft.blogspot.com/2008/10/iphone-programming-tips-building-unix.html
and with the help of Alice at http://gothcandy.com/alice/2007/09/05/81/porting-lighttpd-to-the-iphone/   I think I have it compiling, but after all that, I wonder if its actually useful to me....
doh!
anyway here's the shell script to compile..
you also need to copy in 2 header files from the simulator to let it compile..
these are 

/bzlib.h and crt_externs.h

If anyone has some advice how I could incorporate this into an app, do let me know.
cheers


#/bin/bash

export DEVROOT=/Developer/Platforms/iPhoneOS.platform/Developer
export SDKROOT=$DEVROOT/SDKs/iPhoneOS2.1.sdk
export SIMROOT=/Developer/Platforms/iPhoneSimulator.platform

# Save relevant environment
U_CC=$CC
U_CFLAGS=$CFLAGS
U_LD=$LD
U_LDFLAGS=$LDFLAGS
U_CPP=$CPP
U_CPPFLAGS=$CPPFLAGS

export CPPFLAGS="-I$SDKROOT/usr/lib/gcc/arm-apple-darwin9/4.0.1/include/ -I$SDKROOT/usr/include/"
# -I$SIMROOT/Developer/SDKs/iPhoneSimulator2.1.sdk/usr/include/"
export CFLAGS="$CPPFLAGS -arch armv6 -pipe -no-cpp-precomp -isysroot $SDKROOT"
export CPP="/usr/bin/cpp $CPPFLAGS"

# dynamic library location generated by the Unix package
#LIBPATH=src/.libs/.dylib
#LIBNAME=`basename $LIBPATH`
#,-dylib_install_name,@executable_path/$LIBNAME"
export LDFLAGS="-L$SDKROOT/usr/lib/ -Wl,-dylib_install_name,@executable_path/$LIBNAME"


echo $CPPFLAGS
echo $LDFLAGS
read -p "Press a key"

# static library that will be generated
LIBPATH_static=src/.libs/lighttpd.a
LIBNAME_static=`basename $LIBPATH_static`

./configure CC=$DEVROOT/usr/bin/arm-apple-darwin9-gcc-4.0.1 LD=$DEVROOT/usr/bin/ld --host=arm-apple-darwin -without-pcre

# --libdir=$SDKROOT/usr/lib/ --includedir=$SDKROOTk/usr/include/
make



#mkdir -p lnsout
#cp $LIBPATH_static lnsout/$LIBNAME_static.arm
exit



Saturday 27 September 2008

Finder open Terminal Here

Just found this super useful button for the finder that will open the terminal at the location of the selected finder window

Tuesday 19 August 2008

Stupid VPS

Stupid VPS keeps going down. I wonder if its modrails doing it.

I need to have another one ready to swap to.

Linux, TV & The XBox

A little while back I hacked the xbox ( softmodded ) using the well know technique of loading Splinter Cell and downloading a boot loader via  a saved game. I had to cut the wire of one of the controllers and wired it to a USB socket, I copied the bootloader onto my old iPod Shuffle and got linux installed on it.

Its worked great. I've been using elgato on a macmini to record films off tv, and have been scripting them to upload to my OSX Tiger Server. The xbox plays them great, streaming without a glitch. I've installed XBMC as the main dashboard and the scripts are pretty neat too.

After this, I decided that the bundle of wires under the TV was a pain, so I cancelled the cable tv, boxed up the DVD-R and all the other paraphernalia and was left with just the xbox and a digital-tv box. 

That wasn't enough, so I looked at MythTV for the mac mini, but after struggling to get it working, found out it couldnt access my TV usb stick, so was a bit stumped. Then I decided to try installing linux on the mini. A brief flirtation with Gentoo ( so much compiling ) and I had opensuse up and running and eventually the elgato-diversity ( Hauppage NovaT ) working with Kaffeine, Mplayer and xine. ( ppc is a pain, not many rpms, so compilation hell again ). I did try distcc and creating a cross compiler for the G5 but it wasn't to be. Another day perhaps?

Next stop. I'm trying to get MythTV compiled and working. It's a long road. but I hope to be able to schedule the recording of tv from anywhere I am and stream it too.. 

Meanwhile I had to start learning about AudioUnits....  and the rest of my life.

iPhone Dev

As a change from music, and because it fascinates me I've been working on some audio software for the iPhone/iPod Touch.  My app is currently in review. I am now working on a full version, that being a stripped down, how the hell do I do this version.

Thursday 22 May 2008

Deprecated Functions

I think these 2 days can be categorised as trying to make old things run with newer libraries.

My main work website is on hosting rails at the moment, but I have a VPS Im trying to move everything to. Well when I looked at my local copy of the site, it wouldnt work on Locomotive anymore and I had no idea why.

Today I'm trying to compile openAL into an iphone app.  My demo app for cocoa uses alutloadwavfile.  

Both days, ive spent time trying to figure out 
1) where i was in the project when i left it
2) why it wont run
3) what the replacement for the bloody deprecated function is

doh!

Wednesday 21 May 2008

Plesk virtual hosts

Another thing I need to remember for plesk

If you are creating changes to the apache files, do not change the http.includes.
just add a vhost.conf in the conf folder

and do

/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=domain.com


Tuesday 20 May 2008

I have seen the future

Got on the tube, saw a man reading a v thin filofax. 
2nd glance, it was an ebook
3rd glance, the screen was amazing.  it didnt seem to be a screen, it looked like paper
4th glance, it was Sony

I remember the times when this happened for me
1. seeing my first Personl computer.  A commodore PET
2. seeing my first mobile phone

it is the future
and the future is now

VPS & Dist CC

I will fill more info on this soon BUT the short version

my VPS hasnt enough memory to compile mod_rails 

so I had to learn distcc which meant learning ssh reverse tunneling which meant installing ubuntu on parallels ( after many attempts )

and the end result

mod_rails crashed my VPS.   so im not sure yet, what the result of all that was.

ssh -R username@vps  3632:localhost:3632 

and then compile using 
CC=distcc ./configure

Thursday 8 May 2008

Plesk. Ubuntu & Rails

Well its no surprise that Ubuntu and Ruby / Gem  dont like each other that much since they both have competing version managers.   Its even more confusing when Plesk has something like this too..

My solution, ignore them.. I deinstalled ruby using apt-get remove ruby  ...

then compiled from source

./configure --prefix=/usr

which pops it in /usr/bin

I also learnt to put my source into /usr/local/src

It seems to work.....

DNS and Plesk

Ok ok, so I was missing the glaringly obvious step.  

When you register the domain name, the domain name registrar has a box that looks a bit like this :

domain name server   ns1. [   your domain here here ]    =  ip [ your ip here ]

so I simply add in the ip of my server, and select ns1.  ns2 etc.   Then the domain nows where to find info about this subdomain.   

Why was this so confusing.... BECAUSE my frackin domain name registrar does not let you do this and every time I emailed them on what I was trying to do  they made some nonsense up, until I finally figured out exactly what it was I wanted. Then they stopped replying to the emails because I had worked it out.   UK2 stuff you.     

I went to namecheap.com and got a cheap domain name from them and used that instead.  

Bu Bye UK2 , I had no idea you were overcharging so badly

Thursday 1 May 2008

DNS Plesk and my domain provider

There's something I dont understand and am trying to...
I have, as you may know, a vps with plesk installed. I have a myriad of domain names for different projects. Im quite familiar with using the domain name sellers services to point different parts of the DNS at different ip addresses, however they charge for this service. There is the option on my domain name to host the dns elsewhere.  On Plesk for each domain, you can turn on DNS hosting, it actually seems to happen automatically. So my understanding is this server is now acting as name server for its own domain, but its not active until the domain reseller updates their records.
Figure 1
Figure 2

So it appears to me that I should simply be able to select the domain server my vps creates in plesk and copy those entries into my domain sellers nameserver change boxes...
Figure 3



Except it doesnt seem to work.. what am I doing wrong ?  
Whenever I set it, it doesnt seem to save the change. It just goes back to uk2's

This is what it looks like when i change nameservers....

Figure 4

but if u go back and check after this....
its reverted back to uk2's servers as in Figure 3.


My understanding is the following...

My server starts bind/dns  - registers itself as the authoritive nameserver for clubsite.info with the nameservers at .info.   
Anyone looking up clubsite.info gets forward to the nameserver at .info which forwards it to my server which returns the ip address.


Wednesday 30 April 2008

Plesk Installing Components - fastcgi

I had some hosting for my wow guild website. I learned to use rails by making a guild portal. It was a bit clunky but it was a nice learning project and it got us going. Recently we switched to the more 'powerful' dkpsystem.com, which is useful but a bit clunky.  but its proved v useful.
So

My virtual server was empty, and I have 4 other sites being hosted on different hosting company servers... bit silly.   I've held back from putting stuff on the server, but when my main website went down due to a changed cc number, I decided i should start pushing 
them all onto the one as it was pretty good. Sadly last time I used it I remembered that it was a bugger to find out how to add fastcgi tho it was there if you looked hard enough.  So I logged in, reset the VPS, nothing like a clean slate eh. 

But

I could only add 1 client and 1 domain, which wasnt right. Next i tried reloading the vps to see if I missed anything.  No change, 1 client, 1 domain and no option for cgi...  many wasted hours ensued and length waits in queues for tech support.  

So
I thought, well maybe I know more this t
ime round. Let me just order a new vps and I'll close the others account. Which I did, but the new server was also missing the same components.
 Meanwhile tech support fixed the domain/client issue on the old server. doh....
... but I was unhappy with that one. Who knows what mess I already made of that.

HERE IS THE ANSWER...  so that if I ever have to do this again.... i know
Go into Plesk. ( not Virtuozzo) and select System:Server:(Services):Updater.  




If your lucky you should see an update package.



Click on this.
Inside you should find a list of things to update AND install if they aren't already.


THERES THE SOLUTION. 

How helpful am I !?


Now. Im adding some nice tags so people can find it  ( including myself )

mod_fcgid psa_mod_fcgid-configurator

and some pics ( ooh blogger is way better )

Wednesday 19 March 2008

iphone innoyance

Well, I think like a lot of people, the initial burst of excitement ran into some hidden limits to the sdk.

I think an issue for many people is going to be the sandboxing, its not that I want to access every last file throughout the device.

Do we all have to write sync solutions to get our own data back and forth? Thats a bit annoying, apple must have a better way we could do this.

I dont mind the background app thingy, tho I think there is a case for a background stack that calls every n minutes to service low level info. But I think we all know why its not allowed... but hey, some of us keep our devices plugged in all the time. Couldnt u give us the option of when powered allowing apps to tap into a background cycle stack. hmm. Its not holding me up personally tho.
I guess apple will do their own ichat thingy or aim thingy, that will solve that issue for many.

Perhaps a mechanism to deliver info in via the email could solve some problems for people. or is that a security hole waiting to happen.

Has anyone been accepted as an official beta developer, noone seems to know.

oh well. lots of reading to do.

seems funny being encouraged to use the UIViewController to contain the view as well as the controller code. Roll on the interface builder update asap.



Saturday 8 March 2008

iphone SDK

Well, I can barely contain my excitement, and wrote the obligatory hello world/rich app.

But have you tried registering as a full developer, im still waiting to put it on the real device. I wonder if its not quite finished, that part. surely not.

anyway. my biggest hurdle is nothing to do with iphone dev, its looking for the correct framework and technique for my app. no im not saying what.

having a ball. wish id been able to start with the jailbroken one earlier but at least its not our properly til June. im glad i'm busy, but i wish i had more time.


Friday 1 February 2008

Ecto or Mars Edit

I haven't posted anything for a little while because my trial on marsedit ran out.

I had found it was a really useful little app except for one thing. When you go to edit a post, its all just plain old html all over again. This seems so retro. I don't get it. Was I doing something wrong ?? Is there a setting?

Anyway by chance I found this Ecto app and although its not as pretty as Mars Edit, it does seem to be more like a notepad/text editor than a html editor, so I'm giving this a whirl.

Maybe this is the one and maybe it will get me updating my blog again.

If so, I'll pay the fee