In OSX, users are created starting with UIDs 1000. So the admin user is 502, I’m 501, and so on. Also, the ‘staff’ group ID is 20.
On Debian, users are created starting with UIDs 1000. So I’m 1000, my testing blank account is 1001, and so on. The ‘staff’ group ID is 50.
This is a bit of a problem when I want to share files. Since it’s just me on the computer, technically I could just mount the drive with full read/write permission to me. But I don’t want that. I don’t want to be able to muck around with stuff outside my /home (or /Users/) directory without really trying hard.
Debian squeeze comes with FUSE installed, and has bindfs, but the version of bindfs that comes in the repo wasn’t up to date enough, so you may need to compile your own.
There will be quite a big performance hit from using bindfs. Some benchmarks (linked from the bindfs page) reckon about 80%. Not a problem for me here, since it’s fast enough. But to be aware of.
Here’s a script which I put in /etc/init.d/osxfixperms.sh to run this on bootup.
Which I’ve then installed (on debian) with (as root)
update-rc.d osxfixperms.sh defaults
You’ll need to be mounting the OSX drive *BEFORE* this happens. Generally, that means stuffing it in /etc/fstab in the appropriate way. You can ask google / debian docs. It’s fairly well documented. Unlike using bindfs.
is the link. I put it together in a few hours, it should have been quicker, but I’m still re-acquainting myself with python.
It is a nice language.
One thing I did today, while cleaning up a bit, was wonder about something I remember from doing python years ago - string concatenation. Joining two strings (texts) together.
“Hello” + “World” -> “HelloWorld”
I remembered something about it being slow, and python recommending using
‘’.join((“Hello”, “World”))
which seems to me one of the most blatently ugly obscure gotchas I’ve come across in a long while.
Anyway, I refactored my code into that style - converting databases and song lyrics and writing XML stuff is pretty much all Text formatting and concatination.
It made no discernable difference. So I went back to normal easier to read x += y, and x = y + z type of code.
There is a reason why I prefer text based / commandline / unix interfaces.
“Why?” You may ask?
So I had to update a website – basically changing from ‘2011’ to ‘2012’ – for someone. Once I got in to the file manager (web based) I could find the graphics files to replace, reasonably easily, and upload new ones.
But I needed to update the text of the banner. No .html files, or .inc or anything to edit.
So I went to the “WYSIWYG” editor section of the site. I could edit everything, except that part. And the footer. And the page title. So, I could edit the “articles”, but not much else.
After hunting around for a while, I decided to try the “Website Management” area. Total different interface again, loads of settings boxes and tabs. I found there on different pages where I could set the page title, and so on. But I couldn’t find the banner! Anywhere!
Eventually, this morning, I found it.
In “Website Management” -> “Structure” -> “Website Settings” -> “Code Injection” -> “Advanced” -> “Site Banner HTML Override – Edited”
I hadn’t found it before, because the section I needed was “Site Banner HTML Override”, and to find that, I needed to look through a drop-down box which was displaying “Extra Header Code (within )” with some javascript includes.
SERIOUSLY.
What is wrong with just having a bunch of text files, and then letting me type
“grep 2011 *”
And it giving me a list of files to edit? HOW is this graphical interface any easier?
OK. So ‘grep’ isn’t common English, I know. Learning basic unix does have a steep looking learning curve. At first.
In case you’re interested, I started, months and months ago, writing an “English-like” command shell.
So you could type commands like:
“list all files which contain 2011”
and it should tell you.
It’s on sourceforge, the first alpha versions of the code.