Ruben Laguna’s blog

Hello World!

Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!

Javascript + iTunes

The other day I found out this post. Thanks to the examples javascript (or more accurately jscript) provided in the post I learned to write my own javascripts to manage muy iTunes library. Here’s the result a script to find out files under the “iTunes Music” folder that are not present in the iTunes library. It helpful we you mess up the library (I used the “Consolidate library” feauture and ended up with tons of duplicated files in the hard drive that didn’t show up the iTunes interface).

Here’s the script

It output it’s results to a “filesnotlinked.txt”. You can either delete those files if they are duplicates or add them to the library.

Tags:

PHP Proxy and iTunes

It seems that the company I’m working on has blocked http://media.libsyn.com. They have categorized it as entertaiment/radio so I cannot access the podcasts from Java Posse at work. I’m sync my iPod with the ITunes at work so I cannot hear them anymore. Because I’m not happy with the situation I tried to overcome the blocking using my connection at home, so after googling a little bit I found PHP Proxy that allows to access other sites throught it. So I installed at home and now I point my iTunes to retrieve the javaposse feed through it.

But I didn’t work off the shelf. It’s designed to work with web pages only so I had to tweak it a little bit:


  • Add ‘text/xml’ and ‘application/xml’ to list of Content-Type’s that PHP Proxy is able to understand

  • Add the tag to the list of “rewritten” tags.

  • Append the original file extension of the url to the rewritten links so iTunes can identify the the link as a playable podcast.

  • Use Apache 2.0 mod_rewrite to rewrite requests to index.php.xxxx back to index.php

The weird thing is that iTunes wouldn’t recognize a link like this one

http://mydomain/unrestricted/phpproxy/index.php?q=aHR0cDovL3Z ...

as a playable episode even when the content-type of the link is “video/x-m4v” and the type attribute of the enclosure tag is also “video/x-m4v”. The actual error says "there are no playable episodes " .iTunes needs that the file extension in the url to be one of .mp3, .m4v, .mov or similar so I had to add code to add the right file extension next to the .php in the links and instruct the Apache web server to map al queries to index.php.xxx back to index.php. So the link in the enclosure tag look like

http://mydomain/unrestricted/phpproxy/index.php.m4v?q=aHR0cDovL3Z …

I tested it with the following podcast and it works like a charm

  1. diggnationvideo http://feeds.feedburner.com/diggnationvideo

  2. the java posse http://feeds.feedburner.com/javaposse

  3. ask a ninja http://feeds.feedburner.com/AskANinja

  4. security now! http://leo.am/podcasts/sn

The actual mod_rewrite commands that you need to add to httpd.conf are

1
2

1
2
<span class='line'>RewriteEngine on
</span><span class='line'>RewriteRule ^/unrestricted/phpproxy/index.php.(.*) /unrestricted/phpproxy/index.php  [PT]</span>

The patch to index.php

and the patch to PHPProxy.class.php

I hope this mod will help if someone has the same problems with phpproxy and itunes.

Tags:

Writely Post

Creating a post from writely is so easy.

9 Hours Later…

Today I read another bit of Akira. I’m starting to think that it will take ages to finish the book. Anyway the sentence was:

9時間後
第三次世界大戦が
勃発した

that in romaji is read:
“kyuu jikan go dai san ji sekai taisen ga boppatsushita”
and my translation is
“9 hours later the Third World War outbroke”

to translate the sentence I needed to search all this kanjis:

kanji- on’yomi kun’yomi – english
時 – JI – toki/-doki – time
間 – KAN/KEN – aida/ma/ai – interval
後 – GO/KOU – nochi/ushiro/ato/okureru – after
第 – DAI/TEI – – No. (ordinal prefix)
三 – SAN/ZOU – mi/mitsu/mitsutsu – 3
次 – JI/SHI – tsugu/tsugi – next
世 – SEI/SE/SOU – yo/sanjuu – generation, world, society, public
界 – KAI – - world
大 – DAI/TAI – oo-/ookii/-ooini – large, big
戦 – SEN – ikusa/tatakau/ononoku/soyogu/wananaku -war
が ga
勃 – BOTSU/HOTSU – okoru/niwakani – suddenness, rise
発 – HATSU/HOTSU – tatsu/abaku/okoru/tsukawasu/hanatsu – discharge, departure, publish, emit, start from, disclose
し shi
た ta

Words
Kanji – hiragana – romaji – english
時間 「じかん」 jikan – time
後 – 「ご」- go – after
第 – 「だい」- dai – Nº (ordinal prefix)
三 – 「さん」- san – three
次 – 「じ」- ji – next
世界大戦 – 「せかいたいせん」- sekai taisen – the World war
勃発 – 「ぼっぱつ」- boppatsu – outbreak

Yesterday’s Kanji

This a list with the vocabulary of the yesterday sentence

  • 年「とし」Nen/toshi – Year

  • 月「つき」tsuki – Month

  • 日「にち」nichi – Day

  • 午後「ごご」gogo – Pm

  • 時「とき」toki – Hour

  • 分「ぶん」Bun/fun/bu – Minute

  • 新型「しんがた」shingata – new style

  • 爆弾「ばくだん」bakudan – Bomb

  • 日本「にっぽん」nippon – Japan

  • 首都圏「しゅと けん」shutoken – Tokyo area

  • 上空「じょうくう」joukuu – upper sky

  • 炸裂「さくれつ」sakuretsu – Explosion

The sentence  in kanji
1992年12月6日午後2時17分新型の爆弾が日本の首都圏上空で炸裂した

And in romaji :

ichikyuukyuuni nen ichini tsuki roku nichi gogo ni ji ichinana fun shingata no bakudan ga nippon no shuto ken joukuu de sakuretsu shi ta    

My First Post

Well, finally, after reading blog compulsively about 8 month I decide to start my very own blog.

I’ll be posting about Java, Japanese and bodybuilding . So stay tuned.

Japanese

About a month ago I saw a book title “Japonés en viñetas” (Japanese in comic) in the FNAC bookstore. I was attracted by the title and after peeking at it I’ve found it interesting and decided to buy it and give Japanese a try. I’m of the impulsive kind.

So after reading the book, which gives an good introduction to Japanese I decided to buy a book in Japanese and try to read it. Looking in google for Japanese books providers I only found http://www.yesasia.com. Went there and bought Akira, I’ve seen the movie and I like it and it’s very easy to find the Spanish version of the book.

Well, I’ve started reading it and I realized that learning Japanese is going to be a lot harder than I though!

I plan to post here my progress with this comic (manga) and all the new words I found, etc. Probably I’ll post my first Akira progress status report a little bit later today.

Copyright © 2015 - Ruben Laguna - Powered by Octopress