RSS
 

Archive for March, 2011

Konstig kombination

31 Mar

Ciao Ciao pizza

Läser på menyn: Oxfile. Lök. Bea.

Då förväntar man sig väl ändå inte curry?

Rekommendation? Beställ inte en Ciao Ciao pizza (nr 40) på Milano Grill & Pizzeria på Storgatan i Piteå.

 
No Comments

Posted in Rambling

 

New server for the blog

31 Mar

Mac Mini After a bunch of screw-ups and huge annoyances, I managed to move my blog to another server in the house. This time it’s hosted on the “new” (used) Mac Mini.

I never would have figured that it would be so bloody hard to move a wordpress installation from one server to another. Turns out it’s a really bad idea to have a plugin like WP Supercache enabled before you do the move. I ended up having to export all my posts and pictures via WordPress own exporter and then import them again on a fresh WP installation.

So a bunch of grey hairs later, I’ve been up and running for a day or two on the Mac Mini. :)

Now the next step would be to get a new gigabit router, preferably with wireless… something like Buffalo’s WZR-HP-G300NH would be really nice. It’s a shame they are so hard to find in Sweden. I’ve been playing a little with it at our office the last time I was in Helsinki, and I was really impressed by the features it packs into it’s little black body with double-antennas.

Speaking of OS X, I have a bunch of annoyances with using the Mac. Yes, yes, I know I’m definitely not an apple-fanboi. I’ll admit the mini is quite cute, but why – oh why- would they ever do something as stupid as mess around with keyboard shortcuts. Since I don’t have an Apple Keyboard™, it’s really confusing remembering which button was mapped to what, not to mention changing some shortcuts completely. Add to the confusion the fact you just have to have the mouse nearby the whole time.

You know you’re a Windows and/or Linux kinda guy when…

…you hit Alt+D and expect yourself to jump to the Address-bar in most modern browser… is this the case on OS X?
No. You end up bookmarking the damn page. Cmd+L apparently is the favored method on a Mac.

…you select a file in your file browser of choice, press Delete and expect the file to be deleted… is this the case on OS X?
Nope. You just get a *bloing* sound from the Mac. I’m not going to say anything about the fact that a MacBook Pro doesn’t even have a delete-button…

…you press F2 to rename files and Enter to launch something. Did this happen on the Mac?
Bloody no. Why on earth would anyone want to rename with pressing Enter? And how the hell am I supposed to launch stuff?

…you open the file browser, browse to your desired location and want to cut+paste a file from here to there. Now on a Mac the first question is, where’s Cut in Finder??
I sure as hell don’t like having to drag and drop when I have a keyboard in my lap.
Let’s see… on Win7 I’d do something like: Win+E, Alt+D, type location, Enter, select file with arrows (or multiple with Ctrl+Space) and hit Ctrl+X.
I completely fail to see how that’s even remotely possible to do on OS X.
And no, I do not want under any circumstances to drag and drop with the mouse.

So much for the supposed “superiority” of OS X… but at least it’s pretty to look at.
If you’re into that sort of thing.

 
No Comments

Posted in Tech

 

Ladda program från SVTPlay?

16 Mar

Dags för ett inlägg på svenska tycker jag. Ämnet blir (som titeln också säger) att ladda ner intressanta avsnitt från svtplay.se för att se dem utanför webbläsaren. Många avsnitt finns endast tillgängliga en begränsad tid, så då kan det vara trevligt att ha möjligheten att se dem lite senare… förutsatt att du kom ihåg att ladda ner förstås. :)

Förberedelser:
Du behöver en linux-burk som du kan installera rtmpdump på. I Ubuntu gör du det lättast med kommandot sudo apt-get install rtmpdump. Annars finns källkoden på http://rtmpdump.mplayerhq.hu/.

Ett nerladdat avsnitt, steg för steg:

  1. Hitta avsnittet på svtplay.se
  2. Visa källkoden (Ctrl+U i Chrome)
  3. Sök efter “dynamicStreams”
    dynamicStreams svtplay
  4. Markera från rtmp: till .mp4 (se bilden ovan) och kopiera URLen
  5. Öppna upp terminalen, skriv in följande:
    rtmpdump -r KlistraInURLenDuNyssKopierat -o NyttFilnamn
  6. Rulla tummarna ett tag. Varierar en hel del hur snabbt det går att få ner avsnittet, snittar själv från 1½ minut till runt 10 minuter.

Filerna som laddas ner är .mp4 med en resolution på 1280×720, dvs de är ca 500mb/30min.

Om du känner dig utmanad att göra det lättare för dig själv så kan du alltid knåpa ihop ett skript som gör det mesta åt dig per automatik. :)

Snäll som jag är så kan jag ge lite idéer på köpet, t.ex. lite PHP för att underlätta hela processen. ;)

function curl_download($Url){
  if (!function_exists('curl_init')){
    die('cURL is not installed!');
  }
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $Url);
  curl_setopt($ch, CURLOPT_REFERER, "http://svtplay.se/");
  curl_setopt($ch, CURLOPT_USERAGENT, 
    "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.25 (KHTML, like Gecko) "
    ."Chrome/12.0.705.0 Safari/534.25");
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_TIMEOUT, 10);
  $output = curl_exec($ch);
  curl_close($ch);
  return $output;
}

if(isset($_POST['url'])) {
  $url = $_POST['url'];
  $svtplay_src = curl_download($url);
  $stream_start = strpos($svtplay_src, "dynamicStreams=url:");
  $stream_end = strpos($svtplay_src, ".mp4,", $stream_start);
  $stream_url = substr($svtplay_src, $stream_start+19, $stream_end-$stream_start-15);	
  $name_pos = strrpos($stream_url, "/");
  $stream_name = substr($stream_url, $name_pos+1, strlen($stream_url)-$name_pos+1);
  $shellcmd = "rtmpdump -r ".$stream_url." -o streams/".$stream_name."";
  $time_start = microtime(true);
  system($shellcmd);
  $time_end = microtime(true);
  $exectime = $time_end - $time_start;
  echo "

Downloaded ".$stream_name." in ".round(($exectime/60),1)." minutes.

"; }

Förutsättningen för skriptet är att en form skickar med POST variabeln “url” som innehåller URLen till klippet på svtplay och att det finns en mapp som heter “streams”. $_POST kan döpas om till $_GET, så kan man ange ?url=http://svtplay.se/osv som en query i adressen. Observera att det hela är väldigt beroende på hastigheten av internetuppkopplingen och hur laggigt svtplay är när anropet görs. Sidan kan se ut som att den hängt sig, men den slutar ladda när rtmpdump blivit klar.

Kanske jag borde skriva ihop ett färdigt paket en vacker dag? Där har jag nåt att tänka på…

 
3 Comments

Posted in Tech

 

A nerdy birthday gift

16 Mar

I had my birthday this week and my dear wife bought me one of the best gifts someone nerdy might wish for: a giftcard to a local electronics-store. (I have to add that I did get some other presents as well.) :)

Took a quick trip into town yesterday to pick some stuff I need for expanding the network in the house. Here’s the proof:

Ready to network?

- a network cable tester (+ battery)
- RJ45 connectors
- crimping pliers
- 100m of cat-5e :D

…next up: pull cable from point A (our home-office) to point B (the livingroom) which is at the other end of the house

 
No Comments

Posted in Tech

 

Decent internet performance

08 Mar

Seeing how my dear co-worker decided to do his own comparison of our work connection vs what he has at home, I figured I’d shamelessly copy the idea and add what I’ve got…

At work:

Internet@work

 

At home:

Internet@home

 

PS. This is the connection this server is running on. :)

 
1 Comment

Posted in Tech