Time to try blogging from ipod

June 25th, 2009 Jacken No comments

Well, the iPhone version seems to work ok. It’s actually quite nice to be able to write in landscape mode.

Upgrading to Nginx and getting WordPress to work

June 24th, 2009 Jacken 2 comments

So, after doing an upgrade of my Apache installation all my web content stopped working. It continued to give 403 errors. After spending hours changing permissions and checking every little detail I gave up. So I installed Nginx instead. It’s a bit scary to start using a totally new web server software, but why not live dangerously? Anyway, it’s fast! Really fast. The only problem I had was to get all the redirects to work. And I also removed my gallery2 installation and moved the blog to /

Problems

It took longer than I had anticipated, mainly because I had to learn how to set up Nginx, but also because of the trouble of getting answers when searching the net. But here’s my working config (mostly saved for me if I forget :)

server {
    listen   80;
    server_name  www.jackenhack.com
            jackenhack.com;
    keepalive_timeout  5;
    tcp_nodelay        on
   
    access_log  /var/log/nginx/access.log;
location ~* ^.+\.(xml|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$
{
root /var/www/nginx-default;

}

    location / {
        root   /var/www/nginx-default;
        index  index.php index.html index.htm;
gzip            on;
  gzip_http_version 1.0;
  gzip_comp_level 2;
  gzip_proxied any;
  gzip_types      text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
   

    #include /etc/nginx/wordpress_params.super_cache
    #include /etc/nginx/enable_wordpress;

    # rewrite old blog url
    rewrite ^/blog/(.+)$ /$1 permanent;

# if the requested file exists, return it immediately
if (-f $request_filename) {
break;
}

set $supercache_file '';
set $supercache_uri $request_uri;

if ($request_method = POST) {
set $supercache_uri '';
}

# Using pretty permalinks, so bypass the cache for any query string
if ($query_string) {
set $supercache_uri '';
}

if ($http_cookie ~* "comment_author_|wordpress|wp-postpass_" ) {
set $supercache_uri '';
}

# if we haven't bypassed the cache, specify our supercache file
if ($supercache_uri ~ ^(.+)$) {
set $supercache_file /wp-content/cache/supercache/$http_host/$1index.html;
}

# only rewrite to the supercache file if it actually exists
if (-f $document_root$supercache_file) {
rewrite ^(.*)$ $supercache_file break;
}

# all other requests go to Wordpress
if (!-e $request_filename) {
rewrite . /index.php last;
}

}
# setup for jackeniax
        location /jackeniax {
            root   /var/www/nginx-default/jackeniax;
            index  index.php index.html;

            if (!-f $request_filename) {
                rewrite  ^(.*)$  /jackeniax/index.php?q=$1  last;
                break;
            }

            if (!-d $request_filename) {
                rewrite  ^(.*)$  /jackeniax/index.php?q=$1  last;
                break;
            }

        }


        location ~ \.php$ {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  /var/www/nginx-default$fastcgi_script_name;
                include        /etc/nginx/fastcgi_params;
        }

    # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        location ~ /\.ht {
                deny  all;
        }

}
Categories: web Tags: , , ,

Ylva and I have been married for thirteen years!

June 15th, 2009 Jacken No comments

And the amazing thing is that now when the kids are at their grand mother, we still know how to have fun. I’ve been laughing my ass of all weekend. So I’m on for another 13 years.

Categories: Life and times of Jacken Tags:

GPS tagging on the cheap

May 9th, 2009 Jacken No comments

GPSPhotoLinker program icon

I just love gadgets. That’s why it’s nice to find that I bought a Garmin eTrex a long time ago. Haven’t used it in years, but then when Apple released the latest version of iLife 09 with the map function in iPhoto I realized that it is very cool to have all the images geo tagged. So I found a program called GPSPhotoLinker, a program that downloads GPS data and pictures and by the date/time on the pictures manages to add longitude and latitude information in the picture info. When you import pictures with this information iPhoto can use that to show it on maps and make it searchable. And when you upload pictures to Flickr, it also uses the location information place your picture on a map. Very cool.

The software is free to download here. If you have an old GPS receiver like me, you need a serial cable (I made my own because of the very high prices for ready made cables), just check eBay. You also need a USB to serial converter, like the “Keyspan High Speed USB Serial Adapter.

To start tagging, just power on your GPS receiver when you start (I just put it in my shirt pocket) and then photo away). Set the clock in your camera (check the GPS clock, it’s VERY exact ) because this is information that is used to sync position information.

Download all your pictures in a folder, connect the GPS, start GPSPhotoLinker and download data from the GPS, and then select the folder with pictures you took. Press “batch” and your done!
gpsmap.jpg

iPhoto 09 map showing my short walk today



Example of flickr map

Map with my pictures in flickr

Getting the colors of your photos looking right in all browsers

May 3rd, 2009 Jacken 1 comment

I had this problem of all my pictures looking really washed out in some web browsers. The problem is that a lot of browsers don’t support color profiles, so even if include a profile it will be ignored. Instead the sRGB color profile is used. This makes pictures that look good in Photoshop look bland in your browser (unless of course you use Safari on Mac that use included color profiles)

Here’s a picture that originally has a the Adobe RGB(1998) which has a larger color gammut than the more used sRGB. But if you export the image without any modifications using “Export to Web…” in Photoshop, this is how it looks.

no_conversion.jpgconverted.jpg

Compare the left one that’s exported without doing anything to it to the right one that has had color profile settings changed. The left one looks a bit bland and missing information?

How to fix this?

I did a lot of experiments, and this works for me. There’s probably a better way of doing this, so please feel free to correct me in the comments.

Open the picture in Photoshop and do the normal stuff like changing size and other adjustments.

When you are finished and want to export it, first do this:

I’m going to convert the image to my profile for my screen and as you can see my calibrated profile name is “New Profile (2009-01-13 04-43), but If you don’t have a calibrated screen, use “Color LCD”.

Color LCD.png

Under the Edit menu, select “Convert to Profile…”

Picture 12.png

Select your screen profile under “Destination Space”, in my case New Profile (2009-01-13 03-43) and press return.

Convert to Profile.png

Now it’s time to export for web.

Picture 13.png

Try to upload to the web and see if it makes a differense. It should.

To get the best result you really should get a screen calibrator. This is a device that makes sure that the colors on screen is correct. Here’s a couple.

“ColorVision S3P100 Spyder3 pro” (ColorVision, Inc.)

I have this one, and I’m very satisfied.

“GretagMacbeth Eye-One Photo – Colorimeter / color calibrator” (GretagMacbeth AG.)

Now we’re talking more money but also more exact results.

Rating with stars and why it sucks

May 2nd, 2009 Jacken No comments

I’m been working on an application lately where we need to have some sort of rating. Almost instinctively one thinks of using stars to let the user choose how much they like something. But I soon realized that stars with 1-5 rating does not work. Well, let me elaborate, it does not work like a scale. Most fill them in like a boolean value. If they like it, they put four or five stars, and 1 if they don’t like it. If the product does not create an emotional response, they don’t put any stars at all, because most people only rate something they really like or hate. It would be fun to have a star rating system that actually put you up against the wall when you fill something in. You’ve just watched one of Hollywoods latest money making machine movie, and you liked it well enough. A good time waster. So you put four stars. The system then asks you, “Are you sure that you think this is as good as Deer Hunter?” Most sane persons would realize that they made an error in judgement and lower the score. And then stop using the rating system, because who want’s to be corrected by a computer?

Categories: Programming Tags:

Shit I need to do before I die!

April 28th, 2009 Jacken No comments

I’v never set up a list of things I want to do before I’ll be pushing up the daisies, but now somehow It feels appropriate. Need something to hold on to.

I will try to add to this list as I remember stuff I want to do. But here we go:

  • Going around Nürnburg Ring faster than 8 min 40 sec.
  • Go to New York with my son Groucho
  • Travel back to greece for a week or two.
  • Build an CNC machine
  • Remarry my wife on the continent.
  • Fullfill my promise and get a shitload of cocaine to my friends 65th birthday. (still 10 years to wait)
  • Going to the gym and get firm and unflabby again.
  • Work as a photographer in a war zone for two months

I’ll try to keep this one updated…

Categories: The life and times of Jacken Tags:

Download all files in RSS feed using Ruby

April 24th, 2009 Jacken 3 comments

I’m working on learning Ruby on Rails and one great resource that I find myself going to is RailsCast. But as I really need to learn Ruby I wanted to write a quick program to download all the episodes to my harddisk and watch them using Plex Media Center. There’s probably a million different utilities (or podcast managers) that can do that, but using them I won’t learn to program Ruby that way. There’s probably a better way of doing this, but hey, do it and post a comment.

require 'rubygems'
require 'hpricot'
require 'open-uri'

doc = Hpricot.XML(open("http://feeds.feedburner.com/railscasts"))

(doc/"enclosure").each do |para|
  filename = File.basename(para[:url])
  puts "== Found a file #{filename}"
  open(filename,"w").write(open(para[:url]).read)
end
Categories: Programming Tags: ,

FRA får inte läsa mina brev. Hur gör man för att skydda sig? Kryptera din epost

April 2nd, 2009 Jacken No comments

Efter de stora protesterna fick våra kära politiker skriva om delar av FRA lagen. Nu verkar det som SÄPO ska få tillgång till information, vilket säkert betyder att vanliga polisen kan få se vad du skriver och pratar om inom några år.

Så vad gör man för att slippa detta? Du gör det på samma sätt som de som FRA försöker hitta, dvs krypterar all din kommunikation.

Det finns en gratis programvara för att kryptera epost som heter The GNU Privacy Guard.

Men hur gör man då för att använda GPG när man skickar epost?

Det beror på om man har Macintosh eller Windows, men jag ska visa hur man går tillväga på båda dessa plattformer.

Macintosh installation

  • Från http://macgpg.sourceforge.net/ laddar du ned följande program
  • GNU Privacy Guard (se till att du väljer för din maskin och version av systemet)
  • GPG Keychain Access, ett program för att hantera nycklar (nycklar förklaras längre ner)

Sedan ska vi ladda ned PGP för Apple Mail härifrån

Börja med att installera GNU Privacy Guard.
Installera sedan GPG Keychain Access.

För att installera PGP för Apple Mail måste vi flytta filen GPGMail.mailbundle till hemmamapp/Bibliotek/Mail/Bundles

Starta om Apple Mail.


Så hur fungerar då PGP?

Varje användare av PGP har två nycklar. En privat (hemlig) nyckel och en publik nyckel. Den publika nyckeln kan du lägga på nätet, skicka över internet eller trycka på en T-shirt. Spelar ingen roll. Om en annan har din publika nyckel, kan de kryptera epost meddelanden med hjälp av den. När något är krypterat med hjälp av din publika nyckel, finns bara en nyckel som kan öppna den, och det är din privata nyckel. Du börjar förstå att det är din privata nyckel du ska göra backup på nu va?

Först laddar du upp din publika nyckel till en nyckelserver som gör att andra kan hämta din publika nyckel

Public key exchange gpg

Här har någon sökt och hittat din nyckel och laddat ner den på hans maskin. Han kan nu använda din publika nyckel för att skapa krypterade meddelanden som bara du kan läsa. Oftast när epost program krypterar, brukar de även använda ens egen publika nyckel så bara ni två kan läsa. Det går att skicka till flera deltagare om du har krypteringsnyckel till alla mottagarna.

gpg key exchange-1.jpg

Hur får folk tag i andras publika nycklar då?

Det bästa är att ladda upp dem till en nyckelserver där din publika nyckel kopplas ihop med din epostadress och namn. Man kan söka dessa nyckelservrar för att hitta personerna man vill skicka krypterad post till. Man laddar ner mottagarens publika nyckel och installerar på din maskin, och vips! så kan du nu skicka krypterat till dem.

Så låt oss prova att hämta en nyckel genom att starta GPG Keychain Access programmet. Det ser ut som nedan.

Keychains.jpg

Först måste du skapa din privata och publika nyckel, så välj “Generate…” under Key-menyn och följ anvisningarna. Nu skapas din privata och publika nyckel.

Välj “Send to keyserver” på din publika nyckel. Då kan folk leta reda på din kryptonyckel och skicka krypterat till dig.

För att lägga till andras publika nycklar som du vill kunna skicka till välj “Search for Key…” under Key-menyn

Keychains-1.jpg


Skriv in epostadressen på personen du söker.

GPG Keychain Access.jpg

Nu ska den personen finnas i din lista. Så låt oss prova att skicka ett krypterat meddelande med Apple Mail:

Hemligt hemligt! Ingen FRA här inte!.jpg

Om du installerat enligt ovan ska du nu ha möjligheten att välja PHP: Signed och Encrypted.

Signed är när man skickar texten i klartext, men blir signerad, och en kryptosträng läggs till. Om någon försöker ändra i epostmeddelandet innan du får det, får du en varning. Men det vi vill göra är att kryptera, så välj att kryssa i Encrypted.

Nu skickas ditt meddelande krypterat till mottagaren och bara du och han kan läsa den.

GLÖM INTE BORT ATT GÖRA BACKUP PÅ DIN PRIVATA NYCKEL. UTAN DEN KAN DU INTE ÖPPNA KRYPTERADE MAIL.

Categories: Macintosh Tags: , , , , ,

Mods and upgrades on a Pioneer PD S-505 for better audio quality part 1

March 28th, 2009 Jacken No comments

Pioneer PD-S505

So I bought this Pioneer PD S-505 for $40 to test how good audio quality I’m able to squeeze out by modifying it. But I’t wil not be just the standard subjective judgement of improvement but also measurements. Back in 2000 you had to pay about $400 for it. It uses the stable platter which means you have to put the CD in upside down. So let’s get going.

The steps I planned is the following:

  • Remove the mute transistors.
  • Replace the output opamp
  • Remove headphone output
  • Replace the clock with a GD-Audio clock
  • Improve the regulated voltage feeds to the DAC and opamp
  • Improve the power supply
  • Add a separate regulated power supply for the clock and opamp

But first we need the schematic of the player, so download the Pioneer PD-S505 schematic here.

Ok, lets look at some stuff we need to do. First we have to remove the mute transistors. Less stuff in the audio path equals better sound. The transistors is just there to make the measurements look better for reviews. So they have to go.

Pioneer PD-S505 mute transistors

Click for larger image

So transistors Q403, Q404, Q453 and Q454 is removed. Desolder och just clip the pins (carefully) with a wire cutter.

transistors-removed.jpg

Next step, time to desolder the opamp which is a rather old opamp (NE5532). Desolder the opamp IC405 and solder in a socket for easy testing with different opamps. I settled on LM4562 at first.

Remove the heaphone opamp if you don’t going to use it. It’s better to buy an external headphone amplifier like V-CAN Tube Headphone Amplifier or better.

opamps pioneer pd-s505

That’s about it for today. Next installment, upgrade the clock to improve jitter numbers…

Jacken’s Blog is Digg proof thanks to caching by WP Super Cache!