Jumlins TechBlog

The coding hell and the daily IT of Niklas Jumlin

July 28th, 2010

Having to synchronize some data among a Debian linux cluster, i settled on using csync2 for the job.
Here’s a short guide to set it up.
Read the rest of this entry »

March 7th, 2010

So in my desperate need to make some application shortcut look pretty in linux, i needed to extract the icon from a windows exe.

The icoutils package provides some very nice tools, one of them being wrestool which i used.
Read the rest of this entry »

January 19th, 2010

So i was troubled with how to open and display a psd file with PHP’s imagick component.

I came to the following result, apparently imagick imports all the layers, and by using the image iterator, you can go through them.
The iterator index 0 is the whole image merged together.

By using this simple code, notice the setIteratorIndex(), i succesfully displayed a few multilayered psd files.

<?php
// *********************
// *   Developed by:   *
// * Gofolo Consulting *
// *  www.gofolo.com   *
// *********************
$im = new Imagick('Visitkort_Ver1.psd');
$im->setIteratorIndex(0);
$im->setImageFormat('png');
 
header("Content-Type: image/png");
echo $im;
?>
October 10th, 2009

So about a month ago we launched the latest customer project.
Megabillede.dk
It’s a site focused on selling prints on canvas, which is an awesome product. Every functionality was developed in house. The site heavily uses javascript for the functionality for the cropping tool (beskæringsværktøj), which was a requirement for the site.
We chose to use javascript to avoid working with bloated flash or even java for that matter. And we achieved the result that was requested and even more.

July 14th, 2009

So i was asked to tell how many lines of code a project was at so far..

After some brain bashing i came up with the following, there is proberbly better ways to do it.. but it seems to work pretty nice.

grep -R --include=*.php --include=*.js --include=*.css --include=*.htm* . * | wc -l

This counts the lines in all the text types i had used in that project.

July 5th, 2009

So after struggling with absolute positioning, i finally came across the following.

* { padding:0; margin:0; }

Above removes the differences, apparently caused by different theories on when there is a margin or not…

June 7th, 2009

So while i was optimizing the graphics for a current project, i fell over this amazing tool… PngOptimizer

It really do what it promises, and so far i have found no problems with the results it produces..

June 7th, 2009

So i was battling with the need to use alpha transparent png’s for a website design, and as we all know IE6 sucks at this..

So i found this on the net: 24ways.org/…

Very usefull indeed…

Tho it lacked the possibility to only target specific areas, it was already supported to be limited to a single id and it’s nested elements. Tho i needed it for several areas, but not the whole page.

So i did a little hacking, and added possibility to have several id’s, probably not the best way but it gets the job done.

Read the rest of this entry »

June 7th, 2009

Finally, after been talking about starting a blog for a few years…

This blog is mainly gonna cover what i run into while developing code in PHP, TCL, JavaScript aswell as playing with MySQL, HTML/CSS and what else i need to use.

The blog is mainly targetted at myself, as a archiving tool for different snippets and such.