Installing Windows truetype fonts on Linux

(On VectorLinux, to be precise… but it might apply to many other flavors of Linux as well.)

So I have a bunch of fonts on Windows, some of them nice. ;-) And I wanted to copy them to Linux. I don’t know what the big deal is here. I looked this up and found pages that listed a large number of steps, often involving Wine and cabextract and whatnot. It can be done in a much more straightforward manner, provided you have Dropbox on both systems:

  1. Type “fonts” in your Windows 7 search bar.
  2. Select the fonts you want, and copy them (as in, Ctrl+C). They will appear as .ttf files.
  3. Paste them into your Dropbox folder.
  4. In Linux, copy the .ttf files from Dropbox  to /usr/share/fonts/TTF.

That’s it. Now I can run Consolas in my terminal. :-)

:: Comments off

Random thoughts

My first experiences with programming were with Commodore Basic and assembler (sort of). The problem with learning programming that way is, that you often end up seeing programs as a list of instructions. Do this, do that, poke around until it works. Up-front algorithm design is nice but not required. Structured/procedural/imperative languages are less messy than BASIC or assembler, but they still allow for the same style. By contrast, if you try programming like that in a language like Scheme, you’ll end up with a big old mess pretty fast. In Haskell, you probably won’t even get started.

There is definitely something to be said for Logo as a beginner’s language. It’s not a popular choice nowadays, but one of the first things you learn is to split up programs into smaller, reusable parts. Turtle allows you to experiment and get immediate, visual feedback when you change something.

Note to self: Look for possible Logo(-esque) implementations for iPad/Android. I have a smart 3-year-old running around here, it would be interesting to see what she could do. :)

:: Comments (2)

Another old, new iMac

(Listing this here for future reference… and maybe it’s useful for other iMac owners.)

A few days ago, my minions found an old iMac G3 at the dump. And what do you know, it was in excellent condition.

iMac G3 "grape"

But, what to do with it? It’s ~12 years old, so its usability is limited. Then again, bringing me an iMac is like bringing me a kitten… I just don’t have the heart to send it away. :)

To be precise, it’s a tray-loading iMac revision D, 333 MHz G3 processor, color “grape”, 160 Mb memory, 6 Gb hard disk. It doesn’t have a Firewire port, so it probably won’t install Tiger (although there are ways around that); but even if it did, with meager specs like that, it wouldn’t be a happy camper.

(It still had all the original owner’s stuff on it, by the way… good thing I am not into identity theft. ;-)

I installed Jaguar on it first, but I don’t have the CD with developer tools (later to be known as XCode), so that wasn’t very useful. Most modern software isn’t available for Jaguar anymore, anyway; it’s just too old. It was nice to see it again in all its pinstripey glory, but that was about it.

So, back to Linux again. But as luck would have it, none of the Linuxen I tried worked. I mean, they didn’t work at all. They would seem to install properly, then when I rebooted, the machine just sat there, gurgling, not doing anything.

As it turns out, some iMacs need a little help showing graphics properly. I ended up installing Debian 6.0.1 netinst (the PowerPC version, naturally), tweaked xorg.conf, then manually installed XFCE at the prompt. Then startx, and it showed me the desktop without a glitch. It’s a bit slow to start, but after that things are reasonably fast.

(Using netinst, you install only the packages you want… it’s a bit more work, because some important packages like gcc, make and sudo need to be installed manually, but on the other hand, your system isn’t bogged down by stuff you don’t really need. I am using XFCE because it’s relatively lightweight, more so than GNOME or KDE, in any case.)

I am now trying to compile Chicken on it… who knows, maybe this machine will be useful after all. :)

:: Comments (2)

Linux question, followup…

Thanks to everybody who replied to my previous inquiry about booting Ubuntu in text mode. Eventually, I managed to figure out a solution, sort of, after combining several of the tips.

Much of the advice was sound but didn’t really apply in one way or another. For example, Ubuntu 11.04 uses GRUB2, which apparently differs significantly from the old GRUB. This means that many of the proposed solutions didn’t apply (unless I had reinstalled using the old GRUB, I don’t know). There’s no /etc/inittab, no menu.lst, editing the boot menu works differently, the vga= parameter is no longer supported, etc.

The Ctrl-Alt-F1 (etc) suggestions sort of worked, but gave me the same small font, plus I really wanted the system to *start up* in text mode.

The reason I chose Ubuntu in the first place was because it’s popular.  My Secret Project (oh, the suspense ;-) involves building something on top of an Unixoid system, and Ubuntu seemed like a logical choice; it’s very actively developed, has drivers for a lot of hardware, etc. But on second thought, it might not have been a good choice for my purposes. Ubuntu strives to provide a smooth, user-friendly experience, which implies a desktop GUI. Support for terminals that boot up in text mode is, understandably, not their first priority.

However, there *are* Linuxen with different priorities. As reader “Kerobaros” pointed out in a comment, ArchLinux may be a better choice. So after a lot of fruitless experimenting with all the advice mentioned in the other comments, I decided, what the heck, I’ll give it a try. (It uses the old GRUB, so that made things easier as well.)

At first it did the same thing as Ubuntu: I could set the VGA mode/resolution in GRUB, and it would start up using that mode, but at some point during the booting process the screen would fall back to the 1024×768-based font. (I figure most people would actually prefer that font, since it’s much more crisp, and more text is visible on the screen, but for my old eyes, it’s not so good.)

Then eventually I read somewhere that this behavior is something that newer kernels do, and that the nomodeset option stops it from happening. It didn’t actually do that on Ubuntu 11.04, but it did on ArchLinux. So now I finally have a Linux install that sets the right font (80×25) and *keeps* it. ^_^

~

I did offer a bounty to the person who could solve this problem. Oddly enough, the “golden tip” turned out to be the suggestion to use Arch Linux. Several people mentioned “nomodeset”, and while it didn’t have the desired effect on Ubuntu, it does work properly with Arch. Given that I couldn’t get any of the other tips to work with Ubuntu 11 at all, I think that Kerobaros should get his pick of the prizes, if he/she wishes.

:: Comments (6)

Dear lazyweb: Wanted: Linux wranglers

(Thanks to everybody who replied. I still don’t have a working solution yet I eventually managed to find a configuration that works for my purposes, combining some of the advice; more about this in a followup post.)

~

OK, here’s an interesting problem for all you Linux masters/journeymen (or maybe even beginners) out there. The whole story is a bit too long to explain it on IRC or somesuch, so I’m doing it here. I’m also offering a bounty/reward; see below.

But first things first. Last week I got an ASUS 1018P. It’s a 10″ netbook that I specifically got to do a certain Project that I have been thinking about for a while now. It currently has Ubuntu 11.04 desktop on it (most attempts to install other versions of Linux failed, but that doesn’t matter right now). In GUI mode, everything seems to work fine; graphics are correct (it’s a widescreen), wireless is instantly recognized, sound works, etc. No problems there.

Now, what I want, is apparently rather unusual in this day and age. You know how in the old days of MS-DOS (or early Linuxen) the computer would boot, and you would get a 80×25 text screen? Well, that’s basically what I want here. I want an option in my boot menu that does just that; instead of booting into the GUI, it shows you a login prompt in 80×25 text mode, and stays there after logging in.

Sounds simple? Not for me. I know a little about Linux, but not enough to pull it all off, because I run into too many problems that I don’t know how to fix. The way I understand it, the new menu option must boot in runlevel 3, and must use a screen resolution lower than 1024×768 (currently it shows a font with more columns/rows than 80×25, which makes the text unpleasantly small on the 10″ screen).

(The machine is capable of showing 80×25, by the way; it uses it for the BIOS screen, and it also uses it for certain other Linux installations, like Gentoo, so I know it works. It’s just that Ubuntu insists on switching to a higher resolution with a smaller font.)

If you know how to fix this, I would like to hear from you. ^_^ Please leave comments either below, or via email (zephyrfalcon@gmail.com). Assume that I am not very smart and don’t know much about Linux. ;-) In other words, I would need some hand-holding, rather than vague advice.

The first reader to come up with an acceptable solution can pick a “prize” from the list below. To summarize, this is what I need:

  • extra option in GRUB2 boot menu
  • boot in runlevel 3 (necessary for text mode, I think, but feel free to correct me)
  • set screen to a lower resolution, e.g. 640×480 or 800×600, which allows for 80×25 text
  • ideally, the process should be reproducible on other netbooks as well (assuming Ubuntu)
  • BONUS points if everything else still works in text mode (sound, wireless, etc)
  • BONUS points if it’s still possible to switch to a graphics mode using one library or another, and back to text mode (not a GUI, I’m more thinking along the lines of SDL here, etc), and you can tell me a bit about how to do this

~

Now for the rewards. I don’t have money to offer, but I do have a bunch of stuff laying around that I don’t use, and that might be of interest to people. I will send it to you free of charge. NOTE: Sorry, but I can only send it to you if you are in the US or Canada; otherwise the shipping costs will get a little too unwieldy. :( If you are from another country, maybe we can make other arrangements, e.g. I could write some Python code for you, or something.

Books:

  • The Little Lisper, Third Edition
  • Ada 95 Problem Solving and Program Design (Feldman, Koffman)
  • Programming in Ada 95 (Barnes)
  • Unix Ada Programming (Gehani)
  • Data Structures and Algorithms: An Object-Oriented Approach Using Ada 95 (Beidler)
  • Miranda: The Craft of Functional Programming (Thompson)
  • Flex 3: A beginner’s guide (Davis, Phillips)
  • The Art of Computer Programming vol. 1: Fundamental Algorithms, Second Edition (Knuth)
  • Dreaming in Code (Rosenberg)
  • In The Land of Invented Languages (Okrent)
  • Twisty Little Passages (Montfort)
  • Rules of Play: Game Design Fundamentals (Salen, Zimmerman)
  • The Game Design Reader: A Rules of Play Anthology (Salen, Zimmerman)
  • Photoshop CS Bible (McClelland)
  • Magic: The Puzzling (Rosewater)

If none of these are to your liking, I also have a bunch of Magic cards (mostly older ones), fantasy books, video games, disassembled Zoids, etc. Oh, and you get to pick more items if you satisfy the “bonus” conditions listed. :)

Thanks in advance…

–Hans who should really turn in his hacker’s license :(

:: Comments (21)

Struggle

(This is one of those posts written in anger and self-pity, so feel free to skip.)

The other day I got my grubby hands on a new netbook… an Asus 1018P. I have been planning (yet another) Secret Project for a while, and it requires a Linux that runs in text mode. It seemed like a good idea to have a small, dedicated machine for this.

It originally came with Windows 7 Starter, which is basically useless. But, since it has a 250 Gb hard drive, I optimistically figured, that I could run multiple operating systems on it. For example, keep Windows 7, then Ubuntu 11.04 desktop, Ubuntu 11.04 in text mode, and something experimental, e.g. Haiku.

Ubuntu 11.04 desktop edition installed and worked fine. Then the trouble began. Installing another Ubuntu in text mode did work as well, except it refused to boot up. So I could boot into Windows, or Ubuntu with GUI, but not the text mode Ubuntu. It would just sit there with a blinking cursor, doing nothing.

Haiku wasn’t a success either; it didn’t recognize the widescreen, so it looked silly, and after installation it didn’t show up in the boot menu. Apparently there are fixes for this, but since it wasn’t my #1 priority, I decided to skip it.

So, new plan: instead of Ubuntu I would install Linux Mint 11 for the desktop, and Gentoo for the text mode version. Ugh. Linux Mint wouldn’t even boot properly from the CD. It would show some text and then just stop. No installation at all. Gentoo did a better job, I worked through the manual step by step, until I somehow ran into a compilation error while building the kernel (something to do with firmware, I should have written it down). Trying it again, I got a different error, more cryptical. In any case, it refused to compile. I tried to do manual config instead of using genkernel; then it didn’t even boot.

At this point I was ready to just use the whole hard drive for one operating system instead of juggling several. Tried Debian next; that was even more fun, since its installer somehow didn’t recognize the CD-ROM (yes, the same CD-ROM that it was booting from). Ubuntu Server does the same thing, by the way.

OK, so four days later, I still don’t have a text-mode Linux installed. I really don’t understand why it’s giving me such a hard time. The machine itself seems fine. But I didn’t really expect to have so much trouble installing Linux in 2011.

At least I’m not running out of options; there’s still Arch Linux, Red Hat, Mandriva, Slackware, SUSE, … :-) And then there’s the BSDs… I’m not married to a specific OS, I just wanted to pick something that was actively developed and easy to install. Yeah, so much for that.

Maybe I’ll try Gentoo again sometime and report the error… or maybe I’ll get lucky and a new version will be out soon, that happens to fix the problem.

My Secret Project is not off to a good start, though. Step 1 would be, “install a Linux in text mode”… if it’s this hard, I will never get anybody else to use the project. :-/

Anyway, if you know of a Linux that does flourish in text mode, even on obscure netbooks, feel free to leave a comment.

Update #1: More failures from Haiku alpha 3 (gets past the intro screen, then does nothing) and Dragonfly BSD (is installed but some daemon is messed up, and I don’t know how to fix it, which admittedly isn’t Dragonfly’s fault, but still). I should probably take a break and then try what the comments below suggested; I can install e.g. Ubuntu with GUI, then play with the runlevel. I do wish Gentoo worked though… maybe I can do the same with its live CD?

Update #2 (more of a side note actually): As it turns out, in situations like this. it’s very useful to have a little stack of CD-RWs laying around. :) The OS doesn’t install or just plain sucks? No problem, wipe it off the CD and install a new ISO.

Update #3. I’m giving up. This should be the simplest thing to do… install a Linux and be greeted by a 80×25 text mode screen after booting. You know, like we did 20 years ago? And for some reason I just can’t get it done. Resolution is wrong, system won’t boot in runlevel 3… and that is just for the few Linux versions that can be properly installed at all on this thing. I’ve wasted a week on this, I think that’s enough.

:: Comments (3)

Wanted: Python web developer (Pylons, SQLAlchemy, Twisted)

Listen up. A company I used to work for, iTrackr, is looking for a Python developer. I cannot take this job myself, because I have other obligations elsewhere. However, I promised to help them find a suitable developer, so here goes.

What they are looking for is an experienced web developer. The current code they have in place is based on Pylons and makes heavy use of SQLAlchemy, so experience with those is a must. Some parts of the system also use Twisted, so knowledge of that is a definite plus. So is knowledge of web crawling and RESTful APIs. The database used is Postgres. (In general, the more you know about web development, the better… if you know Javascript, HTML/CSS, etc, this will all come in handy, but it’s the back-end stuff that counts right now.)

Let me be clear here. There is an existing code base, parts of which no longer work, and the idea is to get it working again as soon as possible. So what they need is someone who can hit the ground running; someone who can start immediately, take this code, analyze it, and start making noticeable improvements very soon. This is why the candidate must already be very familiar with Pylons and SQLAlchemy; if you “sort of” know it, sorry, this job is not for you.

Note: I don’t work for this company anymore; right now I am simply functioning as the middle man, helping them out to find a developer who is a good fit for this position. I am not a recruiter, so don’t send me your sales pitch; rather, just send me your resume, tell me something about yourself, and if you look like a suitable candidate, I will forward it to the company. You will have to negotiate payment rates, working hours, etc, with their management.

The company is based in South Florida, but you don’t have to be local. Working remotely is an option. Of course, you are expected to keep the team up-to-date through email, IM and/or conference calls.

If you’re interested, drop me a mail at zephyrfalcon@gmail.com. Please mention “iTrackr job” in the subject. I will look at all the replies and send the suitable ones to the company.

(I am using this “informal” way to find a developer, rather than using e.g. the Python Job Board, because they need to find someone *fast*. If necessary, I will repost on the job board, though.)

:: Comments off

Fear and prejudice

I’ve taken up the unholy plan to start learning Haskell. I already knew a little bit of it, and of its predecessor, Miranda. But I have only been scratching the surface; I’m at a loss when looking at non-trivial Haskell code (and possibly even trivial examples).

Problem is, when confronted with it, part of my brain kicks into gear, and complains. This looks suspiciously like math! And you suck at math! You don’t belong here! This language is not for you! You will not be able to understand the more complicated constructions!

And that is exactly one of the reasons why I want to learn it… or at least, more of it. I want to challenge myself. I don’t know how far I will get. It’s very alien territory. Along the way, I expect to encounter:

  • a completely different way of building programs, and thinking about them
  • static typing (naturally), something I dislike greatly because it gets in my way
  • language zealotry (already saw some of that while casually browsing haskell-cafe; no need for a link though)
  • intellectual pretentiousness
  • lots of hairy math (category theory?!)
  • notions of what is considered “good programming style and habits”, that fly in the face of what I am used to
  • limited practical usefulness at first (until I understand the deeper aspects of the language, and how to use it properly)

And I will have to deal with this somehow. How it will work out, I don’t know. Maybe I’ll come back screaming after a few days; I might not be ready for it. But we’ll see.

Another reason for wanting to learn it is this article: Why I’m interested in Haskell. One of the points the author makes is that Haskell is one of the few languages where actual new stuff is being invented. Actual new stuff, not rehashed concepts that Lisp or Smalltalk had decades ago.

(I have been looking for such a language for a long time. Python was a “paradigm shift” for me when I first learned it started understanding the power of dynamic languages. But for the last few years I have been wondering what there would be “after” Python. Is there a language that would give you similar gains over Python, as Python gave over C/C++/Pascal and their ilk? Maybe Lisp, but aside from the syntactic flexibility (by way of macros), it isn’t that different, as the aforementioned article points out. Haskell on the other hand, is a completely different beast — hard to understand, but with definite benefits, and possibly worth the effort.)

In any case, for right now this will just be another hobby project of mine… Interesting developments, if any, will be reported here.

:: Comments off

Cloudy with a chance of vaporware

This is an interesting idea: Cubelets: modular, affordable robotics for kids and students.

Basically you build a robot out of small parts (cubes, in this case), each of which are simple to understand by themselves.

As it happens, I had a somewhat similar idea a while ago… a game that should appeal to programmers. The idea is currently very crude, but it comes down to building a “robot” from 4 parts. There would be blocks that allow it to move, see, jump, shoot, etc. You then put this robot in a certain environment (a level) and program it in some kind of language. You beat the level if it performs a certain task (maybe reaching the end, or picking something up, or even surviving for a certain amount of time… there are many possibilities).

Maybe someday I will take a stab at fleshing out the game idea some more and implement it using my “retro kit” (a small library on top of PyGame that works with a 40×25 text screen like the Commodore 64; currently unreleased). Yes, I realize that saying “maybe someday I will…” is lame. The problem is more that I have too many ideas and too little energy/motivation to implement them. :( The chaotic environment doesn’t help either. >.<

[By the way, I started writing on this blog again, because it's currently somewhat hard to update Aquiline Ascension, mostly because I don't have a Mac that is up to snuff.]

[By the way #2, I am still selling a bunch of stuff on eBay. ;-)]

:: Comments off

Interlude

It seems my “new” iMac is borked. The only Macs I have now are G3s, so blogging and hacking will be limited until I can afford a new one. (Speaking of which, I’m selling a bunch of stuff again. :-)

I suppose I *could* whip up Yet Another Blogging System using Gauche, but yeah… you can only write the same software so many times. ;-)

I was also trying to hack on something else in Gauche, but life kept interfering…

(( Gauche Scheme is seriously underrated, by the way. Although it’s an interpreter, it’s pretty fast; in an informal benchmark that I did just for the hell of it, it beat Chicken, Gambit, Scheme48 and Racket. Oh, and Python. ;-) I noticed this before, when it processed SXML much faster than *compiled* Chicken code. Also, it comes with a bunch of libraries baked in, and has a decent Windows version. What’s not to like? Well I do have a list of ideas for improvement actually, maybe someday I’ll blog about it… ))

Anyway, the plan is now, to raise ~$2000 so I can buy an iPad and a Mac that can actually be used to develop iOS software. Hence the renewed selling of stuff… As usual, I am also available for odd jobs and part-time work.

:: Comments (2)

« Previous entries Next Page » Next Page »