2007-09-11

sshfs and subversion

I just lost a longer post as I'd forgotten to plug my laptop in, and was editing in SciTE rather than here, and the laptop powered off rather than hibernating (I've changed the setting now, System>Preferences>Power Management, the 'On Battery Power' tab, though why the default action was to destroy data I don't know. Bad Ubuntu.)

Anyway, I've got sshfs working instead of samba on the laptop, as SciTE doesn't understand smb: urls, and installed subversion on lure, my little server, so have a shared code repository between my machines. I also set up password less login so to use svn+ssh to connect to subversion from both fortinbras, my laptop and tercel-1, the Netra I've installed build tools on. I can now edit on either machine using the same tools, sync with svn, and build.

Now I might actually get round to doing something with the projects which have been sitting on my hard-drive for the last year or so.


TME

Labels: , ,

2007-09-08

Misc Admin - Laptop PCI, Bubba Static IP, More Disks

Laptop PCI Conflict

For a while, my laptop BIOS had been sporadically reporting a PCI conflict on boot, with no other symptoms.
It's dual boot Windows XP Home and Ubuntu, and after the latest Window Update it lost its on-board network adapter, both in XP and Ubuntu. Rolling back the update fixed Windows, but somewhere some persistent state made the PCI conflict happen around half the time, and if it did happen Ubuntu would not see the card, or be able to recover.
The logs said 'try pci=assign-busses', so I did (in GRUB use e to try it once, edit /boot/grub/menu.lst to make it permanent), and the adapter reappeared and (so far) there have been no conflicts on rebooting. In addition, Ubuntu can now see the SD card, (presumably that is what it was conflicting with) which means I don't have to boot into XP to snarf the photos from my camera.
Now if only the wifi button was broken enough to appear in the logs and explain how to fix it...

Bubba and Static IP

On Friday my new excito Bubba home server arrived. I plugged it in, switched it on and all was good.

Mounting Bubba Shares

There was a little playing around to get Ubuntu to see the Samba shares, which I also put on the excito forum thread which gave some clues:
The server appears in Nautilus when you choose Places > Network, as ftp, sftp and is also under Windows network.
Browsing into the server, it requests user and password as expected, adds them to the keychain, then shows the files.
For a one-off mount:
fortinbras# mount -t smbfs //bubba/home /net/bubba/home -o username=*****,password=***** 

Following the instructions at justlinux.com for adding to /etc/fstab, the following works with mount -a when run as root:

//bubba/home    /net/bubba/home     smbfs credentials=/home/pete/.sambacreds,uid=pete 0 0
//bubba/storage /net/bubba/storage  smbfs credentials=/home/pete/.sambacreds,uid=pete 0 0
On next reboot, the mount points appear in Nautilus, but you can't mount them as a user.
To get mount working for users, you need to set suid root on smbmnt and ensure that the mount point is owned by the user doing the mounting.
I haven't tried enabling mounts for more than one account; if you add lines to fstab for each user, it adds icons for the mount points to everyone's accounts; trying to use ~ for the mount point and credentials doesn't seem to work either.

Backup of tincancamera.com

I couldn't find a recursive authenticated ftp client for the Bubba - its version of wget doesn't accept the --ftp-user arguments - so I've used wget with htpp to crawl the site, which gets everything except the access logs. I hadn't read the access logs, and they were putting me over the hosting's quota (they just grow rather than rotating as I'd expect them to), so I got them and deleted them off the server, so I'm using 3MB of the 5 I'm paying for rather than 11.

Static IP

I'd like the Bubba to be on the net, but I don't have a static IP. I'm with Pipex, who are fast and reliable if not the cheapest at the moment, but in addition to their stated charge of £1.25 a month require that my existing service be upgraded to a current plan (the current plans are 8MB instead of 1MB for the price I'm on), but would mean a new 12 month contract. I'm moving in three months, so that would mean paying for nine months I'm not here at £26.24 a month, which is silly - it would make adding a static IP for three months cost £79.97 a month, 1p less than twice what Pipex charge for a dedicated server. I've mailed them to see if they'll give me a static IP on my current £24.99 a month for a reasonable set-up fee, but haven't heard back yet.

More Disks

I'd bought three more 18.4GB disks for my Netras off ebay (Seagate ST318437LC x 3 for £29.89 including p+p), which arrived this morning. After popping down the road to AJM Micro for two dozen mounting screws, they are now installed and (following the guide here - docs.sun.com is nearly as slow as del.icio.us) each give a 16.7G zfs file system for use as a data area for mucking around with:
tercel-1# zpool create data c0t1d0
tercel-1# zfs create data/fs
tercel-1# zfs list
NAME USED AVAIL REFER MOUNTPOINT
data 104K 16.7G 24.5K /data
data/fs 24.5K 16.7G 24.5K /data/fs
tercel-1# df -h /data/fs/
Filesystem size used avail capacity Mounted on
data/fs 17G 24K 17G 1% /data/fs


TME

Labels: , , , ,

2007-02-07

Getting started in C++ on Linux

I've recently updated my Ubuntu partition on my laptop to 6.10 Edgy Eft (presumably an orange newt rather than a religious movement), which plays much more nicely with its touch pad, and am using it about half the time - mostly I live in Firefox, which doesn't care much what the OS is.

I've hidden my Civilisation DVD at the office, so now have other things to waste time on, such as finding out how to program Linux. So I've downloaded Eclipse and am getting the C++ tools as I write. KDevelop doesn't find the help system on the Ubuntu I'm using (which is Gnome rather than KDE), and I think I need help.

Today at work I was trying to formulate a pi-calculus representation of the C++ networking library I'm maintaining, which has a concurrency bug I can't seem to locate. That was hard, so I'm falling back to creating an object syntax shorthand that can be simulated. I'll map the semantics to pi-calculus; it's all sugar, but means the representation that's animated in the simulator is closer to what's being modelled, and you don't have to use the rather complex forms for data structures and places presented in Milner's work.
...
Putting a CD of the installer image into the drive started package manager, which meant I could get rid of the errors in the install of graphviz-cairo, which had failed from Add Programs, and was causing other programs to fail to install.
...
Running Eclipse as a normal user doesn't allow you to add the C++ plugin; whereas normally programs ask you for permissions, Eclipse just fails.
...
Running Eclipse again using sudo, it has to download all the installer files again. But this time it seems to be able to write to the plugins directory where Eclipse is installed by default.
...
Restarting, still under super-user, seems to have C++ tools. HelloWorld.cpp compiles and runs.
...
Close and start under normal user account; it's forgotten my choices (which is not surprising), but appears to be all there.
...
Created a new C++ managed make project.
...
Opened a file on my Windows partition, chose save as, clicked OK assuming it would save to my project's workspace. Instead, Eclipse crashes.
...
I must say that the reason I have never used Eclipse is that each time I have done so - on Windows and OS X, it has fallen over far too quickly for me to get anything done with it. It's also got a pig-ugly UI. It looks like the same may be true on Ubuntu.
...
Restart Eclipse. File>Open doesn't locate previous project. Try to create project again, Eclipse says a project with that name already exists. Project > Open is greyed out, so I can't use that, though why I can't open the project if it exists, or create one with the same name if it doesn't.

Deleted the directory in the workspace, which was empty. Attempt to create a project with the name, but still Eclipse prevents me.

Exit Eclipse, find the empty project directory has re-appeared event though it could not be created, so delete it again and the workspace folder.

Start Eclipse, try to create project again, again it complains "A project with that name already exists in the workspace." A quick search says "This error appears when you have the folder with the same name as your project in your workspace." This is not the case.

Give up and call the project something else for now.

Exit and get an error reporting " Problems occurred while trying to save the state of the workbench."

Start Eclipse again. It reports that an error has occurred.

Remove workbench folder and try again, now Eclipse loads. Try and make project with desired name, and that works now.
Eclipse is saving workbench info in hidden folder in workspace; so the metadata there needs to change rather than just deleting the folder; deleting the folder does not cause an refresh of the metadata to ensure it is consistent.

So doing the obvious thing to erase a project doesn't work, and Eclipse requires that nothing else touches its project folders. Which is a bit of a problem, as I am wanting to use the same source folder layout for both Windows and Linux targets.
...
Open files from the Windows partition; they are read only, so it's not quite going to be as easy as I hoped. Use File>Save As and save first file to workspace, having to navigate there from /home/pete. Select second file (there are several), and it's forgotten where I am saving to. Instead of navigating, I enter the full path in the name box and hit Ok. After a brief pause, Eclipse crashes. F__k knows where my file went.
...
Copy files to workspace/project_name in command prompt. Attempt to add them to the project, get "Source is in the hierarchy of the destination." error. Try again, this time importing from the Windows partition directly. Select the overwrite without warning option, but get warnings that files are being overwritten. But now it seems to have imported the files.
...
Ok, so we are now compiling, and getting errors. The help option brings up a browser in a
tiny sidebar which searches Google. Yay. Given I was using Eclipse in the hope of getting proper help, this is not good.
...
What's the conditional define for Linux?
...
g++ gives some nice warnings, for example member initialisation order in constructors
...
SSE doesn't compile as the option for g++ is not set. Eclipse shows a blank page for the help topic about setting makefile options.
...
Found g++ options in project properties (which is fairly obvious place). No option to enable SSE, so add option manually. Not too difficult this step.
...
The little hash table example compiles and works; tomorrow if it snows I'll be working at home rather than driving into the office, so I may try to get a basic simulator for a process calculus running under Linux.


TME

Labels: ,