Category Archives: tools

QDCSS : Quick and Dirty CSS Sprites

qdcss
Ah, spriting.

When I think about sprites, my mind goes directly to the NES, and SNES era.

snests4nintendones

The graphics were meshed together in a way that was easier to handle than multiple images. And well, now they have this nostalgic appeal. I can’t watch this without a smile.

Luigi Sprite from Super Mario Bros.

Luigi Sprite from Super Mario Bros.

As old as 10 years ago (already? :-O) A list apart published an amazing article on how to use this same idea to reduce the amount of browser petitions for images. That article is wonderful, but apart (hehe) from that, it urges people to think creatively!

Long story short, this is going to be a post on how to create a CSS sprite image and stylesheet with 100 lines of python.

CSS sprite generator python

Leave a comment

Filed under code, tools

Python and Jenkins

jenkins_logo

..
NOTE from the future:
Whoops, this was written and forgot in the depths of my drafts. So I just reviewed it and said, hey, It is acceptable to post 😀
..

The third (and probably last) post about this lovely Jenkins guy. It seems that people is right, lately I’m Jenkins man.

Most of what I do in Jenkins can be done with the Groovy Scripting language itself, usually via the Scriptler plugin to keep things organized.

I am a command line guy, and sometimes I just want to get a plain text file with the results for something, instead of firing up Jenkins, going to a build, checking the artifact or output.

In this post I’ll present how to combine a basic Groovy script, with a more in-depth analysis with a python script:

Let’s save some time

4 Comments

Filed under code, tools

Auto Jenkins Setup

jenkins_logo_ansible
I recently talked about how to automate Jenkins using job-dsl. We are going a bit further here.

Jenkins is usually the frontend for projects to check their build status, but for some, Jenkins is the product that we develop, or where we drop plugins etc. In that case, we don’t want to do this into production.

In our case we work with Open Nebula as a VM provider, so it is fairly easy to create a quick VM to test something and then just remove it. It is not as common as having your own Jenkins instance, but since I found that I was doing this quite commonly, it was time to automate.

In this post I present an automatic way to set up a quick Jenkins host. So I just have to type a command and come back later.

automation time!

2 Comments

Filed under code, tools

A better way to Jenkins

jenkins_logo

Jump around, Jump around. No maps this time, but Continuous Integration. My current work involves a lot of a software piece called Jenkins. I’ve been swimming with it the last 2 months and I feel compelled to share how we changed our ways.

This post is an overview guide on how to configure Jenkins to generate the jobs that are defined in a git repo.

let’s integrate continuously

1 Comment

Filed under code, tools

Quick Replace

This one is going to be short, it is something that would fit better under commandlinefu, tips and tricks!

What do we want to do?

Look for al the cpp files under a directory and modify all the text with foo to bar.

How to do it?

First we find all the cpp files under the current directory
find . -name "*.cpp" -print

And a possible command to replace from a file is using sed.
sed -i 's/foo/bar/g'

We just have to connect those two together to replace in all the files with a name ending in .cpp, that’s what pipes are for.
find . -name "*.cpp" -print | xargs sed -i 's/foo/bar/g'

Ta-Dah

Leave a comment

November 1, 2014 · 6:35 pm

Retrieve KML links

kmlhell

On my previous post I worked with a kml that was splitted in various networked kmz files. This was particularly annoying given that I had to track the files in my computer.

I am ashamed, this should have been automatized! And since a friend prepared a nice script for it, here it is.

get my kmls

Leave a comment

Filed under gis, tools