Cinnamon applets

November 26th, 2013

So after trying Gnome 3 for quite some time, I’ve moved on to Cinnamon nowdays.

Strangely, one thing that I sorely missed was a certain extension: Media player indicator.

At first I was resigned, having dealt with coding gnome shell extensions before (such as Pidgin integration) I thought I was in for a world of hurt if I tried.
Turns out, Cinnamon developers recognise this pain, and have specifically designed ‘applets’ with an API which is stable across versions, allowing for nice simple plugins for their bar! They even include some nice ones – their volume applet worked with Spotify out of the box, just didn’t display the title / album art on the bar.

After a quick tutorial I got the code for the sound@cinnamon.org applet, and it was suprisingly easy to add it in!

Check it out on cinnamon-spices or just use the cinnamon settings app to download it… nice!

Figured it was worth making a pull request for as well. I love github sometimes.

Facebook Event exports take two

February 8th, 2013

So a while ago I wrote a php script to make facebook event names appear properly on google calendar.
I’ve since noticed that all ‘full day’ events on facebook get exported as though they are on the previous day! Someone has written a page to do this, but the source code is not available and so it depends if you trust them with your events or not.

As such I updated my php script to do this date change too! Code below, but if you want to use it on my site:
http://www.psykar.com/utils/cal.php?uid=&key=

Get the uid and the key from your events page on facebook by clicking the gear in the top right, and export events, then get the URL of ‘upcoming events’.

For adding this to google calendar use webcal:// instead of http://

<?php

// Facebook uses ZULU time for it's exports.
date_default_timezone_set('Zulu');

function inc_date($matches) {
        $date = new DateTime($matches[2]);
        $date->add(new DateInterval('P1D'));
        return "DT".$matches[1].":".$date->format('Ymd');
}
$ical = "https://www.facebook.com/ical/u.php?uid=".$_GET['uid']."&key=".$_GET['key'];
$file=file_get_contents($ical);

$pattern = "#DT(START|END):([0-9]{8})[\n\r]#";
$file = preg_replace_callback($pattern, "inc_date", $file);

$search="CLASS:PRIVATE";
$replace="CLASS:PUBLIC";
$output=str_replace($search,$replace,$file);
header("Content-Type: text/Calendar");
// Give the file a name and force download
header("Content-Disposition: inline; filename=events.ics");
print_r($output);
?>

Goa

February 5th, 2013

My reading on Goa suprised me a little when I realized that Goa is not actually a city, and not in the strict sense of the word a state either. I’m still not sure on what it’s called technically to be honest, but it amounts to a collection of towns and a capital city stretched along a coastline of about 100km or so (I believe)
We arrived at the airport, and booked a pre-paid taxi to Vagator where Kylie and myself had booked accomodation at ‘Asterix hostel’. The reading I’d done suggested that Vagator was a smallish town, with a somewhat laidback kind of crowd, and many Indian tourist families compared to the nearby town of Baga and Anjuna which were better known as party towns, with significantly more tourists clubs.
The taxi driver was great, named Smile (or something similar…) chatting about the various customers he gets. We were suprised to learn there are a large number of Russians who visit Goa – and that apparently they are the worst customers in the taxi unfortunately. We got Smile’s number just in case we needed a taxi later. Sadly, as awesome as he was, we didn’t feel it was worth calling him for a lift back to the airport later, as there were too many local taxis in Vagator willing to do it for a reasonable price as well.

We arrived at the hostel, and were taken to our 4 bed dorm, which we had to ourselves! It was in a separate wing to the main hostel, but we still had free wifi, which was a nice change from the exorbitant prices that we were charged in Pune. We endeavoured to book some tours which were run by the hostel, but unfortunately they required 4 people to happen, and we were never able to organise enough people at the hostel to actually make them happen.
The first day we spent lazily – getting some food from an American style restaurant, ironically called ‘Tin Tin’s’ (given Tin Tin has nothing to do with the US) then wandering down to the beach and back, browsing a few of the market stalls along the way. Then having dinner with a largeish group of people from the hostel.

The next day we commandeered a taxi to head in to Old Goa – what used to be a colonial Portuguese  town, with many large churches in a very small area. After visiting Sa Cathedral, The Church of St. Francis of Assisi, The Basilica of Bom Jesus and a small museum, to the consternation of the taxi driver we found, we drove back to Vagator. 1 hour of driving each way for 1 hour of sightseeing. We still considered it worth it, despite the warnings we had received the previous night from a couple of girls at the hostel who considered it boring.
Dinner we had again with a bunch of people from the hostel, initially over candlelight with no power – which was out for nearly an hour. I was surprised to see police cars and helicopters start to make drive and flybys about 10 minutes after the power had gone out – I’m still curious as to why.

Morning came yet again, and we resolved to walk up to the nearby fort, which was on the map provided to us by the hostel, and was visible from the beach the first day. The hike was a short 10  minutes or so, to a low wall about 2-3 meters high ringing the hilltop, in a rather poor state of repair. Climbing over we wandered the central area, probably 4-5 acres of grass, taking photos of what was quite an amazing view, particularly to the north where a bay cut in to a river delta.
We then attempted to find our way down to the beach from the fort – given the map we had suggested there was such a path. Our first attempt proved fruitless, after 20 minutes of walking and ending at the top of a cliff we had to turn back, and found a different route. Although steep, particularly given we were both only wearing flip flops, we made it down eventually, to find ourselves at the beach next to the one we had visited on the first day. There were a few beach chairs arranged out the front of a cafe and we paused to grab a quick drink, before heading back to the hostel.

Our final full day in Vagator, we considered doing one of the tours again, even if just by ourselves with a taxi, but made in hindsight the right decision and opted for a relaxing day on the beach. I hadn’t even been in the water yet, which considering was a little rediculous. Despite being hesitant over the water temperature (the day was a little cooler than the previous ones) it turned out to be nice and warm, and short (and long) dips interspersed with sunbathing on deck chairs getting served drinks and food to your chair was, as hoped, nice and relaxing. Jess, one of the girls from the hostel joined us around midday and we were there until the sun started disappearing behind the haze, which existed even in Goa, and it started to get a little chillier.

Upon getting back it was about time to apply the nightly layer of mosquito repellant. Although Goa isn’t considered a super high risk of Malaira, I was still on anti-malarials. But despite this, repellant is still recommended. Quite besides the fact that the bites aren’t exactly pleasant. Interestingly they only really were a problem between about 6-8pm – around twilight. During that time you might get 20 bites in 5 minutes, but outside of those hours I wasn’t even wearing repellant most of the time and didn’t get bitten at all!

Given we were heading off to the airport the next day at 4am or so, we considered ringing Smile to book him in, but given all the local taxis as mentioned, we ended up asking the driver who had taken us to Old Goa earlier. For a slight premium due to the time of day (and fair enough too!) he agreed. Kylie and myself did end up having slightly too big of a night given the time of the flight in the morning, but when in Goa….
We still made it up in time to catch our epic sequence of flights to get to Amritsar, so it was all good.

Pune

January 29th, 2013

So, I was writing blog posts, but when internet was available didn’t really have time to post them.
I’ll get them up slowly!


The trip to Pune was uneventful. While it’s close geographically, about 100km as the crow flies, it’s significantly higher up, and the road winds up through the hills for quite some time. The drive took nearly 3 hours total.

Our driver gave us a small tour of sorts on the way in, pointing out some sights and landmarks. Pune has a large military presence, and this shows in particular how clean the city is compared to Mumbai (although still some way to go compared to Australian cities)
We drove up to a hotel, and the porters started taking our bags… but the hotel name didn’t match what we’d been told by Vanessa. A quick phone call sorted it out – our actual hotel was just next door, so he didn’t miss by much.

St. Laurn was a much higher class of accomodation to Mumbai. To be expected given it was organised by the bride to be for a large number of visiting family and friends. I believe we had 3 floors of the hotel booked out entirely.
Being New Years Eve, there was a party planned at one of Sunny (the groom-to-be)’s families place, so I had a nap before some cars were organised to ferry us over.

The party was quite an experience. Bollywood music blasting, some amazing Indian nibbles and Kingfisher strong – a rather dangerous beer of 8% alcohol content.
Shortly before midnight hit, one of Vanessa’s friends, Sid, convinced us to have a shot of some cashew liquor called Fenne (although I’m not sure on the spelling). Bad mistake though, it tasted absolutely foul, and upon checking, we still have no idea how strong it actually was – the percentage was not labelled!
New Years hit, hugs all round, more Bollywood dancing and eventually time for sleep.

The next day we set out (a little bleary eyed) to hunt for some outfits for the next night – an evening of song dance and food as a pre-wedding celebration.
Sunny and Vanessa joined Kylie, Toby (another friend) and myself to a few stores.
We travelled by auto rickshaw, or ‘rick’, a mode of transport that Kylie and myself had not mustered the courage to try in Mumbai (helped by the fact that they are restricted to only certain areas of the city). The little three wheeled tuk tuk’s as they are also known are little two stroke three wheeled zippy things, with room for three on a back seat behind the driver. In Goa, unless you hire a private vehicle, there aren’t really any such thing as normal taxi’s so there’s little alternative. The experience was not as traumatic as one might have expected, the only issue being the lack of english most of the drivers possess. Luckily during our time in Pune, there was almost always someone on hand attending the wedding who knew enough Hindi to get us safely to the destination.

After being regailed of Toby’s exploits when picking his Shyrvani the previous day (apparently taking over an hour and going through almost every single one in the shop) I was slightly apprehensive… Kylie however picked the first dress, and after looking through about 10 or so Shyrvani’s myself, I picked the second one I tried on, a green and gold number, together with a gold scarf.
Alterations were included in the price and we left it there to get taken in somewhat to pick up the next day.

Next stop was some shoes, with sandals for everyone!

Later I had one of the more bizzare experiences so far. Some more friends of Sunny and Vanessa were catching lunch at ‘Phoenix mall’ so we grabbed a couple of ricks and headed over. After walking through a metal detector and a quick bag check, it seemed as though we had just left the country and arrived back in Australia. The mall was almost identical to any in Melbourne. You could be mistaken for thinking you’d just walked in to Chadstone. It did really hammer home the difference in wealth between the rich and the poor. I imagine the security on the door isn’t just to stop security threats but also to weed out those who don’t really have the money to be there.
Some lunch and shopping were had, before headin back to the hotel to get ready for a ‘night of celebration and dancing’.

Wearing my new shyrvani, scarf and sandals, the guys hung out on the roof of the hotel for a while as the girls had to arrive first apparently. We arrived at a rather standard wedding reception type hall, with some Hindi additions, such as a wedding seat positioned on the stage.
The night started with the bride, groom, and some friends done an interpretive dance of how Sunny and Vanessa met, in a Hindi style of course, together with an amusing commentary. Then the night was essentially one big Hindi dance party, with a buffet meal thrown in. By now I began to recognize a few of the current Hindi pop songs, even if I didn’t know the lyrics at all.

The next day Kylie and myself attended a Hindu blessing ceremony for the groom. Together with his mother and father, and a Hindu priest, many offerings of fruit, nuts and rice were given, although I was only able to hear occasional explanations as to what was going on – each of the major gods, Shiva, Vishnu and Brama were asked for their blessing, together with each of the star signs.
At the conclusion of this, apparently it is a tradition for the groom’s clothes to be ripped off by the females in the room… Sunny managed to save his jeans (although sacraficed a few belt loops) but his shirt was ripped beyond repair. The first of many different traditions we encountered as the week continued.

The next day was the wedding proper. With some time to kill in the morning, a few of us decided to catch a movie in the morning as the ceremony didn’t start until 4pm or so. We headed to the nearest cinema which was showing ‘The Hobbit’ at a reasonable time and paid the equivalent of about AU$1 for the showing!
The cinema was actually much the same as any Australian cinema, except for the 5 minute interruption near the start of the movie as the sound suddenly stopped working. Unfortunately, being the epic-ly long movie that it is, we were forced to leave before it finished, so I’m still going to have to cach it once I get back to Australia!
The wedding time arrived, and we arrived at the Catholic church it was being held at. Again, the church was much the same as any Australian one, although an above average one. The ceremony was a full mass, with communion, although it was interesting to note the small differences in how the mass proceded, such as the response to ‘The Lord be with you’ being ‘And in your heart’ as opposed to ‘And also with you’ I’m accustomed to.
The ceremony was lovely, although the two video cameras hired to film it had some rather giant lamps on them, leaving vision a little blurry after they faced at you for any period of time.

The reception afterwards was right next to the hotel we were staying at – extremely convenient! After the standard speeches, the night also turned into a Hindi dance party, together with the buffet from the other night, but with the addition of a now newly married couple rightly claiming the spotlight (literally, given the previously mentioned video cameras!)
The night concluded with us crashing Toby’s room for some drinks after the reception ended.

The next day we had a quiet lunch at Sunny’s aunts place again. Some people were rather late, somewhat understandable given the previous night. Getting up was a little bit of a struggle myself. The food was lovely again, although I was somewhat amused to see that even the nicest houses in India still have their amusing differences at times from western ones – the fans being used did not have plugs; rather the wires were put directly into the wall sockets! Completely safe :\

Early morning and we shared a taxi with another wedding guest to the airport, and we were off to Goa!

More Mumbai

January 6th, 2013

So I’ve been stuck with very limited internet the past few days due to extremely expensive internet.
For some reason it seems that the more expensive the hotel, the more they charge for internet… go figure.

Mumbai! Our second day consisted of a trip to Elephantia island – a small island about an hour boat ride from Mumbai proper. It’s known for a few cave temples cut out of the rock a short walk from the pier. The trip out was rather interesting. Mumbai is swaithed in smog most of the time, and out on the boat you couldn’t see more than a couple of kilometers into the distance. There is a huge number of boats just sitting in the harbour, and they would appear out of the smog and fade into the distance…

The caves themselves where personally underwhelming. Perhaps due to comparing them to Egypt… also despite signage saying there was a free tour guide, we couldn’t find one, and we didn’t feel like taking one of the random touts up on their offer 😛
The lunch we had after the caves was awesome though. Just a random little restaurant, but awesome food.

On getting back we did a small walking tour from the Lonely planet book, just seeing some of the local architecture. Saw a few museums and galleries which we resolved to come back to the next day.
After arriving back at the hotel, we decided to go to Jura beach – reasonably nearby to our hotel, and found a random asian restaurant, just off the beach. Very westernized and comparatively expensive, but was still quite nice. The beach itself was absolutely packed.
It felt kind of awesome to be able to actually direct the taxi home afterwards.

The next day we headed in to check out the modern art gallery. It was showing an exhibition of the artist Ramkinkar Baij, apparently the father of Indian modern art – there was a wide variety of paintings and sculptures. Having the entire gallery showing all one artist was quite interesting to be able to follow the progression of his art.
We then crossed the road to the museum. The presenter of the audio guide at the museum had a very sly sense of humour. Hightlight was the hindu sculpture collection. There was also an ancient egypt visiting exhibition, but having been to egypt we skipped through it pretty quickly.

We then caught a quick taxi ride to Haji Ali mosque – a mosque built on a rock which is only accessible by a causeway at low tide. It was extremely crowded, almost entirely with locals. We didn’t enter the mosque itself, as most of it was under construction at the time anyway.

We then attempted to get a taxi to the Mumbai Hard Rock Cafe – as Kylie attempts to go to one in every country she visits. The driver, after saying he knew what we meant, then proceeded to drive around in circles for the next 20 minutes, before eventually asking someone who did know. It was rather empty, but the staff there were awesome. It seemed the staff outnumbered the patrons about 3-1.

The next morning, we grabbed breakfast at the little cafe pointed out to us on the first day, which was unfortunately shut. Was sad we only just found it open on the last day we had in Mumbai, because it was actually awesome! But our ride to Pune turned up (organized by Vanessa, Kylie’s friend about to get married) and off we went!

Arrival in Mumbai

December 28th, 2012

More travel adventures, so more blog post time!

Leaving Melbourne at the civilized hour of 1am Kylie and myself jetted off to Mumbai via Singapore.
First time I’ve been to Singapore airport, my only other ‘hub’ destination has been Doha in Qatar. It is massive…. but we didn’t have time for shopping as there was only two hours between our flights! Rather convienient really. I’d gone and purchased a bluetooth keyboard back in Melbourne knowing this – although it hurt me to know that I probably would have payed half the price in Singapore airport.

My lack of airplane sleeping skills proven yet again, we arrived in Mumbai at 10.30 am local time, with both of us rather tired and jet lagged. Luckily customs and passport control was easy, as was our airport transfer to Anjali Inn – spotted him, jumped in a mini bus, and there!
It wasn’t until later in the day when we wanted some food we found the disadvantages of the accomodation we’d chosen. Namely the distance from any tourist attractions – or decent (safe?) food.
A one hour taxi ride into the city (for a princely sum of 500 rupees – equivalent about AU$15 and we were in the middle of the ‘touristy’ area of Mumbai, found some food from Lonely planet guide, and had a bit of a wander – buying a pair of thongs each, as we’d both forgotten to bring any ourselves.
Then, no more than 3 hours later, another hour long taxi ride back to the hotel/inn/something with some food for later.

Kylie has crashed, and I’m typing this, wondering how we’ll go with Elephant Island tomorrow, with more hour long taxi rides to look forward to.
Remind me to book further in advance for Mumbai – there were two great locations in the centre of southern Mumbai, but unfortunately neither was available for the entire three days we are spending here. In hindsight should have just stayed for 2 nights at one and the 3rd night at the other. Worth the hassle for the MUCH reduced travel time. Hindsight is 20/20 though.

NVIDIA multiple monitors on linux

December 6th, 2011

The NVIDIA drivers on linux come with a nice utility: nvidia-settings
Unfortunately when setting up multiple monitors it has no easy way of saving the config.
You can save it to an xorg file, but the file created is much more than is required to set up multimonitors.

The minimal xorg file I needed was (the entire file):
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce 6600 GT"
Option "TwinView" "1"
Option "TwinViewXineramaInfoOrder" "DFP-0"
Option "TwinViewOrientation" "LeftOf"

EndSection

I saved this file to (may be distro specific – I use archLinux)
/etc/X11/xorg.conf.d/10-monitors.conf

The only lines which may need changing are
Option "TwinViewXineramaInfoOrder" "DFP-0"
Option "TwinViewOrientation" "LeftOf"

The first one is setting the main X monitor (the monitor that gdm’s login and gnome shells header bar appear on). You can find the appropriate value by doing an xorg export from nvidia-settings
The second line is not intuitive – it says which direction the ‘secondary’ monitor is from the ‘primary’. This does not get the primary/secondary monitors from the TwinViewXineramaInfoOrder line unfortunately, but rather the ‘primary’ monitor is the screen used when there is no xorg config.

Options are
"RightOf" (the default)
"LeftOf"
"Above"
"Below"
"Clone"

This page from NVIDIA was quite helpful in setting this up.

Exporting facebook events to google calendar

May 21st, 2011

Update:This script has been updated to update dates on full day events as well.

Just a small php script I’ve been using so Google Calendar actually shows private facebook events on your calendar.
For some reason when Google Calendar sees an ics file with it’s class set to private, it thinks even you shouldn’t be able to see it on your own calendar :\

Get the ical link from facebook by clicking ‘export events’ on this page:
https://www.facebook.com/?sk=events&ap=1

<?php

$ical = "*link here*";

$file=file_get_contents($ical);
$search="CLASS:PRIVATE";
$replace="CLASS:PUBLIC";
$output=str_replace($search,$replace,$file);
header("Content-Type: text/Calendar");

// Give the file a name and force download
header("Content-Disposition: inline; filename=events.ics");
print_r($output);
?php>

Video out of sync with audio in games

April 20th, 2011

This problem has been frustrating me for ages. Almost every single game I played, the video appeared to run faster than the audio to match it, meaning the ends of all dialogue would be cut off – either by the next character starting to talk, or simply the end of the video it was matched with.

A lot of forums seemed to think this was related to either sound or video cards, so I uninstalled, reinstalled and tried the default windows drivers for each. I tried disabling the HDMI optical audio on the graphics card because they apparently can interfere with onboard sound.

Finally I started wondering if the clocks timer was simply wrong. Doing a bit of googling for windows 7 x64 clock sync, I eventually came across a few people whose clocks seemed to run slowly when enabling an option called CIA1 on their motherboards BIOS. It didn’t mention anything about audio in games, but I figured it was worth a shot.

I’ve got a gigabyte motherboard on my home machine and like most of them, it had an option called CIA2 with the following options “Disabled, Cruise, Sports, Racing, Turbo, Full Thrust” of course with options like that, who’s going to leave that disabled, or simply select the cruise option? Mine was set to Turbo.

After putting up with this issue for over a year, turning CIA2 to disabled solved everything.
Now I can enjoy Portal 2’s great voice acting without having to enable subtitles and ruin the experience 😛

Publishing shared google reader items to twitter continued!

April 5th, 2011

So I’ve added another step to my grand plan of sharing links via google reader, and I think I’ve finally got twitter to work!
It actually does facebook as well now!

Previously I was using RSS Graffiti for Facebook, and attempting to use Feedburner for twitter posting.
Now I’ve gone back to twitterfeed.
I did try it originally but it seemed inconsistant and didn’t format the feed like I wanted.
Now I’ve just used twitterfeed to import the feed which feedburner exports and it seems to all be working!

I tried out the post format of Twitterfeed to facebook as well, and it seems much nicer than the RSS Graffiti which I was using previously, although it’s served me well for a while now.

Maybe once I post a few photo based things I’ll see how it’s thumbnails work too!