it could be called work

Building uniconvertor on OS X, post Snow Leopard

I have been doing some work with laser cutting and to that end, I need to translate files from Inkscape’s native SVG format to other formats, like plt or eps. For quite some time now, this has been failing, as the uniconvertor team — who supply the internal translation functions — have let their code base fall into decay.

Turns out the trick isn’t building uniconvertor, but the underlying library, sk1lib, where the real work gets done. For some reason, sk1lib doesn’t come with the developer-supplied distribution, even though the SK1project offers binary packages for Windows and umpteen variants of Linux. So you can successfully install uniconvertor but it doesn’t check dependencies, so you won’t know it doesn’t work until you try to run it. Annoying, that. They haven’t been particularly responsive, either. Too busy working on 2.0 which no one will care about is 1.x is broken.

I wish I had saved my error messages and other debris to better explain all this but it came together pretty quickly before I knew I was on the right track.

You’ll need the following distributions:

Install the tools, if you don’t have them. Make sure they are up to date. I found I had to rip Xcode out and replace it with this toolchain to get things working. There were some issues with llvm/clang that seemed to clear up after I did that. Next, download, build and install FreeType2. I found this symlink was needed:
ln -s /usr/local/include/freetype2/freetype/ /usr/include/freetype

If I remember where I found it, I’ll credit the poster, though it seems to be a pretty common workaround.

Next, lcms: the usual drill: ./configure, make install clean

Then, build and install sk1libs.

python ./ build; python ./ install --record installed-files.txt

The installed-files.txt is just a list of the files that get installed, in lieu of an actual package manager.

And then this patch has to be applied to sk1libs/src/utils/, either before installation or after.

<       return ['/System/Library/Fonts', '/Library/Fonts', os.path.expanduser("~/Library/Fonts")]
>       return ['/',]

Without the patch, the program will read every file on your system into some list, for a purpose known to no man. The comments point to python 1.5 so I suspect it’s long overdue for review and refactoring. Credit for this goes to Valerio Aimale.

Credit for this discovery goes to the Inkscape developers who are trying to get the OS X releases of Inkscape in parity with Windows and Linux.

Finally, uniconvertor-1.1.5 — python ./ build; python ./ install --record --installed-files.txt

And that should do it. Test it out.


next steps

Following up on this post I realize I have a very serious problem: the lack of self-esteem or value makes it hard to sell yourself or your ideas. If your underlying belief system is that everything you say or do is of no consequence, it makes it hard to get through the interview process, assuming you can even get one.

If you don’t believe you deserve it, you won’t get it.

The best advice I could have given myself, had I realized it, is that relying on jobs that other people create and define is never going to work for me. Temperamentally and physically/biologically I’m better off doing my own thing. But then there it is: how do you sell whatever it is you’re doing or making if you don’t believe it’s any good? And how could it be good, if you made it?

Imagine how you would manage this if you were faced with having to find a whole new life for yourself in less than a month due to a failed domestic situation? If you’re a reasonably normal person, well-adjusted and comfortable with yourself, this may not be a big deal. You have friends or other resources.

But that’s not my situation. Thirteen years I have lived here and I have no network to draw on and not much in the way of local knowledge to use to navigate a new course. It’s going to be a rough stretch.

it could be called work

swap usage monitor

Wrote this little thing to keep an eye on how swap usage grows. I find that when it exceeds physical RAM, things get boggy.

LAST=`who -b | cut -c18-50`
RAM=`system_profiler SPHardwareDataType | grep Memory | awk '{ print $2 * 1024 }' `
TOTAL=`du -m /var/vm/* | grep swap | awk '{total = total + $1} END {print total}'`
if [ ${TOTAL} -ge ${RAM} ]; then
logger "swap in use = ${TOTAL}, exceeds installed RAM (${RAM}), last reboot was ${LAST}, recommend reboot"
open /var/log/system.log # this opens the log in the Console application so you can see it/can't ignore it.
exit 0

Though, to be fair, it’s not as bad as when I had some useless never-looked-at Dashboard widgets. That was a performance killer. That discovery was inspired by this.I used to check this by simply using

du -sh /var/vm
6.0G    /var/vm

but that didn’t catch that there was a hibernation/sleepimage file in there.

-rw------T  1 root  wheel   4.0G May 22 01:12 sleepimage
-rw-------  1 root  wheel    64M May 22 04:05 swapfile0
-rw-------  1 root  wheel    64M May 22 04:05 swapfile1
-rw-------  1 root  wheel   128M May 22 04:05 swapfile2
-rw-------  1 root  wheel   256M May 22 04:05 swapfile3
-rw-------  1 root  wheel   512M May 22 04:05 swapfile4
-rw-------  1 root  wheel   1.0G May 22 04:05 swapfile5

That’s why I just add up the swapfiles themselves. The one thing I would add is a more informative display of the time since reboot: getting days (?) since reboot would be more informative. But that requires more jiggery-pokery with date(1) than I care to deal with. I’m sure some clever obfuscated perl could be cooked up but I want this to use only tools I know will be available.

Update: this just went off (opened up the Console app) and displayed these messages:

May 22 21:59:04 ivoire[1] ([26487]): Exited: Killed: 9
May 22 21:59:04 ivoire kernel[0]: memorystatus_thread: idle exiting pid 26487 [xpcd]
May 22 22:04:32 ivoire[2211] ([26538]): Exited: Killed: 9
May 22 22:04:32 ivoire kernel[0]: memorystatus_thread: idle exiting pid 26538 [cfprefsd]
May 22 22:04:33 ivoire kernel[0]: (default pager): [KERNEL]: ps_select_segment - send HI_WAT_ALERT
May 22 22:04:34 ivoire kernel[0]: (default pager): [KERNEL]: ps_vstruct_transfer_from_segment - ABORTED
May 22 22:04:34 ivoire kernel[0]: (default pager): [KERNEL]: Failed to recover emergency paging segment
May 22 22:04:34 ivoire kernel[0]: macx_swapon SUCCESS
May 22 22:05:02 paul[26584]: swap in use = 4096, exceeds installed RAM (4096), last reboot was May 20 17:51 , recommend reboot

This — Failed to recover emergency paging segment — looks alarming. I doubt it is. It’s not new, in any case.


Something I learned today

It’s taken me about 40 years to fully (?) process this.

“J.T” is a simple, hour-long story of a young boy living in a New York ghetto, but it tackles some weighty issues.

[From J.T. Reviews & Ratings – IMDb]

I saw this movie right after it came out, so around 1970. The “weighty issues” it deals with are racism and poverty in mid 20th Century America but an 8 year old English boy living in Canada didn’t get any of that. You have to read a few more of the reviews to learn what I saw. And from what I can tell, I never saw the end of the movie, as you’ll see.

I saw it with my mother, in the front room of our house, and for some reason, I remember it as a summer afternoon, with long shadows everywhere. The storyline of the movie I remember was that a poor black kid finds a cat in an abandoned building and it becomes the center of his universe, something for him to love and care for, to look forward to being with. But some older boys who have nothing to love or care about find him sneaking into this old building and they catch him in the act of caring, of loving. They take the cat from him and play “keep away,” teasing and taunting, until one of them runs out to the street and slips, sending the cat into traffic where it is killed by a car, right in front of the young hero.

At this point, I burst into tears. All I saw was a small boy — like myself — who lost something precious due to the cruelty of others, out of the simple meanness and unempathetic jealousy of those who don’t know how to love.

My mother laughed at me for crying. She laughed at a child for expressing a natural emotion. She didn’t do it to minimize the effects or soften the blow. She offered no comfort, no compassion. She was no different from the boys on the screen, who hate to see anyone or anything receive love.

And that response to my openness, my willingness to openly feel, made me close up and hide that part of myself from the world. It made me fear rejection to the point where almost every decision I have made since then has been to avoid it. And to avoid rejection is to avoid life. It means not trying things, not risking exposure to the hurt that comes from being rejected.

My mother and I, if we were ever close, weren’t after that. Soon I was on my way to a new life in a new family in a new country south of the border, but that scabbed-over hurt stayed with me for years, many, many years. I expect the other changes only made me keep that of myself wrapped up tight.

It was only in the past 2-3 years I would allow myself to openly express that kind of feeling, to let the tears flow. And only rarely and at home.

I saw my mother twice after that before she died in 2003, a span of 33 years, and neither experience was positive. No, we weren’t close. There’s more but it’s not relevant here.

I didn’t realize until today that there was more of the movie after that scene, so badly was I hurt at the time. I never saw it or remembered it, I guess. I knew there was something about that moment, frozen in my mind, but I never quite realized what it was, what it all meant.

This has been coming clearer the past few weeks, the realization that I have shut myself off from far too many experiences and opportunities but not understanding why.

People think saying “no” doesn’t cost anything. It does. It can cost you everything.

It’s been a cathartic day. Just recounting the story brings more than a tear to my eyes. When I put it all together this morning, I was in pretty bad shape. And I expect the next few days will be up and down as I come to grips with the understanding of what happened and what I can do now.

I’ve always wondered why Philip Larkin’s “This Be the Verse” resonated with me. What he describes is not unique to my experience but now that first line is going to stay with me, at least as far as an apt description of one of my parents. It’s never been far from my mind…maybe now I understand why.

Following up here.