Category Archives: Development

HTML Image Mapping

One of the tasks I had to do in $DAYJOB consisted in displaying a Map of Mexico and being able to highlight each state on mouseover using HTML to do it.

Of course, there’s a dozen or so Online Image Mapping tools, but they require you click every single point of the state, and unlike USA whose states are often squares or very basic shapes, Mexico has none of that. It’s all weird and squiggly lines.

To solve this issue, I found this brilliant Gimp plugin. All I had to do is select the state by selecting by color, saving it to a channel and exporting it. The result, if I may say so, is pretty darned good. If you have issues with the color selection tool, remember you can tweak the treshold values for the color selection, so that it selects more or less similar colors to the one you chose.

I decided to license the file as Apache License 2.0, and the code’s available at Github for forking. I hope this’ll help fellow Mexicans, as I found absolutely no usable Maps of Mexico for HTML that worked in the crappiest of browsers (Internet Explorer) and didn’t require Flash.

If you’d like to make your own map, the Gimp HTML Img Map plugin page has an excellent tutorial, my recommendation when exporting this, however, is to set the treshold for smoothing to 0.

Liberated Pixel Cup

The Liberated Pixel Cup

I haven’t been so excited about a Contest since my first Science Fair back in Elementary School…

The Free Software Foundation, Creative Commons and Open Game Art have announced….

The Liberated Pixel Cup!

The contest itself is divided in Two Parts:

The first part will have Artists make Sprites and Music throughout the month of June, with prizes being given out to the best Artists / Sprites. The art itself has to be CC-By-SA and GPLv3 to participate, and the actual style guidelines will be published on June 1st.

The second one will have Game Devs make Libre Games (That is, Licensed GPLv3) during July, using those Sprites and Music, using any programming language you want, as long as it runs on a 100% Libre Environment, which probably means Fedora or Debian. This means no Flash or Silverlight, .NET or even Oracle’s Java, but Gnash, Moonlight, Mono and OpenJDK are allowed. Your game can also run on any other platform, but it has to run on a GNU / Linux one at least.

The Rules and The FAQ are in their site, and they’re actively working on clarifying some of the points in the contest, so if you have a question, hop on #LiberatedPixelCup on Freenode’s IRC.

I intend to participate in the Contest, so I’ll keep the details of my entry to myself for the time being ;)

Game on!

What I’m thankful

It’s Thanksgiving day in USA, and while I don’t get the day off, I did want to write down a couple of things I’m thankful.

  1. The Fedora Project. I run Fedora 16 on my laptop at home and at work, as a Media center at my Dad’s room, and Fedora 14 powers both my brother’s and my dad’s laptops. I really like the Fedora as my base of operations.
  2. Android. And Cyanogenmod. And all that’s in between. My phone (Currently a Galaxy SII) and my Tablet (Nook Color) are both powered by CM builds I’ve modded and built on my laptop. I like tinkering with my devices at the source code level.
  3. KDE. This one’s a surprise to me, as I’ve never really liked KDE, but given the options of Shell or a hard place, I chose the lesser of two evils, and I’m happy I did and am sorry it took so long for me to switch.
  4. Having a job that I like. While my job does not consist on creating Free Software (That would rock!), I do get to use Fedora 16 at work, and happen to run the RHEL/CentOS/Solaris servers that need maintenance. Not using Windows at work is a blessing.
  5. Friends and Family. I’ve met a lot of people, online and off, and there’s a lot I can count as my friends. I’m thankful to have met every one of you, but I’m specially thankful I met, Laura, my girlfriend.

It’s been quite a while since my last blogpost, lets hope this brings me up to the habit of blogging more often.

Happy Thanksgiving Day!

Programmers’ Day

To be honest, I prefer the term “Developer”, but September 13 means it’s yet another Programmers’ Day.

It’s celebrated on the 256th day of the year, which means it falls on September 12 on Leap Years, and 2 years ago, it became an official day in the Tetris Motherland.

Apparently we’re supposed to wear white to celebrate the occasion (Or 0xFFFFFF in RGB).

Either way, Tip of the Hat to all the Open Source Devs out there, go out and celebrate. Carpe Diem and what not.

Edit: I just remembered this XKCD comic. Thought it was appropiate to post it here.

MyCloud: Part 0 – Plant your Cloud

Since Cloud Hosting seems to be all the rage these days, and given the fact that I’ve basically outgrown my host (Thanks guys!), I decided to set up a Virtual Private Server (VPS). Rather than just having all the fun by myself, I decided to document the process on how to “Build your own cloud”.These guides assume you have basic vi knowledge.

Part 0 is getting your own piece of cloud by choosing a good provider. There’s a lot of them, but the ones I can vouch for are TDRevolution, DreamHost and eSecureData. Amazon’s EC2 and Rackspace are also hosts I considered, but I prefer having a fixed cost and not the “pay-per-byte” schemes. For the record, I rented eSecureData’s Jr Server, which at the moment costs $19 bucks a month. (You pay $38 bucks the first month, which covers first and last month)

After you choose your host, you need to choose your distro. Since choosing your distro is the same as choosing your sword, I chose the sharpest one available: Fedora. Since the Jr Server only has 512MB of Ram, and Fedora 15′s Anaconda apparently requires about 950MB to install, they couldn’t set it up with Fedora 15, so I’m using Fedora 14 at the moment. If you bought into the hype that “Fedora is not for servers” that’s fine, get Red Hat Enterprise Linux 6 instead.

So, after choosing your server’s name wisely, you want to make sure that whoever’s setting up your host that you want a “server-like” install. In my case, they set up a Fedora 14 with Gnome and all. I wanted a headless server, so as soon as I logged in, I proceeded to clean out the garbage.

Step 1: Make sure the server starts in run level 3 rather than run level 5. Just vi /etc/inittab and look for the last line. Make sure it looks similar to this:

id:3:initdefault:

In case you’re new to Linux, Wikipedia explains init. 3 is for terminal-based. 5 is for graphical-based. If you remove Gnome and gdm, you’ll need to set up so it starts in run level 3. Reboot and make sure its still operational and on Run level 3.

Step 2: yum groupremove gnome-desktop. This will remove all Gnome-y apps that we probably won’t run on a server we want to set up as headless.

Step 3: yum update -y. If this wasn’t obvious, this will update your machine. If you’re using a VPS and are on Fedora 14 or above, you probably want to disable deltarpm, in my case, it takes longer to rebuild the packages than to download them. Reboot after you’re done.

Step 3.5: vi /etc/yum/pluginconf.d/presto.conf. The line where it says enabled=1 ? Make sure it’s enabled=0.

Congrats, you’ve just completed the hardest growing your own cloud server. The rest is comparatively easy.

Why this Freetard sides with Android

This is a reply to Ryan’s Why I’m a Bad Freetard — Or the Quest for a New Phone.

It’s no secret that I’m an Android Fanboy, I really like the platform, and the idea of an “open” cellphone, but I’m well aware of its flaws.

For starters… Google has yet to ship Honeycomb’s source code, to which I say “What Honeycomb?”.

I’m sticking to CyanogenMod (Gingerbread / 2.3.4) whose code I can recompile (And have recompiled in several occasions), and I won’t migrate to Honeycomb until I can actually build it. Sure, I’m not smart enough to port Android or rebuilt without using a wiki, but I’m also not recompiling my KDE packages or my Kernel and yet I still manage to use my laptop.

And to say that there’s no community of Android enthusiasts is just wrong. There is a real community of both Android users and Android developers.

CyanogenMod is the closest we can get of an “Android Distro”. There’s others, but I’m proud to say that I’ve contributed one thing to CyanogenMod: Trackball Answer.

Sure, my contribution will never be accepted by Upstream (Google), but then again, I also never considered BlueBubble to be accepted by Fedora either, and that’s not stopping me from trying to help others.

And Android also has its fair share of Users. There’s a Facebook-like site dedicated around them, an awesome online store and even its own kind of hat. Hell, a bunch of Android Users got together to have an awesome Barbecue last year (And are planning on repeating it), and even managed to get about 1000 bucks towards a Cancer Research. Sorry, but I’ve never seen Apple fans do any of this.

Yes, Carriers are really screwing over their customers. Yeah, some hardware manufacturers really hate Freedom. Yes, Google is evil and is trying to datamine our every move. Yes, Android doesn’t follow The Open Source Way. Yes, you have to “root” the phone to make it kick-ass.

I’ve seen a lot of people complain about having to “Jailbreak” iPhones or “rooting” Androids to make’em awesome. I had to do the same with my laptop.
It came with Windows 7, and there’s no way I would’ve bought it if I couldn’t replace it with Fedora. And it wasn’t “Stock Windows 7″ either. It came with a lot of annoying crapware, and trialware too, so this isn’t something that’s exclusive to Android.

Would I have rather bought a laptop that came with no Windows? Hell yes I would’ve. But they’re so hard to find, I might as well just pick one I can wipe, and move on. The same logic applies to my phones, tablets, etc.  I won’t purchase an Android device that I can’t easily root.

I guess there’s a huge difference between Fedora and Android, and that’s fine. At the end of the day, my cellphone, like my laptop, is just a tool I use to do stuff. And I’ll pick the best damned tool I can get to do it.

Fedora Packagers Cube

Man's best friend?

A while ago, I created a Fedora Users Cheat Cube, some sort of a Cheat Sheet, in Cube form, which is something that can be handed out in events.

For FUDCon Tempe, I decided to create the Fedora Packagers Cube, and handed out about 10 of these. Mat Booth already built his, and you can have your own. The PNG and SVG have been uploaded to Fedora’s Marketing Collateral page.

I hope Packagers find these useful, and if there’s any bugs on the cube, feel free to let me know so I can upload a v0.2

I am l10n. Hear me roar.

Update: I took down narro while I work out some bugs and quirks. It should be back online (And greatly improved) next week.

Localization, more often known as “l10n” is a huge pain in the ass of any project.

So I’ve set up a Narro instance on l10n.k3rnel.net (Or lion.k3rnel.net if you prefer) that’ll host the strings used in CyanogenMod.
So far, I’ve got the Phone app set up. It’s a manual process for now, but I intend to automate it. The scripts I’m using will be released once I’m comfortable with them.

How to use Narro

  • Create an account. Humans only. Don’t make me implement a crappy captcha.
  • Go to your Preferences page and select the language you’ll be translating in. Don’t forget to click save.
  • Select a Project to translate and click on Texts. Double check that the language you selected is correct. (The dropdown on top)
  • On the Show dropdown, select “Untranslated texts
  • Click the Suggest/Vote link on a text you’d like to contribute.
  • PRO-TIP: Check the “Proceed to the next textcheckbox. It’ll make things easier.
  • If you can translate it, Type in your Suggestion and click on Save.
  • If you can’t translate it, click Next.
  • You can also Vote on Texts that Require Approval.

One final note: This project is currently unofficial. It’s currently not endorsed by Cyanogen or the CyanogenMod Dev Team.
The translations you provide may sit in limbo forever (Though I certainly hope they won’t)

Bugs? Comments? Want to coordinate a specific language? Let me know in the comments here, or ping me on #k3rnel on Freenode

Try CyanogenMod 7 on the Android Emulator

Update: I’ve updated the emulator image. The instructions are exactly the same, but you get newer goodies.

Disclaimer: I am not allowed to call this image “CyanogenMod” and this does not represent the project’s quality. This is only a kang.
As of this writing, CM7 has yet to hit “alpha” status. However, the following images were compiled using CM7′s Source.

Android Devs and Android Phone Modders should like this. A couple of days ago, Cyanogen added some code that allows us to build emulator images.

I decided to try it out and it works!

So, I decided to create a User Repository you can import.

To install, simply run the Android AVD Manager you’re already familiar with, and under Available Packages, click Add Add-on Site and type:

http://nushio.fedorapeople.org/cyanogenmod/repository.xml

I’ll update the images with official releases once official releases are out (And only if the CyanogenMod Team doesn’t provide emulator images themselves), but for the meantime, you can enjoy the emulator with some CyanogenMod 7 Goodies built in.

Thinking Out Loud: Linux App Shop

Apple’s Mac App Shop made about a million bucks in a single day, and it got me thinking… How would a Linux App Shop work?

The culture around this OS seems to be on Free (as in Freedom), and who would pay to use Gimp or Pidgin when they’re freely available in their sites? You wouldn’t have to.

Software would be downloaded and installed as easily as ever, using yum, apt-get, emerge or your distro’s favorite installation tool.
What I’d add is a donation button. Make it convenient and easy for users to give back, and they will.

And that got me thinking… What donation system would work best for this case? Paypal? Google Checkout? How about Flattr?

Flattr works in the following way: A user can set a defined quantity (Lets say 20 USD) per month. The user can click the “Flattr this” button on the apps he likes, and at the end of the month, his 20USD is divided by the number of developers he ‘flattered’.

Implementing Paypal and Google Checkout would also be welcome additions to the system, as many already have those accounts set up.

Donations would go towards the project, which hopefully means that the projects might get more developers, more features or just improved user interface features.

Alright, so with this said, it wouldn’t be much of an “App Shop” as it would be some sort of an “App Tip Jar“, but I still think it would work.
If you build it, they will come… Right?