Renan Rangel crunching technology for breakfast

28Jul/150

XenServer auto_poweron script

Posted by Renan Rangel

In the past, it was possible to set which XenServer VMs would auto start during boot with the host server. Since the 6.x version, this can no longer be set in the GUI and you must use command line to do the same thing (How to Setup XenServer 6.x to Auto-Start Virtual Machines).

I created a script that will help you set the VMs you want to auto start. Remember that first you have to enable your pool to autostart VMs like this:

1
2
# get pool uuid with "xe pool-list"
xe pool-param-set uuid=<pool_uuid> other-config:auto_poweron=true

After that, you can download and execute the script on your XenServer host like this:

1
2
3
4
# list all VMs and if they are set to auto start :
perl xenserver_poweron.pl
# set a VM to auto start on boot:
perl xenserver_poweron.pl <vmname> <true|false>

Get the script from the Gist below. You can move it to your $PATH and rename it to your liking:

24Jul/153

Sending AWS CloudWatch alarms to a Hipchat room

Posted by Renan Rangel

I was trying the other day to receive CloudWatch alarms on a Hipchat room, when I had the idea to use AWS Lambda to do the hard work for me, instead of having to run it on some server to receive an HTTP request from SNS.

After you create your Hipchat integration, note down the token and room number so you can use it with the Lambda function.

You need to start by creating a SNS topic to receive the alarm notifications and subscribe it to a Lambda function. Everytime you get an alarm from CloudWatch, it gets sent to SNS, which will call the Lambda function that will connect to the Hipchat API and send it to your room.

You can fing the script in rvrangel/cloudwatch-hipchat at GitHub or just copy it below. Don't forget to adjust your Hipchat variables!

Tagged as: , 3 Comments
12May/140

Public DNS Comparison

Posted by Renan Rangel

I have been using Google DNS for some time and, while I agree that it does a good job, it also has some drawbacks. I have looked for some other public DNS providers, trying to find some information about which ones do not redirect when a record is not found or that work with DNSBLs (DNS Blackhole List), but the information is not simple to find. So I decided to gather the information and display here for public (and my own) use.

Getting redirected to a search page when a domain is not found really pisses me of. I know that some of these providers (like OpenDNS) support their free service this way, but it is really annoying. The table below shows the comparison of a few services:

DNS Server IP Address 1 IP Address 2 NXDOMAIN DNSBL support Query time
Google DNS 8.8.8.8 8.8.4.4
~26ms
OpenDNS 208.67.222.222 208.67.220.220
~3ms
Level3 209.244.0.3 209.244.0.4
~4ms
Dyn 216.146.35.35 216.146.36.36
~7ms
DNS Advantage 156.154.70.1 156.154.71.1
~5ms


*NXDOMAIN - Returns a "domain not found" instead of a search page.
*DNSBL - Supports DNS based blacklists for use with mail servers.
*Query time - As measured from a server in San Francisco.

It is a shame most servers do not accept these 2 things. I guess you should keep the ones that don't do search redirects for unknown domains for desktops and the others for mail servers that require DNSBLs. Also, it was a bit surprising seeing Google DNS taking so much time compared to the others.

Tagged as: No Comments
5May/130

Debian Wheezy released this weekend!

Posted by Renan Rangel

DebianThe highly awaited stable release has reached the 7.0 version (code name "Wheezy"), brining some very interesting things along the way.

For the first time, Debian users will be able to install packages from both 32-bit and 64-bits architecture on the same systems with full dependency resolution. Also worth noting is that the installer supports software speech, making it easier to visually impaired people to install it.

Quite a few new packages I was interested in running in production have made into the release (tcptrack, finally!). The kernel was bumped to 3.2, although I will miss some of the late improvements. Notable upgrades include MySQL 5.5, PHP 5.4.4, Postgres 9.1, Samba 4 (unfortunately only the beta release) and Xen 4.1. For those out there used to Gnome 2.x, bad news: Gnome 3.x has made its way and there is no easy way to switch back to 2.x. I guess I will have to keep using Gnome 2 on Gentoo instead.

It seems that the wheezy-backports is not ready yet (or at least not visible on packages.debian.org). Sometimes it is the only way to get new versions from an official source without having to compile it yourself.

By the way, the codename for the testing release has become "Jessie".

So, prepare your test environments and lets start the upgrades 😀

Tagged as: , No Comments
2May/130

Firefox OS Simulator 3.0

Posted by Renan Rangel

Mozilla announced today the stable version of the new simulator for the Firefox OS, that you can install as an add-on on Windows, Linux and Mac.

Firefox OS and Developer Tools

It is pretty big for an add-on (~50MB as of now) but it includes the complete simulator and also the default apps, so you get to play with it pretty without much work.

Testing it for a few minutes, I was able to find a few minor bugs, but the interface remembers me of Android, specially the notification bar. The marketplace is simple and does the job, you can install apps with a few clicks touches. If you want to take a peek at the console, you just have to tick a checkbox before starting the simulator.

I am sure the Firefox OS has a long road and may not have a official device for the near future, but it sure looks promising! As a long time supporter of Mozilla, I am very interested in the project. Some mobile developers might not be too happy about having to support yet another platform, but Javascript developers will surely appreciate it!

If you want to download and test the simulator, head to Mozilla Add-Ons and download it for your platform.

5Apr/120

The Fall of the Music Industry

Posted by Renan Rangel

If you eventually wonder about those exorbitant numbers you hear about piracy, this five-minute TED talk is really interesting (and funny). It explores the numbers the music industry claims to lose to piracy (like sales and jobs):

This talk only proves that the dying music industry is in deep problems. Instead of evolving and adapting, they have chosen the long and painful path, which does not prevent piracy and only hurts customers. Just look at how crazy the fines are for downloading a single song or how you can be warned for uploading a video with background music on YouTube, or how they block the streaming of music to countries other than the U.S. (even if you want to pay!).

Here in Brazil, we have an entity called ECAD, which is responsible for collecting copyright duties. If you have a business with background music, if you pick a song for your graduation or if you throw a party big enough, you have to pay them. Not long ago, they were trying to get bloggers who post YouTube videos to pay them too. The only problem is that Google already pays them a good chunk of money. Of course, they had to rethink this "strategy" because a lot of people got mad at it (of course, it makes no sense).

I bet the music industry could be doing a lot more than they are now (which is nothing) to revert this situation. Does anyone believe that an iPod full of songs would cause a loss of millions of dollars in sales? I don't think so. Why not employ their money funding real good artists? IMHO, today it seems easier to make below-average artists famous for a brief period of time and then move to the next one, than search for good talent that is capable of creating really good material and driving crowds for years to come.

What worries me the most is that almost none of today's artists are doing incredible things. Sure, you can find a lot of good music if you search for it, but if you look at the shows, the most incredible ones are from artists/bands that got popular before the 90's. What about reaching the level of success bands had in the 80's? It would certainly be easier today, with easy access to the internet, lyrics and everything else. But it seems very difficult. Maybe the music industry is to blame, but I'm not completely sure on this one.

But there is one thing I'm sure of: the music industry, as we know it today, won't last long. It will either start to deal with the internet, or just fade away. I would certainly like to see new life into the game, specially if that can create a better environment where good bands can rise to fame.

Tagged as: , No Comments
28Mar/120

Nvidia Tegra 3

Posted by Renan Rangel

I recently bought an ASUS Transformer Prime and have being using it for some time now. This tablet is kind of special, as it is the first Android-powered quad-core tablet.

Actually, it is not a quad-core tablet. The processor inside it - Tegra 3 - has 4 cores of 1.4 GHz each, plus a "companion" core of 500 MHz. This core is activated when the device is idle and/or runs background and low resource tasks, increasing its battery life. When more processing power is needed, the other cores automatically kick in and you have got a workhorse in your hands.

Switching processes from the main cores to the companion core happens very quickly and transparently to the applications. You can see a demo of how it works in the video below:

The processor and the tablet seem to be very good at multitasking. The applications load quickly and you almost never see any lag when using the interface. The GPU also has some improvements over the previous version, featuring 12 cores. If you don't know what this little beast is capable of, check out this video:

But not only Android manufacturers are interested in the platform. Audi announced that they are going to use Tegra 3 in their next generation vehicles. Tegra 3 may even visit the moon this year. So keep an eye out for new uses of this incredible platform.

23Feb/120

Big Think

Posted by Renan Rangel

This week I found the very interesting Big Think YouTube channel. It is a collection of videos of a lot of experts sharing their knowledge, opinions, views, etc. The videos are usually short and tend to be about 5 minutes in length. If you haven't seen any of the videos, I highly recommend that you head for the website and pick your field of interest.

One of the videos I can recommend is this one, in which Larry Wall talks about 5 programming languages everyone should know today:

15Jan/120

Getting real-time information about TCP connections

Posted by Renan Rangel

Every sysadmin has a good set of tools that he works with. A nice addition to the Linux sysadmin that usually has to manage a gateway/firewall or other computers with a high number of connections is tcptrack.

tcptrack

It can show you the active TCP connections in real-time, sort them by speed, activity, etc, show how many connections currently exist and also their state. It is a simple tool but very informative - it can be very helpful when you need to find where traffic is coming from. As a bonus, it also supports tcpdump-like filters, so you can display only the connections you are looking for.

If you are using Debian Squeeze, you are out of luck (tcptrack exists in lenny and wheezy, but not in squeeze [?]), you will have to download and compile the lastest version. If you are running Gentoo, just emerge the net-analyzer/tcptrack ebuild.

12Jan/120

Fixing your Arduino’s broken bootloader

Posted by Renan Rangel

Some time ago, a friend of mine bought an Arduino Duemilanove and after a few days, uploading new code to it suddenly stopped working. After some time trying to get some fresh code into the microcontroller, we traced the problem to the bootloader. So, how to fix the bootloader if the Arduino can't even start?

Obviously, we don't have a programmer to burn the bootloader directly to the ATmega 328. Looking for other options, we found out that we could use another Arduino to burn the bootloader in the broken one, without even taking the ATmega off the board. As I already had an Arduino, we decided to give it a go.

To do this, you have to use your Arduino as an AVR ISP. The connection is pretty simple:

Although the page explains how to use the ArduinoISP sketch that comes bundled with the Arduino IDE, we had no luck trying to make it work. It seemed to start the burning process but stop just some seconds later. We tried to search why this was happening, but the information was a little difficult to find. We were using 2 Duemilanove as the page describes, doing all the steps, but no luck (at least we didn't fry the working arduino in the process) 😛

After some days, we came across this link in which someone describes a similar problem to the one we had been experiencing. We decided to test this modified sketch and we got the "ArduinoISP-dev04b.zip". After uploading it to the working Arduino, we tried again to burn the bootloader and to our surprise, it worked flawlessly! Many thanks to the person from the mega-isp project who fixed this problem.

If you have an Arduino with a broken bootloader, don't throw it away! Try to find someone to help you out and do this - now simple - process of burning a new bootloader in your defective Arduino. I hope the next versions of the IDE already ships with the new version of this sketch 🙂