Thursday, April 30, 2009

My samba config for pogoplug

Below is my samba config (for samba 2.2). No password, nor any protection other than IP address filter (see "hosts allow") so use with caution :)

[global]
workgroup = PARKNET
server string = Pogoplug Samba2 Server
hosts allow = 192.168.3.  127.
null passwords = yes
guest account = root
log file = /opt/var/log/samba/log.%m
max log size = 50
security = share
encrypt passwords = no
smb passwd file = /opt/etc/samba/smbpasswd
dns proxy = no
preserve case = yes

[ShareAll]
comment = Test share
path = /tmp/.cemnt
available = yes
public = yes
writable = yes
printable = no
create mask = 0777
guest ok = yes
browseable = yes

I know this is somewhat gross as far as samba configurations go, but hopefully it will be a working start :)

PS. Turns out "encrypt passwords = no" doesn't actually help, but prevents non-workgroup machines to connect without passwords (at least from a Windows XP machine). I've now set it to "yes".

Friday, April 24, 2009

대한민국은 미친공화국이다

한겨레 신문에 "교과부 심야학원 10시까지 법제화"라는 기사를 읽자니, 기가 막혀서 말이 안나온다. 이런 황당한 법을 만들겠다는 넘들이나, 그걸 지지하는 넘들, 내 블로그를 읽을리 절대 없겠지만, 혹시라도 읽는다면 잘 들어라.

도.대.체.  다른사람들이 자기 애들을 11시에 학원에 보내건, 12시에 보내건, 새벽 3시에 보내건, 그게 니들 사는데 무슨 방해가 되냐? 뭐가 "올바른" 행동인지 아닌지, 몇사람들이 정해서 법으로 만들어 다른사람들에게 강제시키겠다는 이런 발상은...계몽주의적을 넘어 국민을 애들 취급하겠다는 발상 이쟈너. 니덜은 미친놈들이다. 10시넘에 운영하는 학원을 문제라고 생각하는 것 까지는 그렇다고 치자. 그걸 강제적으로 이런식으로 해결하겠다는, 위에서 아래로 내려오는 상명하달식으로 밖에는 해결이 안될거라고 믿는, 그래서 거기에 회의 시간들 들여가며 돌아가지 않는 머리통들을 부딪히고 있는 니덜은 ... 미친넘들이다. 

밤늦게 학원에 보내려는 부모들이 보내고 싶지 않게, 보낼 필요가 없게 만들어서, 수요가 없어지게 하지 않는 이상, 아무리 단속을 하더라도 원하는 사람들은 하게 마련이다. 어떻게 하면 근본적인 문제부터 해결할까는 생각하지도 않으면서 이딴 쓸데없는데다가 시간을 쓰고있으니.... 혹시라도 이거 읽고 제정신이 돌아오거든 이 형님한테 감사하다고 인사나 해라.


About /dev/mtdblock3 on pogoplug

I've asked pogoplug support if they have any plan to use that extra partition, and the below was the answer:

We have left mtdblock3 for linux users to use at their discression.  We have reserved mtd0 for bootloader, mtd1 for kernel, mtd2 for root file system (and it is all we firmware update).  mtd3 and mtdblock3 are the majority of the NAND flash (~450MB) and we currently have no plans to use it at all.

One word: awesome! I'm feeling a lot better about buying pogoplug. Now if only I can get cups working. I haven't had time to fight with cups yet, but it seems that it's not the cups but something at the kernel level that's not working...

How to install samba on pogoplug

Below is roughly what I did to get samba running on pogoplug.

# remount the root partition for writing
mount -o remount,rw /

# mount the extra partition for the space
mkdir /opt
mount /dev/mtdblock3 /opt
cd /opt

# get the optware ipkg system
wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/ipkg-
opt_0.99.163-10_arm.ipk

# set it up
tar -xOvzf ipkg-opt_*_arm.ipk ./data.tar.gz | tar -C / -xzvf -
mkdir -p /opt/etc/ipkg
echo "src cross http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/uns
table" > /opt/etc/ipkg/armel-feed.conf
echo "src native http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/native/u
nstable" >> /opt/etc/ipkg/armel-feed.conf

# first update
/opt/bin/ipkg update

# install samba!
/opt/bin/ipkg install samba2

# edit samba config
vi /opt/etc/samba/smb.conf

# run it!
/opt/etc/init.d/S80samba start

Sunday, April 19, 2009

Pogoplug, and lots of images

If you have a disk that contains large number of image and video files, you may not want to attach it to pogoplug, at least yet. It seems that pogoplug wants to generate thumbnails for all video and image files on the disk (/tmp/hbplug.log shows invocation of ffmpeg), and since I attached the disk that contains all digital pictures I've ever took in the past 10 years or so - especially with two kids, I easily take thousands of pictures a year - it looks like the pogoplug is taking forever to process them all.

Looking at .cedata/tn directory pogoplug created (which seems to be the directory for thumbnails), I see 3k immediate subdirectories under .cedata/tn, and total 23k files and directories recursively. *arg*. Life is never simple :(
I don't remember whether I formatted this disk in NTFS or FAT, but regardless, it seems like a bad design on pogoplug's part to use this many directories - you want to keep the number of directories reasonable, especially when the underlying filesystem is badly designed, like FAT.

Anyway, I've stopped "hbplug" process by "kill -STOP", so the disk is not thrashing. I should remember to re-enable hbplug process again.

Pogoplug, optware, samba

Finally I had a bit of extra time to play with Pogoplug. I've set up Optware ipkg on pogoplug, installed samba, configured it and it works beautifully :)
Optware comes with CUPS, so it shouldn't be too difficult to set the print server as well - though I first need aUSB2 hub to try hooking up the printer :)
Now it's time to sleep - if I get more time, I'll try to write down more details on Optware setup.

Saturday, April 11, 2009

Update on Pogoplug

After complaining loudly on their support page, I've got an excellent reply from Pogoplug:

Hi.
I spoke with our dev group and here's what's going on. They are working on a LAN discovery broadcast for the drive software, so that it will work without internet access. It should be available soon, and I'll update you when it's ready. We did not provide SMB/CIFS support because we wanted a consistent user experience for Mac and Windows, both in and out of the home. The protocol used by Pogoplug drive software is also a lot faster than SMB. Having said that, you can get full access to your Pogoplug and add any software that you want. We are just about to publish this on our site, but here's the info you'll need:

Pogoplug runs with Linux 2.6.22.18. and the full open source for the kernel, glibc, busybox, u-boot, and other user-mode processes will be available linked from our developer section. Pogoplug currently accepts SSH sessions for the root user (un: root, pw: ceadmin). The processor is a ARM processor with all firmware stored on the internal NAND flash device. The standard linux MTD device drive is used to manage this NAND device with JFFS2 filesystem. Once you SSH to the device, you can change the root file system, install a new kernel modules, etc.

We also support a 3.3v RS-232 UART connection on the main logic board. This UART connection gives low level access to the u-boot boot loader which allows for upgrading the main kernel image.

Please let me know if I can provide any additional information.

Thanks,

I haven't set up the cross compiler on my linux box yet, so haven't done any serious attempt of adding more functionality to it. But regardless, given this information, you definitely want to block ssh/telnet port at the firewall if you haven't done so already, and you shouldn't hook it up to the network you don't trust.

My brief performance testing (just copying some big file) seems to suggest that it is not particularly slower or faster. One issue I've encountered was BSOD - I tried playing .mkv from a windows box that has pogoplug software installed (hence the pogoplug shows up as a disk), and I've got BSOD (the first time in a few years since I've got that laptop). On the second attempt, it didn't crash, so it's not a definite evidence of a bug in their software, but nonetheless not a great sign.

So, it's still not useable as my main network storage. But there are some good signs that it may become one.

Wednesday, April 08, 2009

My Pogoplug arrived, and I'm disappointed.

This is a quick review of Pogoplug. I have preordered the box, and it has finally arrived. Unfortunately, I'm deeply disappointed, because it has so much potential that's being wasted.

Pogoplug is essentially a small embedded computer, with Marvell's low-power ARM processor core with some DRAM and flash memory, one ethernet port and one USB port.
I pre-ordered it, figuring there's not much to lose - I figured this would be a perfect device that I can play with, as a small home server, given that this little box was supposed to run linux.

Now that I've received the box, it has a few critical flaws that make it not very usable in its current state.
  1. No power saving mode for the disk - I've been using an old laptop running Windows XP as a file/print server. Naturally, when I don't use the disk, the disk doesn't do any "seeks", and it's configured so that it spins down the hard disk fairly quickly when idle. This means my external hard disk spends most of its time spinned down, not consuming much power. This is in great contrast to Pogoplug - it constantly spins the disk, and even when I'm not using it, it does bunch of seeks, consuming power and wearing down the disk. For a box that's meant to be on all the time, this is...deeply disappointing, to say it politely.
  2. No CIFS/SMB support nor NFS - I don't know what Pogoplug people are thinking, but they didn't enable this, and there's no way to "properly" access the files, except...
  3. A priorietary software on Windows and Mac that show the drive hooked to Pogoplug as a network disk. This software, confusingly also called Pogoplug, doesn't connect if your machine and your pogoplug can't talk to pogoplug's server. For example, if you lose your connection to your ISP, you can't connect to your disk hooked to Pogoplug. This means...
  4. Total dependence on the proprietary webservice - as is, the box is useless without pogoplug website. If the company folds, the box will essentially become a deadweight.
  5. No printer server support - given how easy it is to support print server, it's crazy not to support this.
  6. No ssh into the box - even though this is my computer, I don't have root access. It's not like the box doesn't have sshd running - it has the port open (crazily, it has the telnetd running on port 22 as well - whoever left telnetd running by default needs some serious education on the network security).
As you can see, all the flaws are software - the hardware itself is compact, silent, and low power, and just the right form factor and the price. It's just the software that's not allowing the little-box-that-can from doing all things it's meant to do.

And scanning through the pogoplug support forum and reading some responses, I don't see enough good signs that the company is willing to listen to the similar requests that's already made on the board.