Dan’s View

2011/01/10

My Reynholm Industries Card

Filed under: Geek — dan @ 12:43

My new ID card.

2010/10/21

Helpful README?

Filed under: Geek,linux,work — dan @ 10:15


[root@ahost cvfs]# ls
bin config debug examples gdbinfo help install man ras
[root@ahost cvfs]# cd help
[root@ahost help]# cat README
This page intentionally blank.

I was kinda annoyed by that :)

2010/09/19

Building an iPhone app using Flex SDK and PFI

Filed under: Geek,Programming — Tags: , , — dan @ 20:47

A simple intro into making an iPhone app using flex SDK and Packager for iPhone.

With my Air/Flex apps I generally start with the following folder structure:

./bin
./dist
./images
./Makefile
./src

And have a Makefile like so:

FLEXSDK=/Users/dan/Programs/flex_SDK_4
PFIPSDK=/Users/dan/Programs/AirPackagerForIPhone
FLEXBIN=$(FLEXSDK)/bin
MXMLC=$(FLEXBIN)/mxmlc
AMXMLC=$(FLEXBIN)/amxmlc
ADT=$(FLEXBIN)/adt
ADL=$(FLEXBIN)/adl
PFI=$(PFIPSDK)/bin/pfi
PFIADT=$(PFIPSDK)/bin/adt
PFIADL=$(PFIPSDK)/bin/adl
APPNAME=HelloWorld
KEYFILE=/Users/dan/Documents/apple_Daniel_Bartlett.p12
KEYPASS=Password12345
PROFILE=/Users/dan/Documents/AA11_on_DanBs_iPhone.mobileprovision
APPXML=src/${APPNAME}-app.xml
MXML=src/${APPNAME}.mxml
AIRSWF=bin/${APPNAME}.swf
AIRAPP=dist/${APPNAME}.air
AIRIPA=dist/${APPNAME}.ipa
INCDIR=src/
ASSETS=Default.png images/logo_128.png
FLEXCONFIG=${FLEXSDK}/frameworks/air-config.xml
FLEXARGS=-load-config ${FLEXCONFIG} -optimize -headless-server -incremental -source-path=$(INCDIR)
all: $(AIRSWF) $(AIRIPA)
run: $(AIRSWF)
	$(ADL) $(APPXML) ./
$(AIRSWF): $(MXML)
	$(AMXMLC) $(FLEXARGS) -output $(AIRSWF) $(MXML)
$(AIRAPP): $(AIRSWF) $(APPXML) $(KEYFILE)
	$(ADT) -package -storetype pkcs12 -keystore $(KEYFILE) -storepass $(KEYPASS) $(AIRAPP) $(APPXML) $(AIRSWF) $(ASSETS)
$(AIRIPA): $(AIRSWF) $(KEYFILE)
	$(PFI) -package -target ipa-test -provisioning-profile $(PROFILE) -storetype pkcs12 -keystore $(KEYFILE) -storepass $(KEYPASS) $(AIRIPA) $(APPXML) $(AIRSWF) $(ASSETS)
clean:
	rm -rf bin/* dist/*

So update the Makefile above with your own KEYFILE and KEYPASS.

For you application descriptor XML set ./src/HelloWorld-app.xml to:

<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://ns.adobe.com/air/application/2.0">
	<id>org.f-box.HelloWorld</id>
	<filename>HelloWorld</filename>
	<name>HelloWorld</name>
	<version>0.001</version>
	<description>HelloWorld</description>
	<copyright>Daniel Bartlett [dan@f-box.org] 19 Sept 2010</copyright>
	<initialWindow>
		<renderMode>cpu</renderMode>
		<content>bin/HelloWorld.swf</content>
	</initialWindow>
	<icon>
		<image128x128>images/logo_128.png</image128x128>
	</icon>
	<supportedProfiles>mobileDevice</supportedProfiles>
	<iPhone>
		<InfoAdditions>
			<![CDATA[
				<key>UIStatusBarStyle</key>
				<string>UIStatusBarStyleBlackOpaque</string>
				<key>UIRequiresPersistentWiFi</key>
				<string>NO</string>
			]]>
		</InfoAdditions>
	</iPhone>
</application>

For our src/HelloWorld.mxml:

<?xml version="1.0" encoding="UTF-8"?>
<mx:Application
	applicationComplete="init()"
	layout="absolute"
	xmlns:mx="http://www.adobe.com/2006/mxml"
	xmlns:s="library://ns.adobe.com/flex/spark"
	>
	<mx:Script source="HelloWorld.as"></mx:Script>
	<s:Label text="Hello, world!"></s:Label>
</mx:Application>

And a very simple no-op src/HelloWorld.as:

public function init():void {
	var aString:String;
}

Now if all goes according to plan, you can run make from the directory and end up with a dist/HelloWorld.ipa install into iTunes and sync!

And you should end up with an app that looks something like this:
HelloWorldiPhone

2010/03/01

ShoutCast Stream Meta script

Filed under: Geek,Programming — Tags: , — dan @ 10:00

Using the following python script you can pull the meta info from a playing stream. The headers variable will contain the Radio Name and other things, and the meta’s returned will include the currently playing track.

source

Example output:
dan@x ~/ $ ./get_icy_name.py
{'headers': {'icy-genre': 'Techno Drum and Bass', 'icy-notice2': 'SHOUTcast Distributed Network Audio Server/Linux v1.9.93atdn
', 'icy-pub': '1', 'icy-br': '128', 'icy-name': 'Bassdrive - Worldwide Drum and Bass Radio', 'content-type': 'audio/mpeg', 'icy-metaint': '24576'}, 'metas': {'StreamTitle': 'G-Shock Radio Feb 25th 2010 - hosted by Kasio', 'StreamUrl': ''}}
dan@x ~/ $

2009/12/03

Overground Re-route

Filed under: Travel,london — Tags: , , — dan @ 09:02

One thing I am glad of with London transport, especially around where I live is the ability to take a different route in the case of one’s primary route being screwed. As this morning, the Piccadilly Line has severe delays so I have re-routed onto the overground to Paddington. Even got a seat!

2009/12/02

Tube Crush

Filed under: Travel,london — Tags: , , — dan @ 17:45

So here I am again on my journey home on the Piccadilly Line. I catch it from Piccadilly Circus so am used to the influx of tourists who don’t know fully what they are doing, I can handle that. What is more annoying is the stupid commuters who just don’t consider the people around them.
I tend to take my bag off my sholder, be aware about who is standing behind me and generally not to cramp them too much. Why the fuck cannot others manage this simple idea!
So what do you do in a situation where there is no room? Hold your ground. It would break tube etiquette to say anything. So we suffer in silence, well not quite; today I have a soundtrack of the recent Dom and Roland album, kinda Agro-DnB, if that’s an accepted genre..
So I can now breathe again since the stupid woman bringing a massive suitcase just got off at Barons Court, after bashing my ankles with it. Very glad I’m wearing my steelies today, they still might come in handy for the stupid guy who’s arm is nearly in my face because he has to hold onto the handrail far from him but close to me, dick.

2009/09/22

$1bn aid for healthcare in the 72 poorest countries

Filed under: Political — Tags: , , — dan @ 11:51

If you feed money in to a developing countries health care system, what happens when you stop feeding money? This is in reference to the $1bn that the governments of the UK, Norway, Netherlands and Australia will be giving to the GAVI for the worlds 72 poorest nations.

Does the country have a high enough GDP to support the systems that have been introduced in the long term? I am guessing not, or else why did we need to feed the money in the first place. Therefore why waste the money, effort and time. I am all for helping a country develop, but it should be in a maintainable fashion, therefore helping to improve the countries economy and then it will be able to improve it’s own health care (along with everything else).

2009/09/21

The issues with noisy systems

Filed under: work — Tags: , — dan @ 17:32

Today I felt like I completely failed at my job. I was ‘on shift’, therefore I was supposed to be keeping an eye on all of the systems at my work and their health. Yet I failed to notice an issue ‘that was glaring me in the face’ for over 3 hours, due to the ‘noise factor’.

At the beginning of my shift I noticed some parts of our monitoring had been semi-broken for a large part of the weekend. So I focused on getting that fixed. Once I had that fixed that my monitoring systems were showing about 2000 alarms, which is high. But due to the large chunk of the infrastructure that had gone un-monitored over the weekend I didn’t think much of it. Alongside this there was some database maintenance ongoing.

So how did the noise fail me, well the number of alarms for databases should have been glaringly obvious. But due to the monitoring and maintenance issues, I didn’t take heed. When you are used to having between 100-200 alarms, and you have a system reporting 2000; I find that it gets very difficult to get a handle on the real problems.

Overall I know I didn’t fail, but for the next few hours I am going to be beating myself up about it.

2009/05/05

Wasted BogoMIPS

Filed under: Geek,linux,work — Tags: , , , — dan @ 14:15

So last week I screwed up in a royal fashion. I caused 1 core on 12,000 servers to be running at 100% with a zombie process. In conversation with a friend he asked “So how many BogoMIPS were you wasting?”, of course I had to find out.

So I grepped out the first core on each box’es BogoMIPS value and summed it up.

Per second: 61099300 BogoMIPS

If you take that figure and multiply it up for 12 hours.

Total: 2639489760000 Million Instructions

For more information on BogoMIPS please see this nice FAQ.

2009/04/21

whois?

Filed under: Geek — Tags: , — dan @ 20:11

“If your ISP has registered with the appropriate databases, our servers are updated on a regular basis so you will have to wait until the next refresh to gain access.”

Would you interpret that to mean they are using whois lookups on IP addresses/blocks to check its location for limiting content to certain contries?

Older Posts »

Powered by WordPress