Friday, August 16, 2013

Web page screenshot with Javascript, based on html2canvas

Last week I had to do some screenshots in javascript. I don't really know javascript, so I went with Google. It really can't be that hard... After an hour of copy-pasting non-working examples, I finally managed to come up with the following, that actually works in Firefox and Chrome, and it should work in Explorer 9 or newer.

Note: this is not my original work, just the result of an hour of Google. Most parts from html2canvas.

Full page html:


<script language="javascript" src=""></script>
<script language="javascript">
function ScreenShot() {

html2canvas(document.body, {
  onrendered: function(canvas) {
    var img = canvas.toDataURL();


<input onclick="ScreenShot();" type="submit" value="ScreenShot" />

The important stuff (that worked in a Moodle HTML block):

<script language="javascript" src=""></script>
<script language="javascript">
function ScreenShot() {

html2canvas(document.body, {
  onrendered: function(canvas) {
    var img = canvas.toDataURL();


<input onclick="ScreenShot();" type="submit" value="ScreenShot" />

Saturday, May 25, 2013

Ubiquiti Unifi POE (update for UAP-AC)

As Ubiquiti released the UAP-AC, here is a quick update to the older post:
  • The UAP-Pro does support standard 802.3af POE;
  • The UAP-AC supports 802.3at POE+. According to the datasheet, this AP uses 22W of power, and since standard POE can only supply 15.4W (at best), this baby really needs the max. 30W from POE+.
While the POE+ requirement might be a show-stopper for us, standard POE implementations are definitely the way to go for Ubiquiti.

Tuesday, May 21, 2013

Fun factsheet for HP Procurve 2524 and 2512 switches

To celebrate the release of the 5.77 software and our undying love for the Procurve 2500 series, here is a handy factsheet for the 2512 and 2524 switches:

  • These are layer 2 switches;
  • So they don't have DHCP snooping capabilities;
  • Nor any ARP inspection (DAI).
  • They can't do IP routing, or NAT.
  • Only 1 trunk interface is supported.
  • LACP is supported.
  • Traffic distribution over a trunk is based on MAC addresses.
  • No layer3 ACLs for switching. (Just for the control plane).
  • They have 2 hardware priority queues.
  • They only support L2 COS, not DSCP or TOS.
  • They support voice vlans, but only for QoS purposes, not signaled in LLDP/CDP.
  • They support RSTP, not MSTP.
  • They do support LLDP, but no LLDP-MED.
  • They support CDP in receive-only mode.
  • They support GVRP.
  • They do not support POE.
  • They use the same software as the unmanaged 2300 series.
  • They use the same expansion modules as the 2300 series.
  • There is a proprietary gigabit stacking module for these switches.
  • They can be "stacked" in a master-member fashion, but don't expect much.
The next possible feature of the series might be the 2600 series, which also received new software in December.

Sunday, May 19, 2013

Cheap certifications to help start your IT career - episode 1

Okay, I know the title sounds dodgy, but I'm not going to sell you anything. Not cheap exam PDFs, not braindumps, nothing.

Getting a BSc or MSc takes years (and money), and sitting exams for major certificaions (MCSE, CCNP, etc.) also takes time and also costs decent money.

The following is a list of fairly easy and cheap entry-level IT certificaions, to get you started. The list is not comprehensive, so look out for follow-ups.

If you want an MS certification, the MCSA is not your only option. Gettign a single MCTS (Technology Specialist) is better than nothing, and the new MTA (Technology Associate) certifications -while aimed mostly for students- ain't too bad either. They are around $120 in developed countries, and around $75 in developing countries (including East-Europe). MTA topics include server OS, networking, security, .net development, etc.

Servers: HP
HP offers free web-based training and non-free exams for its servers and networking tracks. Look for the ATA and ATP levels, where "HP2-" exams are needed on ExpertOne. One exam costs around $20, but this information is a bit old.

I do admit, I'm a bit biased towards Brocade at the moment, as I'm getting ready for my BCLP. Still,they offer free training material and $20 exams for their accreditations, which is nice. For details, see this previous post.

While not the most recognized networking vendor in Europe, they do some serious stuff, and you can get several ZCNP certifications (training+exams) for free at their education website. Certification tracks include switching, security, FTTx, xDSL, VoIP, WiMax, etc., so it's fairly diverse.

Now Juniper is a recognized player in the networking field, and with their fast-track program, they offer free web-based training and 50% vouchers for some exams, so they are below $100.

So even if you're coming from the east, with not a lot of cash to spare for exams, you can still make do. Also, look out for offers from anybody, so check their facebook, linkedin, website and whatever else they have.
If you have more recommendations or recent experience with these, comments are always welcome.

Thursday, May 9, 2013

Brocade BCLE and BCLP news

To celebrate my achievement of getting the BCLE, Brocade decided to retire the certification and also refresh the BCLP 2010 to BCLP 2013. The BCLE will be incorporated into the BCLP 2013 and the Internetworking Track will be re-designed a bit with a possible new certification.

If you're interested in getting BCLP certified, be sure to visit the Brocade communities in the near future.

Recommended study materials include:

ServerIron ADX 12.5 Administration Guide 53-1002682-01
ServerIron ADX 12.5 Advanced Server Load Balancing Guide 53-1002683-01
ServerIron ADX 12.5 Firewall Load Balancing Guide 53-1002684-01
ServerIron ADX 12.5 Global Server Load Balancing Guide 53-1002685-01
ServerIron ADX 12.5 Multitenancy Guide 53-1002693-01
ServerIron ADX 12.5 NAT64 Configuration Guide 53-1002690-01
ServerIron ADX 12.5 Security Guide 53-1002686-01
ServerIron ADX 12.5 Server Load Balancing Guide 53-1002687-01
ServerIron ADX v2.0 ARB Admin Guide 53-1002509-01
ServerIron ADX OpenScript Programmer's Guide 53-1002691-01
Best Practices for High Availability Deployment for the Brocade ADX Switch GA-BP-453-00
CLE 202 Course
CLP 240 Course
ADX-TS 300 Course

Tuesday, April 23, 2013

Brocade certifications, with spotlight on the BCNE and BCNP

If you are coming from the wild east, chances are you have problems with paying loads for certification exams: a CCNP can easily cost 3 times $150. And if your company doesn't pay for it, but instead it comes out of your lunch money, this can hurt. Been there, done that, wasn't funny.

Good news is, more networking vendors are starting on the "fast-track" course, providing you with short and cheap options to migrate your CCNA to their gear. Brocade is no exception, and they are still running the course, where you get BCNE training+exam for $100. I even blogged about this a while back.

Brocade has two levels of certifications: Accreditation and Certification.
Accreditation exams include the IP Specialis (BAIS), the Campus Networking Specialist (BACNS), WLAN Specialist and my new favorite, the Physical Security Specialist, which I consider a fresh, new and actually useful thing. These are basically web-based exams for $20. Fair enough.

Certification exams are the usual drill: proctored by Pearson VUE, multiple choice and they cost $150. Here comes the good part again: once you have a few of accreditations, you could join the various Brocade certification groups on LinkedIn; I assume you're already a member and all. Now this is where things happen: sometimes you can get deals on certification exams. So far I managed to get all 3 of my certs for free (with 4th possibly on the way), which I consider fairly cheap. Also, the guys are fairly helpful if you need help with your exams.

Training material: Brocade University runs some free web courses, and free assessment tests for the certification exams. Other goodies include "Nutshell" study guide PDFs and documents on the MyBrocade pages. Also recommended is the old Foundry mailing list, and possibly picking up an old FWS24 on eBay, as they are dirt cheap and decent boxes.

Disclaimer: yes, this has been a partially sponsored post, but it's good for you, so it's okay.

Sunday, April 14, 2013

Resilient backbone with stacked 3Com 4050 and D-Link DGS-3324SR

As part of our network resiliency project, we decided to deploy a redundant trunk connection between the main and secondary server rooms. The main room houses our core 3Com 4050 cluster, and the secondary has a pair of D-Link DGS-3324SR boxes. Both of them support multi-chassis trunking, which is very nice of them.

3Com 4050 clustering

The 40x0 series supports the 3Com XRN stack technology, which can be implemented for long-distance on a GBIC, or short-distance with an XRN fabric module (which we use). Here comes the XRN fabric FAQ:

  • The fabric bandwidth is 8Gbps;
  • Link aggregation (trunking) uses IP-based hashing, or falls back to MAC-based hashing. It's not configurable;
  • Distributed link aggregation has "Intelligent Local Forwarding": it tries to avoid using the fabric link if possible. If a frame was received on switch1, it'll use a link aggregation member link on switch1, not on switch2. This can lead to some asymmetric traffic flows.
When building the stack, you're best off with the new member reset to factory defaults. I actually had to reset both members, as I had some issues when entering the Bridge/Vlan menu, and it crashed both CLI and GUI. I had the same issue with some 3Com 4400 stacks.

D-Link DGS-3324SR cluster

This platform supports clustering more than 2 switches, using HDMI-like stacking cables. You can use linear or loop topology. Stack bandwidth is 10Gbps.
Multi-chassis aggregation is supported, I just had some issues with the 'traffic segmentation' feature. The GUI only reported "error", the CLI was more helpful. Traffic distribution can be configured system-wide for a combination of MAC/IP, source/destination/source+destination. No such thing as the 'ILF' on the 3Com, traffic will leave the ports based on the hash.

Plugging in the wires

Both switches support LACP and static, I went with static. I had some RSTP issues earlier between them, so vlan1 untagged on both sides is a must, even if you use something else as the management vlan. I even managed to achieve extra redundancy by not using the same 8 core fiber for both connections, but routed one of them through another building.


The 3Com provides an SNMP object for the XRN fabric interfaces, so you can monitor the bandwidth of the stack link (no such thing on the DGS), but it won't provide an SNMP object for the aggregated AL1-13 interfaces. MRTG can be configured to do basic arithmetic, so you can measure the bandwidth of multiple aggregated links together.

Sunday, February 10, 2013

HP MASE (and ASE) Networking practice exams

While still working on my ASE and MASE certifications, HP sent some good news into my inbox a few weeks ago: online practice exams!

Not free, but not too expensive: $50 for "developed markets" and $20 for "emerging markets", based on your login IP; you can take them 5 times within 1 year.

At the moment they only have 2 exams for the MASE level, but I'd guess if you ace your MASE practice, chances are you'll manage your real ASE exam just fine.

HTML5 video live streaming with ffmpeg and mediaelement.js, Round 1

In the era of HD home-videos on YouTube, our current delivery method for online classes in low quality Flash videos is getting kinda unacceptable, especially for maths-type subjects, where it would be nice to actually all those numbers and figures on the whiteboard.
So, enter HTML5 video, H.264, mpeg4 and possibly a new encoding server... Our main problem is that we want to print some custom stuff on the videos, so we need to encode them in realtime.

The player of choice is mediaelement.js, because it comes with the promise on the tin that it just works. Just how we like it.
So, after checking out the samples, the player code looks like this:

<video controls="controls" height="360" id="player2" width="480">
  <source src="relay_video.php?quality=0&id=1469&format=mp4" title="mp4" type="video/mp4"></source>
  <source src="relay_video.php?quality=0&id=1469&format=ogg" title="ogg" type="video/ogg"></source>
  <source src="relay_video.php?quality=0&id=1469&format=wmv" title="wmv" type="video/wmv"></source>
    <object data="flashmediaelement.swf" height="360" type="application/x-shockwave-flash" width="480">
        <param name="movie" value="flashmediaelement.swf" />
        <param name="flashvars" value="controls=true&file=relay_video.php?quality=0&id=1469&format=flv" />
        <!-- Image as a last resort -->
        <img src="noflash.jpg" width="480" height="360" title="No video playback capabilities" />

So far so good, let's give it some video files. Transcoding happens on-the-fly either with mencoder or ffmpeg. As we prefer ffmpeg, let's try to do everything with that.
Large parts are from John's ffmpeg post here:

Problem 1: we don't have libvpx support compiled in; for the time we'll try to live without it.
Problem 2: old IE versions. They should at least have native support for WMV, either with Silverstripe or otherwise. FFmpeg supports WMV, so this might actually work.
Problem 3: This is a hard one: ffmpeg can't mux into mp4 on a non-seekable output (ie. socket). Wikipedia tells me that WebM is actually based on Matroska. FFmpeg loves Matroska, we can do this.

So, our current format - container - vcodec - acodec groups are as follows:
mp4 - matroska - libx264 - libfaac
ogg - ogg - libtheora - libvorbis
wmv - asf - wmv2 - wmav2
flv - flv - flv - libmp3lame

And: it works so far! The Mozilla guys are open source believers, so Firefox automatically selects ogg. Chromium uses mp4, or in absence of that, falls back to ogg. A few things to try: iPhones might possibly not like the Matroska container, but supposedly they can do mpegts. Problem with that is that Chromium does not work with that, but doesn't fall back to ogg either.
So for that, I'll try:
mp4 - mpegts - libx264 - libfaac
webm - matroska - libx264 - libfaac

Other problems might arise while finding ancient IE version to test with, and maybe on OS X. If I find more out, there'll be a round 2 of this post.

Saturday, January 26, 2013

Linux filesystem overhead comparison

I needed some temporary data storage for a few days for a migration project, so I wanted to know which filesystem to use, that would give me the most available space.
I'm not considering security, journals or anything here, I just need the maximum amount of space possible. Tests were done on a 2TB SAS disk in a Dell MD1000 array, configured as a one disk RAID0 on a PERC5e controller. The tested ones are the most basic Linux compatible filesystems, by no means is this test academic or universal. The results did surprise me a bit:

I expected FAT to be among the top ones, as it's not a very sophisticated fs, and didn't expect much from ext2/3. I'm also a bit biased towards XFS, so I kind of expected better results.
Tests were done with default mkfs.* settings, only exception is root reserved blocks on ext2/3, which were set to 0. The above output is from df -m. I didn't always pay attention in Operating systems class, so the results of minix surprised me a bit.

I have a sort of love-hate relationship with reiserfs, but for today, it earned itself a job.