Friday, 20 September 2013

Scratch Your Itches: Grabbing Siemens Gigaset sx762 modem stats with Ruby

Grabbing Siemens Gigaset sx762 modem stats with Ruby

The problem:

So, my Internet connection can be finicky at times; it has a tendency to collapse the download speeds to un-browsable levels at the worst possible times. At those times I usually just want to quickly find out if it's just the current speed that has dropped, if it's also the max speed, or if it's just my imagination.

Normally this means that I have to:
  1. go to the built-in web-interface of my modem (a Siemens Gigaset sx762);
  2. enter the modem's password;
  3. click through a 'Security Advice' screen that complains I have an ethernet connection connected to the modem;
  4. find my way to the Status page; 
  5. finally get to click on the link to the Internet statistics sub-page;
Once there I have to skim through the irrelevant data to find the stats I'm interested in.

Scratch that itch!

Needless to say I got tired of having to use the annoying web-interface and wasting my time clicking through warnings.  It was becoming one of those 'itches' I've blogged about before, and I decided it was time I'd do something about it!
So, I opened my favourite text editor (Textmate2), looked up the cURL manual, looked at the sent headers in the network tab of Chrome's element inspector and automated the process into a simple Ruby script: router_statistics.rb.

The code:



Scratch be gone!

Once I run this baby in my console, it will return the current and max Up- and Down-stream speeds (and noise levels), as well as my external IP and MAC addresses and uptime.

The code might be quick and dirty, but it's a nice hacky solution that will save me some time and frustrations. :)

Related searches on Google+:

#ScratchYourOwnItches   #coding   #Siemens   #Gigaset   #sx762   #FiXato  #FiXatoBlog   #Github   #FOSS   #OpenSource  #Ruby #cURL

Saturday, 10 August 2013

What non-tourist things can I do while in the Netherlands?

... or where to find some nice beers and snacks

If you're planning to visit the fine country called the Netherlands, but prefer to avoid the typical tourist things to visit, or just want to know about my favourite places to stroll around and enjoy a broad selection of beers, snacks and other food & drinks, then carry on reading!

Amsterdam

Amsterdam is the capital city of the Netherlands. It's located in the province of Noord-Holland, and to many tourists it's probably mostly known for its infamous Red Light District and soft-drugs selling coffeeshops, however to the Dutch people it's way more than that.
Begijnhof, Amsterdam
Photograph by David "dbaron" Baron
Licensed as Creative Commons BY-SA-2.0
Most Dutch people I know prefer to associate Amsterdam with the many startups founded there, its rich social culture, the many lovely brown pubs, its architecture and colourful events.
While it's not my favourite city of the Netherlands, I will start with it since most tourists will know it and will probably be staying in it.

Begijnhof

If you need a little peace and quiet after walking through the crowded and noisy city centre, be sure to visit the inner courts of the beguinage the Begijnhof.
Once you close the door behind you, you also shut out most/all of the sound from the bustling city and get some peace and serenity in return.

Brouwerij 't IJ
Photograph by Börkur Sigurbjörnsson
Licensed as Creative Commons BY-2.0

Brewery/Brouwerij 't IJ

If you feel like trying out some local beer and thinking of visiting a brewery, then avoid the tourist trap that is the Heineken Experience Museum, and visit Brouwerij 't IJ instead and consider taking one of their tours. One of their breweries is located near a windmill, so you get to see a typical tourist thing too.

Meetups in Amsterdam

You could also have a look at what meetups are held in Amsterdam during the period you'll be staying in the Netherlands.
To give an idea of the variety available:

Wonderful view at the top of the Public Libary of Amsterdam

The Openbare Bibliotheek Amsterdam is a big public library located near the Central Station. It has several floors with various kinds of media such as books, CDs, DVDs, audio-books, etc. However, the best place for me is the top floor, where they have a nice restaurant, which has an outdoors seating area with a wonderful view over the city of Amsterdam. Especially on a clear and sunny day, I would suggest taking a small detour before heading into the city centre, and visit this lovely viewpoint.

Beers from all over the world at Beer Temple

List of the Beer Temple's draft beers
Licensed under Creative Commons BY-NC-SA-3.0
by Filip H.F. "FiXato" Slagter.
I recently paid a visit to the Beer Temple in Amsterdam for the first time. One of the reasons for visiting this bar was the wide variety of beers from all over the world, so I could hopefully try a few of the American stouts that +Steve Restless had recommended to me, especially since they mostly seem to focus on the beers from the USA.
List of the Beer Temple's bottled beers.
Licensed under Creative Commons BY-NC-SA-3.0
by Filip H.F. "FiXato" Slagter.
While the beer which I wanted to try, the Southern Tier Crème Brûlee Stout, was a bit too expensive for me at €20 for about 65 cl / 22 floz, they did have quite some cheaper IPAs, stouts, ales and other beers to pick from. Read my Google+ post about my first visit to the Beer Temple for more details.
They also serve various snacks and if you need more than a snack then visit one of the various restaurants nearby. My favourites are 't Pakhuis, Carel's 3 and De Bekeerde Suster. Feel free to also read my Google Local Local Guides review of De Bekeerde Suster, Amsterdam.


Take the train to other cities

And instead of just visiting Amsterdam, and the common tourist trap towns like Zaanse Schans, try visiting Utrecht for instance. If you feel adventurous, you could also just get on a random train to visit some random city with a weird and perhaps for you unpronounceable name!
Use intercity trains if you prefer to go to more busy cities, or get on a all-stop train (stoptrein in Dutch) and get off at a smaller station for more rural towns with less activity, but perhaps more interesting sceneries.

Visit Utrecht

Utrecht is the capital of the central province of the Netherlands by the same name, and is a fine city whose city centre features buildings from the Early Middle Ages. It's a big city with a nice cosy atmosphere, and it's for that reason I actually prefer Utrecht over Amsterdam. On many occasion I've visited Utrecht, and stayed there for quite some weekends, visiting friends, going out and doing some shopping.
If you are up for a nice long walk, I would suggest trying out this walking route:

City Centre

Walk from the train station via the Stairway to Heaven rock café towards the Domkerk (Dom church, or St. Martin's Cathedral). Perhaps even be the tourist and have a look inside.
Domkerk (St. Martin's Cathedral), Utrecht
Photograph by Filip H.F. "FiXato" Slagter
Licensed under Creative Commons BY-NC-SA-3.0.
Then walk around the Domkerk and from there carry on along the old channel (Oudegracht). This will take you through the city centre, with the usual shops you'd expect in a big city.

Kafé België and Tivoli Oude Gracht

As you keep walking along the Oudegracht, be sure to pop by Kafé België and order a lovely Tostie België (which is a ham/cheese toastie with garlic/herb butter and red onions), and wash it down with one of the more than hundred international beers they have. Have a look as well at my Google Maps review of Kafé België (TXT-backup).
Continue your walk along the Oudegracht and perhaps cross one of the bridges there to visit the concert venue Tivoli Oudegracht to check if there are any interesting bands playing that day. If you are lucky, perhaps an awesome up-and-coming Dutch metal band will be playing.

Twijnstraat

As you carry on along the Oudegracht, it will turn into the Twijnstraat, a small shopping area with an Albert Heyn supermarket, an eco-friendly food shop, a liquor store with a wide variety of beers (have I mentioned yet I love the beer variety available in Utrecht?) and some other shops like a chemist to keep the local residents happy. Apparently it is Utrecht's oldest shopping street.
Yours truly sampling beers at Kafé België, Utrecht.
Photograph courtesy of +Siw Falch 

Ledig Erf and city park area

Once you get to the end of it, turn right and maybe sit down at the terrace of 't Ledig Erf and then start walking towards the train station again, but this time through one of the city's park areas. If you like to check out the architecture of churches, have a look at the Geertekerk along the way.

Observe

As you walk, observe how your surroundings change from the average world city shops to quaint little shops (such as the Angel Shop and the various board-game shops) to cosy pubs and lovely city park areas. Take some time every now and then to stop, look around, visit some shops and have a closer look at the architecture.

Google Maps Route:

If you are interested in following this route, or having a closer look at it, then you can check out the route I've plotted through Google Maps.

Visit Haarlem

Haarlem is also worth a visit and is easily accessible by train. Haarlem's railway station is also our oldest railway station.
This capital of the province of Noord-Holland has a couple of nice parks where you can kick off your shoes and relax, such as the Kenaupark and De Haarlemmerhout.
As for museums and other sights to see, have a look at the Sights and Sounds page of Haarlem's tourism website.
The oldest museum in the Netherlands, the Teylers Museum, for instance is located in Haarlem, as well as the Frans Hals Museum, which sports art from the 15th century and onwards from (Dutch) masters such as Frans Hals, Verspronck and De Bray.

Haarlem also has its own beer with many varieties, Jopen, and their brewery + bar are located in an old church.

IJmuiden and Zandvoort's beaches

If you feel more like taking a long stroll along the beaches of the Northsea, then you could consider visiting the beaches of for instance Zandvoort and IJmuiden.

From Amsterdam you could take the train to Zandvoort (though in my experience that beach tends to be rather over-crowded). Instead you could also take the train from Amsterdam Central Station to Amsterdam Sloterdijk, and from there on take the Connexxion Bus 82 in the direction IJmuiden aan Zee, and get off at the last stop, IJmuiden aan Zee (IJmuiden by the Sea).

Dunes of IJmuiden by Filip H.F. "FiXato" Slagter.
Licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Creative Commons Licence
IJmuiden's beach stretches out quite far, and is connected to the Kennemer duinen dune area through which you can also take a nice long walk. After this walk you can find various of fish & chips shops either on the beach or the promenade, or visit the centre of IJmuiden for various of other restaurants. A couple of suggestions:

  • Siam Thai Restaurant, if you are looking for some spicy Thai food, served by warm and friendly locals. The menu here is in Dutch and English and the personnel speaks both Dutch and English, as is common all through the Netherlands. Especially try their selection of starters.
  • Kota Radja, for (Dutch-style) Chinese/Indonesian food. They have both take-out as a cosy restaurant where you can sit and eat in peace.
  • Augusta, has a nice selection of posh food for lack of a better description. The food might be more expensive than the aforementioned places, but it's definitely worth it. When I last visited it with +Siw Falch the dishes were original, well-dressed, colourful and well-balanced. Especially the appetisers were a pleasant surprise as they were a delicious flavour explosion. Feel free to read my review of Augusta on Google Local for some more details.
  • Various Dutch snackbars can be found all through the city. Might be worth a visit just to see all the weird deep-fried snacks we Dutchies sometimes rave about, such as the (sateh-)kroket, berenhap, frikandel, bamihap and gehaktstaaf. If you don't like your fries drowned in mayonnaise, be sure to ask if they can put the sauces separately. Bonus points if you order it with speciaal or oorlog as sauces. ;-)
  • I think most of the restaurants are located in the Kennemerlaan, or the Lange Nieuwstraat. For fish-related restaurants I would suggest looking at the harbour and fishmarket area.

Visit Rotterdam

Rotterdam is the second-largest city of the Netherlands and for many years it had the largest port of Europe. It's located in the province of Zuid-Holland (South-Holland) and is considered part of the Randstad.
Willemsbrug in Rotterdam, as photographed by Filip H.F. "FiXato" Slagter while taking a boat tour to Kinderdijk.
Licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Creative Commons Licence
Playing a round of Carcassonne, at one of Rotterdam's many terraces.
Licensed under Creative Commons BY-NC-SA-3.0 by Filip H.F. "FiXato" Slagter.
Tourists might know it mostly for the cube houses (Kubuswoningen in Dutch); cube-shaped houses designed by Dutch architect Piet Blom back in the seventies. These unconventional houses consist of a 45 degrees rotated cube of a conventional house and is rested upon a hexagon-shaped pylon. Most of them are actually inhabited, while others house offices, an amusement centre and one of them even a museum to show how it looks inside and how people (can) live there. There's also a small chess-pieces museum located in between the houses, along with a life-size chess board.
Personally I prefer visiting that area because of the various pubs and restaurants located along the water, so I can drink a nice beer and burn my mouth on a traditional bitterbal while enjoying the view over the old harbour. If you are there around lunch time, visit Kade 4 and see if they still have their mixed lunch; I remember thoroughly enjoying their freshly baked bread with various cheese and meat toppings with a friend of mine years ago.
An old windmill at Kinderdijk,
by Filip H.F. "FiXato" Slagter.

Licensed under Creative Commons BY-NC-SA-3.0 
If you prefer checking out the shops in the city centre, have a look at the Koopgoot (Shopping gutter), which is a shopping street with shop in two levels; the shops at the regular level, and the ones in the 'gutter' located in the middle of the street. Should you get peckish and are looking for a snack, try the Vietnamese springroll stand near metro station Beurs. Looking for something more filling or a nice refreshing drink? Walk on to Stadhuisplein (cityhall square) and visit Café 't Fust; a cosy brown pub with bar made out of an old copper kettle once used for brewing Heineken. However, instead of ordering a Heineken, I would suggest ordering a Palm beer with a platter of mixed deep-fried snacks (bittergarnituur) instead.
If you need transportation then you can easily get around by using the extensive metro- and tram-network; though it might be hard to find your way around Central Station, since it still seems to be undergoing its never-ending renewal. I must say though that last time I visited, just a few weeks ago, it seems to have come a long way, and most of the construction work seems to be going on outside of the train station now. If you do want to be the tourist, take one of the guided boat tours to Kinderdijk, one of the nearby villages known for their many, still active, windmills which were once used to drain the polder.

Twelve Provinces

The Netherlands has 12 provinces; each of them with their own identity. Make use of that and explore more of the Netherlands than just Amsterdam. Even though us Dutchies like to complain about it whenever we can, we actually have a wonderful public transport system that can bring you to and from lots of wonderful places most Dutch people haven't even heard of.

So, what are your favourite places in the Netherlands?
Where do you go to drink uncommon beers and ciders, and what are your secret spots to relax and enjoy nature?

Disclaimer: I have no ties to any of the aforementioned venues, companies or institutes, nor am I getting a compensation for covering them in this blog post. I have mentioned them because I personally like visiting them, or see them as landmarks I find interesting.
This post was inspired by my replies to Max Huijgen's reshare of Cédric Lombion's post to Europeans Today (Questions to Europeans) in which Cédric asked for suggestions of non-tourist things to do during his stay in Amsterdam.


This post has been updated on the 28th of January of 2018 to fix some link-rot. If you encounter more broken links, please let me know in the comments.

Saturday, 22 June 2013

Gaming Memories

A friend of mine has been posting his personal top 100 games along with memories attached to those games and quite some of it is recognisable.
For instance, in his second post in his Top Games List, he briefly describes his memories of playing:
Snake Rattle 'n' Roll (NES) screenshot
  • Teenage Mutant Ninja Turtles (NES)
  • Fire Emblem: The Sacred Stones (Gameboy Advance)
  • Pokemon Emerald (Gameboy Advance)
  • Final Fantasy Legend 3 (Gameboy)
  • Gremlins 2 (NES)
  • Chip’s Challenge (PC)
  • Wing Commander IV: The Price of Freedom (PC)
  • Dynasty Warriors 5: Empires (Playstation 2)
  • Mike Tyson’s Punch-Out (NES)
  • Snake Rattle 'n' Roll (NES).
Of all those games, I think I only played Wing Commander, and perhaps Gremlins and Snake Rattle 'n Roll (but then for the Game Boy Classic if that is possible…)

It got me going down memory lane though, which made me wonder: are my memories about specific games in particular, or something more generic about gaming itself?

Renting games

The Videoland video store where we
rented most of our videogames.
Photograph is a screenshot of Google Streetview
For me it's mostly the gaming itself I think. Having saved up to buy a game, or being allowed to rent a game at the video store for instance. Every now and then my brother and I could pick 3 games and rent them for a short period; it was either for 3 days or a week, depending on how new the game was.

At first the games we rented were Game Boy Classic games. It was a great way of trying out games without having to fork over a lot of money only to find out it was a rubbish game after all. Especially when we were able to finish the game before we had to bring them back, it was both a feeling of achievement, and a feeling of relief that we didn't buy it. Other games proved to have a lot of replay value, and so either me or my brother would end up buying it.
Solomon's Club (GB)
Photograph by Filip H.F. "FiXato" Slagter
Licensed under CC-BY-NC-SA-2.0
We each had our own Game Boy games, but we would share the games with each other. I remember him getting Super Mario Land 1, The Hunt for Red October and Revenge of the Gator for instance, while I got Super Mario Land 2, Wario Land and Solomon's Club.

Super Nintendo Era

Super Nintendo Cabinet
Photograph by Jeremy Riel
Licensed as CC-BY-SA-2.0
Time passed, and Nintendo brought the Super Nintendo (SNES) on the market. The first time I briefly played the device was a bit of a magical moment. We had visited a zoo in Emmen and afterward we had gone into the city to shop around a bit. When we got to the electronics department of the local Vroom & Dreesman (a well-known Dutch department store), I quickly spotted the new console's playing cabinet. It was showing Super Mario World and I was instantly swept away by the music, the playful and gorgeous graphics and the smooth and refreshing gameplay. The playtime on the machine was limited, but I probably spent as long as I could playing on it.

It wasn't until quite some time later though that we were allowed to rent a SNES for about a week. I still remember that it was at the same day elections for some local government thing were being held; it's funny how memory works.
I think we ended up renting the whole package again some other time and eventually we got the system as a present from our parents; I guess my mother just loved playing it too much herself as well.
From then on we would leave the video store mostly with rented SNES games, and the Game Boy saw a decrease in playing time. It also meant looking for good deals on SNES games in game stores.
Secret of Mana (SNES)
Photograph by Filip H.F. "FiXato" Slagter
Licensed as CC-BY-NC-SA-2.0

Secret of Mana

One of the SNES rental memories was of Secret of Mana. The first time we rented the game, we couldn't get the game to work —the characters didn't want to move, or the screen was full of glitches— the downside of rental games I guess. We returned it, but weeks later we gave it another try; possibly with a better NTSC/PAL converter as the rental game was an NTSC release and we had a PAL Super Nintendo.
That time it was playable and we ended up extending the rental period because the game was so addictive (despite the graphical glitches it still had at times). After saving up for several weeks or months, I ended up buying it in a local game shop, and I still regard it as one of my favourite SNES games. Maybe especially because it was one of the few RPGs I actually finished... but apart from that the music is still great and really set the mood for the wonderful story and refreshing game mechanics. I'm still surprised so few other games have adopted the ring menus.

Not just about games

But those memories aren't just about the games themselves. It's everything around it. Being fortunate enough to be able to afford the consoles and games, getting the random games and accessories as presents, having parents who saw the positive sides of video games (feeding an interest in the gaming- and computer-industries, improving hand-eye coordination, stimulating the social aspect by playing games with/against friends) and having a mother who was a wonderful gamer herself.

The best memory of it all

I guess that is the best memory of it all for me; playing those games with and/or against my mother while she was still alive. I still miss those gaming sessions... She was quite a games fan and together we played many games on MSX2, Game Boy, SNES and N64. Mostly puzzle games such as Tetris, but also a lot of RPGs. Heck, she even got further into some RPGs that I did! If I recall correctly, she did beat Lufia & the Fortress of Doom, while I still haven't.
She was one of my best gaming buddies and it's those memories I will cherish forever. Building a city together in Sim City, trying to beat each other's times in Super Mario Kart, exploring the castle and finding all the stars in Super Mario 64, working out the puzzles together in Lufia II: Rise of the Sinistrals, visiting MSX fairs (I'll save my MSX-related memories for another post) and just spending time together.

So... What are your favourite memories? Are they related to specific games, or gaming in general?

Sunday, 2 June 2013

Scratch Your Own Itches


Scratch Your Own Itches

or creating things you care about


How to create a useful project?

People sometimes ask me how to get started with programming, to which I usually respond with a question of my own: "do you have any itches of your own to scratch?"
Usually they don't get what I mean by that, and you probably don't either, so let me elaborate.
If you want to create something, it helps if it would be something you'd be using as well. If what you make doesn't solve a problem, or have a purpose, then there's a fair chance no one will use it.
Creating something for yourself, something that solves a problem for you —in other words a tool that scratches one of your own itches— will help you keep motivated, and even if others don't find it interesting, it won't be a waste of time as it will still have a very important user: you!

My own itches:

Over the years I've had a whole bunch of ideas, but imho the most interesting or useful ones are the ones I still use myself because they solved a daily/weekly issue for me or helped reduce repetitiveness of annoying tasks.

Reddit Enhancement Suite Dashboard

Default RES Dashboard
One of my most recent pet projects is my userstyle for the Reddit Enhancement Suite, a browser extension for Reddit power users. RES by itself adds a lot of useful features to the Reddit website, such as upvote counters, tags, highlights, notification popups, and my favourite: the Dashboard.
The default Dashboard has a lot of wasted space. If you want to follow a bunch of subreddits, you kind of have to limit the amount of rows to be able to view multiple ones at the same time.
I reckoned I could improve this, especially seeing how much empty black space is left on the screen. I wanted to make the widgets a lot smaller, and fit two next to each other. I also thought that some of the buttons had too much text or were too wide, so I would want to tweak those too.
Since the RES Dashboard is just a rendered website, I knew I could tweak things by writing my own userstyle; a Cascading Style Sheet (CSS) that overrides the existing styling rules. The easiest ways to implement one on Chrome is by using an extension such as Stylish or StyleBot and writing your override rules in that. Of course you can also prototype using the element inspector or Firebug, but those changes aren't permanent.
So, after installing either of those extensions (I'm still undecided which one I like best; though I'm leaning towards Stylish) I started prototyping. Using Chrome's built-in element inspector I found out the classnames of the elements I wanted to change, and began by making the widgets smaller and turning them into inline block elements so they could fit next to each other. It involved quite some experimenting to find the best fit, and a bunch of resizing and checking on my other computer to see if it worked okay on a different resolution as well.
As I started using it more and more, I also started experimenting with other tweaks; some of them successful —such as the overlay version of the expando boxes— while others were nicer in theory than in practice for instance the widgets that would expand while you hovered over them; the constant resizing was distracting— but every idea brought me more experience and sometimes new ideas.

Reddit Enhancement Suite Userstyle
My tweaked version of the RES Dashboard.
The 'end' result (though things like these never are truly finished) probably still isn't suitable for all screen resolutions and most people might find this layout to be too cluttered, but in the end that doesn't matter, as it makes the most important customer happy; me. It scratched an itch I was having, and it makes my experience of Reddit a better one. The possibility of others enjoying these tweaks as well is merely a bonus.

Google Plus' New Layout

G+ Default single-column layout
When Google Plus (G+ for short) introduced their new layout, a lot of people were complaining about how horrible the new columns layout was; sure you could switch to a single column layout, but that only left you with way too much whitespace.




G+: Default multi-column layout
Personally I quite liked the multi-columns layout, but I didn't like the smaller width of the cards (as the boxed posts are often called) as it made YouTube videos too small, and again brought too much greyspace/whitespace with it.

I knew I could just complain about it and hope for the problem to go away by itself and in the mean time have to get used to the new smaller content. However, I realised it most likely wouldn't get fixed any time soon (if at all), and that in the mean time I would just get more and more annoyed at the layout and it would ruin my experience. So, what was I to do?

Well, I could (and would) do the same as I did for my RES Dashboard: create a userstyle that would override the widths. Within an hour I had something usable; something that increased the width of the single column layout either to the full width of the page, or to a medium width single-column layout, which was still at a legible line length. I also had CSS rules for the two-column and three-column layout

I was mostly satisfied with the three-column tweaks myself, but decided to share all of them, and some people from the community loved me for it! Some of them improved upon it, others had already come up with their own solutions in the mean time. A couple users asked how they could further tweak certain aspects, or came with suggestions for other improvements.

My tweaked G+ Three Column Layout - one of the earliest revisions.

After some more tweaking I also released the code I had as-is on UserStyles.org. I didn't really keep it up-to-date though, especially since by now more custom stylesheets have become available, and I didn't feel like maintaining this with other solutions already out there. Besides, in the end I was satisfied with what I had, and I wanted to be able to instantly tweak things without worrying about breaking things for other users. Another reason was that I had support for various layouts that required commenting out CSS rules; something that didn't really work with the existing userstyle extensions as they would strip out comments.

Conclusion

I realise I haven't really talked about how to actually get started with programming, but I think it's best for someone to first think about what they will be creating and why/what for. The more they think about their project first, the more they can get excited about it, and the easier it eventually will be to get started.