.mrt memo

tail -f /dev/mind > blog

Posts Tagged ‘howto

Sockso – music webserver

leave a comment »

Sel korral tutvustan ühte vahvat veebiserverit, mis võimaldab oma muusikakogu kuulata suvalisest kohast kasutades selleks vaid brauserit ning Flashis kribatud playerit. Olen seda Java programmi kasutanud nüüdseks juba  Serveerida suudetakse üle HTTP kui ka HTTPSi vabalt valitud pordinumbril (vaikimisi 4444) ning mängida osatakse vaikimisi mp3. Aga võimalik on lisada tugi eksootilisemaltele formaatidele nagu ogg, flac, wma ja m4a. Siin on hea juhend, kuidas seda Ubuntu all teha koos init skriptiga. Sinna juurde on vaja veel installida flac ja lame pakid, et eksootilisemate formaatidega hakkama saada. Alljärgnevalt kirjeldan lühidalt vajalikke samme.

Install

Sockso vajab väidetavalt Suni Javat. Seega Ubuntu all oleks soovitatav installida järgmised pakid

sudo apt-get install sun-java6-bin sun-java6-fonts sun-java6-jre unzip

Seejärel tiri Sockso alla, paki lahti ja kopeeri ntx /usr/share/ alla.

wget http://sockso.googlecode.com/files/sockso-1.2.4.zip
unzip sockso-1.2.4.zip
sudo mkdir /usr/share/sockso
sudo cp -R /home/user/sockso-1.2.4/* /usr/share/sockso/*
sudo mkdir /var/sockso
sudo chmod -R 0755 /var/sockso

Jooksutamine

Käsureaprogrammina:

sudo sh /usr/share/sockso/linux.sh --nogui --datadir /var/sockso

Täpsemaid juhtnööre seadete sättimiseks leiab kodukalt, kuid näiteks uue kataloogi muusikaga saab  Socksole ette anda direktiiviga coladd:

#SockSo#>coladd /home/user/Music

Graafilises kasutajaliideses on toiminguid lihtsam teha

sudo sh /usr/share/sockso/linux.sh --datadir /var/sockso

Initskript

sudo cp /usr/share/sockso/scripts/init.d/sockso /etc/init.d/sockso.pl
sudo vim /etc/init.d/sockso
#!/bin/bash perl /etc/init.d/sockso.pl $1 exit 0

Kopeeritud Perli skriptis tuleb teha ka mõned muudatused – /etc/init.d/sockso.pl

use constant SOCKSO_DIR => "/usr/share/sockso/"; system( 'sh linux.sh --nogui --datadir /var/sockso > /dev/null 2>&1 &' );

Seejärel muuta pisut õiguseid ning määrata skript käivituma kohe pärast alglaadimist.

sudo chmod +x /etc/init.d/sockso sudo chmod +x /etc/init.d/sockso.pl sudo update-rc.d sockso defaults

Nüüd käivitub Sockso nagu serverprotsess ning juhitav nagu ikka sellised asjad:

sudo /etc/init.d/sockso start sudo /etc/init.d/sockso stop

Konfigureerimine

Oma kollektsiooni kataloogide lisamisest Socksole parsimiseks sai juba näide toodud. Graafilisest liidesest käib sama “Collection” saki alt. Küll aga ei pruugi kohe töötada erinevate failivormingute tugi. Oggi jaoks oli Ubuntu 10.04-s kohe installeeritud vorbis-tools pakk, mis sisaldas vajalikku oggdec pakki. Samuti oli olemas juba ffmpeg. Juurde oli vaja aga:

sudo apt-get install flac lame

Seejärel tuleb GUIs üles otsida “Encoders” sakk ja seal ükshaaval vastava failiformaadi juures “None” raadionupp lülitada ümber “Builtin” peale ja paika määrata encodingu siht bitrate. Et CPU-d koormata ja võrguliiklust säästa, võib ka kõik mp3-d lasta ümber kodeerida madalama bitrate peale.

Märkmeid

Sockso käivitub vaikimisi HSQL andmebaasimootoriga, kuid väidetavalt olevat võimalik asi ka MySQLi peal jooksma panna. Seda minevat vaja siis, kui kollektsioon hakkab ulatuma Teradesse. Et siis suuremosa inimestel seda omadust vaja ei lähe.

Veidrustest kah paar sõna, mis esimese kuu jooksul ilmnenud on. Väga sügavale ei viitsinud puurida. Lähtusin pigem põhimõttest, et kasutan brauserit, millega töötab.

Selgus, et Chromega ei saa üle HTTPSi Socksosse sisse logida. Windowsi Firefoxi puhul ei suutnud ma mingil põhjusel Flashis maalitud playerit käima saada ning seega pidin taanduma Opera peale, milles töötas nii featuur “HTTPS” kui ka “Flash Player”. Linuxis Chromiumiga oli jätkuvalt jama, kuid Firefoxi ja Operaga töötas. Andke andeks, et ma ei viitsinud IEs eraldi proovida.

Aga väga muljetavaldav pisike jupike koodi – arenev avatud tarkvara, kuid töötab juba praegu kuratlikult hästi.

Viiteid

—–

Update: A little memo about some features I think everybody would love.

Wanted Features

  • Scrolling in the default flash player.
  • Web based administration console. The SWT/Swing/whatever based adminconsole requires the server to restart twice – when you enter admin console and when you demonize the server process again.
  • Year of the Album displayed in the artist view (and sorted by year).
  • When you add songs to the list by album, the tracklist is sometimes un-ordered. It should be ordered by track number.
  • In the recently listened view there might be also the username of the listener.
  • Chance to adjust zipping directories. Default is <zip>/Artist/Album Name/Track Number – Song Title. (Even if the filename is different, so it must be based on the ID3 tags.)

Written by dotmrt

2010/07/03 at 21:58:24

Posted in howto, it, linux, music, opensource, ubuntu

Tagged with , , ,

Eric S. Raymondi Hacker-HOWTO

leave a comment »

Eric S. Raymond on häkkerimaailmas kahtlemata tuntud nimi ja tema kirjateosed on rangelt soovituslikud lugemised igale tõsisemalt “asjaga” tegelevale inimesele avardamaks maailmapilti ning mõttemaailma. ESR on kahtlemata üks neist “tipphäkkeritest”, kellest ta ise HOWTO-s kirjutab, mistõttu on ta kahtlemata õige mees pealkirjas mainitud kirjatükki kirjutama.

Üldjuhul mõeldakse häkkerist (kõige kitsamas tähenduses) kui programmeerijast, aga häkkerlust võib vaadelda ka laiemalt.

Ma usun, et häkkerlikke põhimõtteid/suhtumist saab edukalt rakendada ka muudes eluvaldkondades, lihtsalt oskused on teised. See osa HOWTOst, kus räägitakse programmeerimisest, tuleb asendada vastava eluvaldkonna loova ja manipuleeriva tegevusega.

Ja lõpetuseks ma arvan, et taoline HOWTO kuluks ära tegelikult misiganes elualal. Abistav, otsekohene, läbinisti aus. Täpselt nagu häkkerikultuurile omane.

Mis oleks Sinu elus teistmoodi läinud, kui Sa oleksid lugenud enne misiganes eriala õpetavasse asutusse astumist lugenud läbi kõikide huvipakkuvate erialade ausad ja otsekohesed HOWTO-d?

 

Hilisem täiendus

Lugesin just ühte suurepärast teemasse artiklit, mis pani kirja minu mõtted, mida ise ei osanud kohe välja tuua. Paul Buchheit – mees, kes häkkis valmis esimese versiooni Google AdSensest ja Gmaili – kirjutab teemal “rakenduslik filosoofia ehk häkkimine” suurepärase artikli.

Written by dotmrt

2009/11/23 at 02:07:44

Posted in howto, it, kool

Tagged with , , ,

Wifi-Router firmware – Tomato on Buffalo WHR-HP-54G

with 2 comments

So you’ve got a Wifi-router. That don’t impress me much.
In fact, nobody could give a rats ass and less notice of the brick you have under the table/hanging from the wall/on the floor. When somebody comes to visit you, the only concern is “have got wifi?”

I’ve had my Buffalo AP for ages by now (speaking in tech it’s about 2+ years) and one day (well, it was yesterday) I found that there are loads of “3rd party firmware” out there for these little cheap boxes. The most popular to modders is the Linksys WRT54G series (nowdays WRT54GL – “L” standing for Linux), but Buffalo WHR-54G series seems to be also popular.

Not to get into too much detail, then couple of great guys have written their own firmware and put it up for others to download and install. Usually this modding changes the admin console and unlocks some “restricted” features you may have not been aware of. I don’t want to brake the law here in Estonia, but it seems that Buffalo’s “HP” aka “High Power” might very well be able to exceed the regulations in this part of the world when correctly set up. But that’s for another time.

The procedure – tftp

So I thought, why not to do something I really don’t need and what might utterly destroy my router and installed Tomato Firmware on my Buffalo WHR-HP-54g. They’ve got great wiki which provided me all the information I can cope with right now, but to make the long story short, I’ll memorize it here as you need to do exactly as the manual says:

  • install Trivial File Transfer Protocol if not already installed – tftp (ubuntu package)
  • download the latest firmware
  • plug your computer via wired connection to the router
  • find the reset button on the bottom of the WHR and hold it for at least 30 seconst, the diagnostics led will blink
  • then unplug it for 10 secs
  • after plugging it in, set your IP to static in the 192.168.11.2 and gateway 192.168.11.1
  • in one terminal window “ping 192.168.11.1” continually
  • unplug the router and see how ping timeouts
  • open second terminal and write following commands
  1. tftp
  2. binary
  3. rexmt 1
  4. trace
  5. connect 192.168.11.1 (Even though the router is still powered down, tftp doesn’t actually “connect” when you execute. So relax)
  6. put tomato.trx
  • Do not press enter yet on the last command
  • Plug the router in again and be ALERT for the first ping
  • When ping gets it’s first response, push enter in the tftp window (you’ll see data transfer “sent DATA <block=5425, 512 bytes>” “received ACK <block=5425>”…)
  • when done wait for at least 2 minutes, then unplug the router for 10 seconds and after plugging in, you should be ready
  • Your “refreshed” router is now 192.168.1.1 with default user/pass being root/admin. Log into admin console and change it – http://192.168.1.1/

I suggest you read the Wiki for more thorough guide.

Loads of mods out there

That’s the procedure to follow when you want to flash your router. Some possible firmware to check out (got them from Tomato wiki):

  • dd-wrt – probably the most famous one. “Supported hardware” list is quite impressive.
  • FreeWRT – supports some Linksys, Asus and Netgear boxes
  • Tarifa – seems to be exclusively for WRT54GL
  • OpenWRT – not very user friendly, but boasts a packaging system to manage software installed and also is named to be the “leanest and meanest” of all router firmware. Also the “supported hardware” list is quite long.
  • X-WRT – project to make a decent webUI for OpenWRT
  • Tomato – based on formes HyperWRT project with nice clean and 21st century webUI using AJAX and SVG

All are based on Linux in some way or the other, to my knowledge.

Also I learned a new term – “to brick“, you have just brick’d your router. Means you have just managed to do something wrong and your router is nothing more than a brick. Fubar, so to speak. (Although I found some advice on de-bricking your box, not that I needed it, yet.)

Final thoughts

Finally, I need to say, that I really had no real need to do all this. I just thought it would be cool to see statistics about my router clients, their net usage and such little stuff which Tomato provides with nice AJAX interface. Also there are some little things you might think are quite logical, but big manufacturers just don’t care. Like when you need to define a channel to use, it would be logical to scan the vicinity for other networks and then assign the channel. You can do that directly in Tomato’s UI. There are such little things all around.

But I know 3rd party firmware to be actually really useful for Wireless Repeaters, Wireless Distribution System and Wireless EThernet/Ethernet Bridge or whatever term you can find, which basically let you enhance your IEEE 802.11 network’s range with additional routers. I got lost searching for differences between those terms, but it seems in one case you MUST have different channels and you CAN have different SSID’s and such. Didn’t go further from there.

Further study:

  • is there some difference in WPA/WPA2 encryption support in different repeating/bridgeing ways (WDS,WET) (some tutorials I found mentioned WEP – don’t really understand if they are imbecilles or perpahs just WPA is not supported and they wanted to market the firmware bridging possebilities as “sure, we have encryption”)
  • are both routers still functioning as AP-s also when using WDS and/or WET (found some controversy on that)
  • is there difference in datagram forwarding between WDS and WET (all forwarded vs only those datagrams forwarded which destinations reside in the view of that router)
  • what are the methods used by available commercial repeaters sold in the stores
  • find some cool projects done with 3rd party firmware for routers
  • some feature difference table of all the firmwares would be helpful

PS

I discovered, that Buffalo is actually selling their WHR-HP-54G with DD-WRT preinstalled (link), which is kinda cool.

Written by dotmrt

2008/07/03 at 23:17:46

Posted in it, linux

Tagged with , , , , , , , ,