definitely interested.

Archive for the ‘linux’ Category

Bootable

In learning, linux on May 26, 2010 at 3:28 pm

Next task: make a bootable USB thumb/stick/drive/thing to rescue a busted machine (In this case, little old Brahms). dkg, as ever, knows what’s what and gave me great advice:

Bootable USB sticks are just like bootable hard drives for modern computers. Partition them with parted, use mkfs to create a filesystem on them, use grub-install to give them a bootloader, put a kernel and an initial ramfs on them, configure the bootloader to load them, and away you go.

He even offered me his filesystem rescue debirf image with the latest 686 kernel from debian unstable. Read the rest of this entry »

That’s Your Answer?

In events, learning, linux, misc on April 15, 2010 at 1:28 pm

My new friend Jen lured me to a panel last night. Part of LMCC’s Access Restricted series. Worth checking out, though I wanted a lot more from Intellectual Property in the Age of Reproduction.

We barely touched on the very interesting questions of copyright transgression, copying and fair use. Which is really too bad. Two quick observations before I get back to work. Read the rest of this entry »

Screencasting

In learning, linux, various on April 5, 2010 at 4:24 pm

I’m starting to make some screencasts for DocumentCloud and sincerely hoping that parts two and three of Alan Pope’s screencasting screencast really are forthcoming. Hoping without much optimism.

Nonetheless, screencasting I am.

The screencast was helpful, but needed some text accompaniment. I tried to add same in the comments but they haven’t been approved in over a week and I’m not confident. So here’s, basically what he said: Read the rest of this entry »

Resisting …

In linux, various on March 4, 2010 at 7:12 pm

… the temptation to apologize for how rarely I’m here.

Mostly, I’m working. For better or for worse, I’m on the tweets a great deal. And I’m reading about software patents and hacked software and thinking, generally, that obscurity won’t help you all that much.

In quick succession I listen to Eben Moglen talk about Facebook and total information awareness and then Daniel Ellsberg on the Stasi and total information awareness. I’m thinking a lot about the things I can’t tell you these days. Or the things I should just preface. Like that I thing privacy and software freedom matter. Some people think it matters even more than I do, to be sure. But there are good reasons why, say, backing everything up to Google is just a bad idea. (Mayfirst members can rsync things to a backup server. It isn’t free, but you know what it costs. I don’t think we put good numbers on our privacy because we don’t know what we’re giving up.)

These are the things I’m doing while I’m not blogging. Learning about the piriformis and the sciatic nerve. Patiently correcting every economic commentator who call the housing market “bad” (falling home prices are good for renters who’d like to own something, you see). Looking for a foam roller. Which apparently you can’t just walk into a store and buy. Feeding my interns dried mango with chili and lime and feeling victorious that they’ve finally (finally!) accepted a treat from me. Thinking about what makes me happy and suspecting it is as simple as B12 (and sleep). Looking for new things to learn.

Blargh, Blimey, RAM, DVD

In linux on December 13, 2009 at 6:34 pm

Okay, lazyweb:

Why can’t I play DVDs and why, when I have installed in my computer two RAM modules of 2GiB each, does my computer have 2.9 GiB of the RAMS? Why?

On the DVD end, I have installed one million things and gotten from an error in Totem (“no uri handler implemented for dvd”) to Totem quietly crashing when I try to play a DVD. VLC spins the disk and then stops. /var/log/messages shows this after trying to run VLC:

Dec 13 13:10:02 luna kernel: [10853.901791] sr 1:0:0:0: [sr0] Add. Sense: Media region code is mismatched to logical unit region
Dec 13 13:10:02 luna kernel: [10853.906376] sr 1:0:0:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Dec 13 13:10:02 luna kernel: [10853.906386] sr 1:0:0:0: [sr0] Sense Key : Illegal Request [current]
Dec 13 13:10:02 luna kernel: [10853.906397] Info fld=0x98d0
Dec 13 13:10:02 luna kernel: [10853.906402] sr 1:0:0:0: [sr0] Add. Sense: Media region code is mismatched to logical unit region
Read the rest of this entry »

Font?

In flaneurie, linux, misc on August 31, 2009 at 2:14 pm

I’ve procured a vector drawing of the Manhattan bridge finials. The next challenge, in case this was getting too straightforward, is to identify the font from the bridge’s dedication plaque. Or find something close.

And, in the spirit of free association, while meeting the book ripper, I also learned a thing or two that I’ve been wanting to know about free OCR software that works, a thing I had pretty much given up on. The word on the street, though, is that both Tesseract and Cuneiform are worth a gander. The latters’ entry on wikipedia being perhaps a useful jumping off place.

So I could OCR the plaque. But that won’t actually help me pick a font. Is it just Garamond? (And, is the plaque even original to the bridge? I have a sneaking suspicion it is not.)

A World of Opportunities

In Stating the Obvious, learning, linux on August 28, 2009 at 3:47 pm

I’ve been kicking around the right way to announce a thing I announced to my colleagues a week ago. That thing being that I’m leaving Gotham Gazette. The reasons are both simple and complex, but the simplest is that the publication really, really needs someone to evaluate web analytics tools not someone to tackle the big, fun, challenging question of why New Yorkers aren’t more interested in public policy. Well, I think they do need the latter, but fundamental scarcity of resources means that the former is winning out.

These are good questions, though. The civic engagement ones, I mean. Is it because we think policy is impenetrable and our legislators are all bought? Is it because we don’t notice that land use decisions matter until developers are breaking ground on a sky rise across the street? That we think the game is won already? I’m not sure, but I think changing the way people think about local policy is a really interesting part of our project here.
Read the rest of this entry »

Lesson Learned

In learning, linux on May 19, 2009 at 4:12 pm

We’ve got two packages running, OpenX and Phorum, that seem to make a lot of database connections. Sometimes so many that the whole database runs out of connections. Phorum gets hammered by bots looking to exploit vulnerabilities in the code (and sometimes finds them). OpenX is just greedy. Or needy.

So I got smart. I limited the database users that those tools connect as to just a handful of connections. Which solved one problem: we stopped getting errors complaining that there were too many users connected to the database. But we started finding that the site would slow to an absolute crawl from time to time.

Talking it through with a friend, he pointed out that what I was probably doing was causing all the rejected database connections to queue up and wait. Kind of not the ideal solution, though I bet I could further fine tune things to prevent that as well. A better idea, since the Phorum forums are entirely archival at this point, was to restrict any and all post requests in the directories where Phorum is running. In htaccess you’d say something like:

<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(POST) [NC]
RewriteRule ^(.*)$ – [F]
</IfModule>

So that’s where I’ve left things for the moment. We’ll see how we fair.

PS. How much do I love that you can make a firefox search bar out of anything?

This Time I Mean It

In learning, linux on May 13, 2009 at 8:13 pm

The Frankenserver must go. Today we were having a little bit of woah with the old Phorum installation. Does seem to get derailed, that one. More on that later: the net result was that Apache was choking to the point where I couldn’t even ssh into the machine. I phoned Ye Olde Rackspace, who confirmed Franken’s unresponsiveness and had the data center reboot it.

And for a split second I was able to get in and run top, which showed me a whole lot of apache processes. More than I’ve ever seen before. I quit top and tried to stop apache:

sudo /etc/init.d/httpd stop

That failed the first time but being a persistent sort of woman I tried it again. And then I called Rackspace to find out what they were doing. We have a support contract with them, you see, and I realized that … 1) I don’t want to work at cross purposes with their esteemed technical whiz-kids, and 2) I don’t want to do work someone else is already doing. I’ve got other things to do. Blogs to read. That was a joke, by the way. I don’t read blogs at work. Ever.

So I get them on the phone and whiz kid one says to me “well, I’m just going to restart apache here and see what that tells us.” What restarting apache tells us. And before I could say “hang on” he did. Just in time to snarl my request for the tail of apache’s error logs. It just went down hill from there, the upshot being that I mostly resolved the problem despite Rackspace. I’m done paying $350+/month for Rackspace. They aren’t earning it.

I’ve been moaning about this server for eons. When last we left off I was contemplating life without a service contract. I can see now that I don’t need this service contract. Liberating revelation, that one.

Elastic clouds scare me because I don’t understand them. Also because I don’t think I can have a static IP on a cloud. VPS I understand. So now I’m sketching my new server and workplan. Here’s what I think I’m installing: Read the rest of this entry »

Wireless commands that work

In linux on December 12, 2007 at 5:13 am

Hypothetically, let us say that you just paid cash for a wireless router from a guy who goes by the name “Sir Yoda.”

Let us say then, that you were looking forward to using this router. Google knew the default password. Off to a good start. Anything plugged into the Barricade seems to be online. On a roll. The point of doing business with a guy named Yoda was to be able to take Brahms downstairs to where the table is big and you can eat ice cream without fussing with coasters. You want wireless.

What little bits I already worked out back in May got me as far as some errors to search on (errors like There is already a pid file /var/run/dhclient.ath0.pid with pid 14919232), which got me to:

sudo /etc/init.d/networking restart

Which worked. I’m connected, though sans encryption. Next challenge? Read the rest of this entry »

Back that *** up (and a plug for Mikey’s Hookup)

In linux on June 15, 2007 at 1:31 am

N’s got a super-sketch-spyware-adware-trojan beast on his computer (that is what you get for browsing with IE, says I) — the kind of thing that you get from clicking the wrong button and launching some kind of ActiveX installer. It won’t go away. No amount of Spybot Search and Destroy or Spyware Doctor will make it go away (speaking of Spyware Doctor, later we can talk about how I feel that the Google Pack is all or nothing. What if I don’t want Google to take over my screen saver? Sure, I can uninstall it later, but why not let me choose in the beginning?).

We’ve given up trying to eradicate it, so I took a field trip to Mikey’s Hook Up where knowledgeable people took a break from their ping-pong game to ask me a few questions and point me towards a reasonably priced external hard drive so we can back up our home drives from his computer and start over. Got that? Knowledgeable people, enjoying their workday. I can’t tell J&R and Best Buy apart, but I am pretty sure that no one really tries to help you at either one. They sure don’t at Radio Shack. And you don’t get to play ping pong on your breaks at Best Buy. It is okay to shop someplace where the staff aren’t being forcibly crushed into a homogeneous model of “Perfect Customer Service” that involves no service whatsoever.

Back to the hard drive, though. I know that we could bring the malware with us, but, having evaluated the risk, we’re not that stressed out about it. Moreover, since the option is to just erase everything, we may as well try.

Since our fancy new LaCie (designed by Porsche, ooh la lah) drive has a gazillion gigs available, I get to back Brahms up, too.

Here’s what I did. I’d love to know if you’ve got a better idea:


[0 amanda@brahms ~]$ cd /media/LACIE/Brahms/
[0 amanda@brahms Brahms]$ sudo tar cvpfz backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/mnt --exclude=/sys --exclude=/dev --exclude=/media --exclude=.Trash /

Note that Ubuntu mounted the drive of its own accord. It is not inconcievable that a person could have to mount a drive themselves if it doesn’t just automagically appear. If you don’t like my only relevant archive, you could try searching the internets.

I made up the “.Trash” part because I couldn’t find any documentation of how the tar --exclude option handles regular expressions. If I backed up the trash, okay, I backed up the trash. Worse things have happened.

Still, I’m wondering. Did I do the right thing? I created separate (duplicate) backups of a couple of directories where I store working documents (my home directory and /var/www/html but those were a little more straightforward.

PS, can i just tell you how much it warms my heart that Princess Oh-my-god-she-saw-me-without-makeup Melissa also is totally over ga-ga weddings. It isn’t just because I’m a difficult and belligerent punk, it is because people go out of their heads and they need to just not.

Finding Large Files (for the command line novice)

In linux on February 24, 2007 at 9:02 pm

This isn’t the first time that I’ve spend a wee bit too long trying to figure out how to search for large files on a file system. I think if I were a trained computer type person, I’d intuitively know what printf means and how to slice and dice the find command. I don’t, and I’ve been struggling with this for a bit. I’ve got a file system that is in a state of deep disrepair (it is full) and I need to figure out, among other things, whether there are really big files somewhere that I should know about. As usual, I inherited this file system from someone who inherited it from someone who was pretty smart and clever but not necessarily an expert or someone who took the time to do things the right way. So I’ve got a lot of puzzles before me. du and find shouldn’t be among them.

For starters, if you are just getting the hang of the command line, man, the manual command is your friend — it will describe all of the options available to a particular command. Usually, a web search for “man somecommand” will also point you to a manual page somewhere on the great interwebs. Even “man find” points you to a few manual pages before the flurry of links to advice on finding yourself a man. For bonus starters, get the O’Reilly Linux in a Nutshell book, because it is fantastic for puzzling through this stuff.

Read the rest of this entry »

Password Recovery in Single User Mode

In learning, linux, various on February 27, 2006 at 8:07 pm

I just realized that Jack was looking around for this, which isn’t live yet. Wasn’t. Is now or you wouldn’t be reading it …

Got a Linux server but you don’t know your password? It happens. Usually it happens because someone set it up two years ago and since then it has just worked.

And then one day, for some reason, you couldn’t connect to the file share. One thing you can do is try booting with a live CD but if you just need to reset the password, you’ll need to first boot into single user mode. Because Linux is Linux, nothing is ever simple, starting with the fact that just knowing that you are running Linux doesn’t tell me what boot loader you are running. The boot loader is the program that loads when your computer starts up–this program, in turn, loads your operating system (er. actually it loads the kernel, which loads the operating system, but I don’t want to get ahead of myself). Windows comes with a boot loader, the Mac OS comes with a boot loader. Linux comes with a choice. The odds are good that your boot loader is either Lilo or Grub.

Briefly, from there, here is how you do it if your boot loader be grub and if your boot loader be lilo this’ll help, though I think that’s got directions for Grub, too.

LDAP

In learning, linux, various on January 21, 2006 at 12:24 pm

I am still puzzling through this LDAP question. The question is roughly this: what is the right way to store my own phone book on a server so that I can access it via whatever address book is available to me on whatever computer I’ve managed to land in front of?

Most organizations I work with would use their databases more and better if they didn’t have to also maintain their email based address book in Thunderbird or Eudora or Outlook. Address changes would make it into the database and be shared across the organization if it were that easy. A database that needs a lot of other data about a person and what they’ve been involved in, that you’d have to access through a database interface, but the addresses alone could be LDAPish and that would be handy.

Catch is, I just don’t get it. I will, I just don’t yet.

For instance, it sort of seems like a webhost with a lot of LDAP libraries installed ought to be able to support an LDAP server. Seems like. Seems like if I knew where to start, I could start, but I don’t.

Slowly, over a very, very long stretch of time, I’ll get there. Hopefully when I do, I an leave a trail that will make a ton more sense to the next person than the crumbs I’ve been able to find.

Just use a live CD

In learning, linux, various on January 19, 2006 at 2:01 pm

File under famous last words … sure, boot it from CD. Great. And then? What?

This, is what:
http://arainyday.se/notebook/windowsrescue.php
http://www.ubuntuguide.org/
More specifically:
The live CD boots its own operating system. If you want to access files on an existing hard drive, you need to find and mount that hard drive. fdisk -l will show you any attached disks (such as an internal hard drive) that can be mounted. sudo mkdir /media/windows will create a mount point or a place to find the hard drive in your linux file system and then sudo mount /dev/hda1 /media/windows/ -t ntfs -o nls=utf8,umask=0222 will actually mount the drive to be readable in that directory. If your old hard drive is FAT not NTFS, you’ll need a different command: sudo mount /dev/hda1 /media/windows/ -t vfat -o iocharset=utf8,umask=000 (fdisk -l should tell you how the drive is formatted)

Now you have to decide whether you are going to start by backing everything up. A bit of advice if you are actually trying to restore a fried system: you want to start by backing everything up. So, to back things up you need some kind of external drive. Probably a USB type of something, which you’ll need this handy command for: lsusb.

Which tells you that it can see that USB DVD-RW, but doesn’t tell you how to mount and write to it. I got tired of trying to figure that out, though I’m sure that some sequence of four commands would have gotten me up and running toot sweet.

Instead I went back over to the spanking new eMachine they’d bought, enabled a share drive (actually someone else had already done that part) and looked up its IP address (open a DOS prompt and give the ifconfig command). Then I enabled the ethernet interface (system > preferences > networking) and connected to it as a windows share (places > connect to server ... ; the service type is windows share, use the IP address of the destination computer in the server field.) and started copying things over and burning them to CD from the working computer. Not ideal since some kind of trojan horse is likely what brought down the old machine, but it works, and the new computer doesn’t have anything on it yet so this was safe enough.

Question for the kids at home: how could I have actually mounted the DVD writer?

ubuntu, fuse and samba

In learning, linux, various on November 21, 2005 at 11:31 am

Slowly, and also quickly:

I was trying to mount a samba share so that I could access it from the command line. That is straightforward if you know what you are doing, but if you don’t, well. Welcome to the fog.

This is a useful thing that was hard to find: http://packages.debian.org — you can search for packages. If you can find fuse, and then you can get down to business:


sudo apt-get update
sudo apt-get install fuse-utils
sudo apt-get install smbfs

That was one of those things that everyone just seemed to assume I would know. “Just install it with apt-get” … install what? fuse? It isn’t there. smbmount? nada.

Now I know. Now you know, too.
sudo mount -t smbfs //downtown/Users /mnt/downtown -o username=[username],password=[pass]

Now downtown is in my path!

Oy, but I still can’t play MP3 files!

Back to the drawing board: I need gstreamer to play restricted file formats but just un-commenting the “multiverse” line in my /etc/apt/soures.list wasn’t enough to enable it. I was getting all kinds of errors so shamelessly followed this advice which helped me update my sources so that the gstreamer utilities would install.

Mmm. Food. Now I can listen to doom at work. Some people don’t even have to think about it, but look at all they miss out on!

Oy, and they said Linux could do anything …

In linux on November 11, 2005 at 1:55 pm

It is really the little things, like there isn’t a flash player for Linux on PPC. Ask too many questions and they’ll tell you that you don’t really need flash. Who needs flash? Well, me. For one thing. I like it. With a lot of searching the Ubuntu forums I finally confirmed that it really is a PPC issue. Nice to know I am not crazy, would have been nicer to know that without so much work.

So there’s two things you can do with Ubuntu on a PowerBook: skype and flash. Alas.

I’m hoping these fine gentlemen can get me situated: UbuntuPPC.info

Samba Samba

In learning, linux on November 8, 2005 at 1:54 pm

We have a lovely, relatively new SuSE Linux server in our office and a SMB share that gets backed up regularly. I like to use it. You know, for sharing things. I had no trouble creating shortcuts to the shared directories that I use, but my head is going to explode if I can’t figure out how to get OpenOffice to show me what is in a shared directory before I save to it. Some times I can work around this and it isn’t so bad. I know where the file should go. Sometimes I am trying to save a grant proposal and I want to see if this is really the directory that it is supposed to end up in. I can see that by seeing what else is in the directory. I am not asking for the sky here.

On a related note, (related because I can’t just point to anything in my directory structure when it is really a smb share) I like vim (and I have to use it because I don’t like the text editors I’ve found so far for vim like things) and I want to be able to open some text files from the shared drive in Vim. I can open them in open office, but vim smb://server/Users/amanda doesn’t get me anywhere.

I heard a rumor that …

with older versions of samba servers, you can mount them in your fstab. there’s also something called FUSE (a userland file system space thing) there’s a lot of discussion as to whether or not user-space filesystems belong in the kernel. (ie, Linus says “no”) but I’d look for FUSE, and also I’d try the mount / umount method of attaching them (the later is what OS X does)

I’ll be doing some investigation. I also have this to go on.

This: sudo mount -t smbfs //downtown/Users /mnt/downtown -o username=username,password=password ought to work, but doesn’t. Here is what the system log has to say:

[1324145.366237] eth1: New link status: AP In Range (0005)
[1324457.264963] eth1: New link status: AP Out of Range (0004)
[1324457.359436] eth1: New link status: AP In Range (0005)
[1324552.947574] eth1: New link status: AP Out of Range (0004)
[1324553.665238] eth1: New link status: AP In Range (0005)
[1324613.083440] eth1: New link status: AP Out of Range (0004)
[1324613.168185] eth1: New link status: AP In Range (0005)
[1324876.140151] eth1: New link status: AP Out of Range (0004)
[1324876.230793] eth1: New link status: AP In Range (0005)
[1324914.600323] smbfs: mount_data version 1970496882 is not supported

I know it is off topic, but what is up with the link status bouncing in and out of range like that?

PS. I am really sorry if I somehow gave you the impression that my blog is interesting to anyone but me.

Dang Linux

In linux on November 8, 2005 at 9:15 am

I wish had some journal entries from adjusting to OSX. I hated it. H-a-t-e-d it. Now I miss it so. Quanta does not do multi-line searches, which is helping my perl syntax immeasurably, but that isn’t why I switched OSs.

Today, special, I am trying to figure out package management, Quanta, CVS, Cervesia and Kompare.


amanda@tamari:~$ sudo apt-get install cervisia
Password:
Reading package lists... Done
Building dependency tree... Done
Package cervisia is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
libcvsservice0 libcvsservice-dev kdesdk-doc-html
E: Package cervisia has no installation candidate
amanda@tamari:~$

I have a few questions: is this a repository issue? Am I calling it wrong?

Is this going to be an issue anyhow since I am using primarily Gnome and I think all the good stuff is wanting KDE? Does Quanta work better in KDE? The whole window manager thing secretly confuses me a little bit.

PS, on an unrelated note, I would really love if my input here was color coded and stuff. I miss using a nice, rich, text editor. Vim, quanta, bbedit, textpad — I’ll take any of them over this dang textarea.

linefeeds are easy

In learning, linux on November 2, 2005 at 10:34 am

Tags: ,

This happens a fair amount, in different ways: a text file, when I open it with vim in a shell account, has no line breaks — they are all ^M. This file used to be readable, even in Vim. I don’t know if someone else edited it or what. I don’t know who to blame, or how to keep it from happening again. One way to find out whether someone edited it would be to look in the CVS comment history for the file, but I don’t know how to do that, either.

  • What does ^M mean?
  • it is ASCII character 13, aka CR or ^M–the Mac OS carraige return character. Unix and Linux software tend to favor the line feed charcter, ASCII 10, aka LF or ^J. DOS based stuff (eg Windows) use both, carraige return plus line feed \n\r aka just to be tricky.

  • How can I eradicate it with a search? The string is a single character, I ought to be able to replace it with line breaks, but I don’t know how to type it.
  • CTRL-m is theoretically how you type ^M, so you can actually drop it into a search and replace statement, but in order to get it to work (and not just execute CTRL-m) I had to type CTRL-vCTRL-m. Try it out. This command :%s/CTRL-v CTRL-m//g worked for me in vim, on a file with good linebreaks AND loose ^M characters at the end of each line. The CTRL-v part is terminal specific, so you might find that you have to fuss to get the right combo for your OS, terminal and shell.

  • How did it get there? Did I (or someone else?) edit the file and inadvertently change the line break formatting?
  • That, I still don’t quite know. Coulda been a lot of ways.

  • And then, how can I see a history of comments or figure out when this ^M thing was introduced? I don’t see anything obvious in the CVS Man pages for History.
  • That would be because history is the wrong command. Try cvs log index.php to see the list of comments and cvs diff -u -r 1.3 -r 1.4 index.php to diff to recent revisions (in this case 1.3 and 1.4).

How do I solve this problem?
These commands are important but they don’t actually work in every case:
:set ff? will tell you what vim thinks the file format is. You can change it with these:
:set fileformat=unix
:set fileformat=dos
:set fileformat=mac

You can search and replace within vim:
:%s/CTRL-vCTRL-m/CTRL-vCTRL-m/g which will come out looking like :%s/^M/^M/g as you type it. It seems a little backasswards that this would work, but it happens to. If that offends you …

You can use the “translate” command, tr, which can do character substitution from outside of vim:
tr '\r' '\n' <macfile.txt >unixfile.txt which will replace mac CR characters in macfile.txt with LF and save it as unixfile.txt
tr '\r' '\n' <macfile.txt | grep word which will allow you to search the file for lines containing word– grep doesn’t recognize CR line breaks so it thinks the whole file is one line, which doesn’t yield very helpful line breaks. This one won’t change the macfile.txt, but grep will search the output.

Or a perl script:
perl -p -e 's/\r/\n/g' macfile.txt >unixfile.txt which will convert macfile.txt to unix format, and save the result as unixfile.txt. This is functionally identical to the first example, but since perl is actually a very general programming language, it can also do some other useful things… BTW, he -e means the program will be the next thing on the command line (‘s/\r/\n/g’ – perlese for replace all \r’s with \n’s), and the -p means do this for each line of the file.
perl -pi -e 's/\r/\n/g' textfile.txt will convert the file textfile.txt from Mac-style (CR) line breaks to unix-style (LF), and replace the original file with the converted version (that’s what the -i means).
perl -pi -e 's/\r\n?/\n/g' textfile.txt convert the file textfile.txt from Mac-style (CR) or PC-style (CRLF) line breaks to unix-style (LF), and replace the original file.
perl -pi -e 's/\r\n?/\n/g' *.txt convert all text files (or rather, files with .txt extensions) in the current directory to unix-style breaks. Note that any that were already in unix format will not be changed.
perl -pi -e 's/\n/\r/g' textfile.txt convert the file textfile.txt from unix-style (LF) line breaks to Mac-style (CR), and replace the original file.

I think you can do much of the same with sed, but I don’t know sed so well.

Gratitude: these guys helped me figure out how to say this all coherently. As did the Vim tipsheets on sourceforge

Living with Linux

In learning, linux, various on October 21, 2005 at 2:43 pm

Tags: , , ,

I installed Ubuntu on my (a) PowerBook g4, for all the wrong reasons (neooffice is so slow on OSX, Linux is kewl) and I am trying to adapt, but I have hit the following walls:

* IMAP: I finally decided to go the IMAP route since I am forever failing at syncing my various laptops and checking email efficiently. I set up some folders and things are going fine, but I am confused: if I create filters locally, on one computer and/or move files into folders, will that stick on the server? Also, if I make a folder locally, will THAT stick on the server?

* Plain Text: How the heck to I make the text formatting disappear in the Thunderbird compose view? Grrr. Also, how do I force everything to plain text, coming and going? I know I worked this out on my Mac, but I don’t remember how. I think it was tricky.

Thunderbird is also ignoring my quote messages inline settings for the account in the Local Folders, which peeves me.

http://kb.mozillazine.org/Plain_text_e-mail_%28Thunderbird%29
Never give up: the Thunderbird Knowledge Base set me on the path to the answer for this one, It is a combination of edit > preferences and edit > account settings ... that you are looking for here. Settings are sprinkled all over but it is at least possible to turn off all inline quoting and RTF emailing and force all messages, incoming and outgoing, into Unicode. Whew.

* Threading how do I get a “threading” button to appear on my toolbar? How do I make Thunderbird always thread all folders by default?

* Key Mapping: I don’t have an “alt” key, I only have one control key and suddenly my fabulous open apple keys are moot. To right click without an external mouse I have to mouse over and press f12 which is just weird. I want to do some basic keymapping along the lines of “the open apple is the control key” not map this function and map that function.

* Repositories: I don’t have a command line mysql client, and there isn’t anything listed under Add Programs that fits the bill. I don’t really know how to look at that gui interface and understand how to edit my repository list and I don’t know how find that in a text file, though I know it is there to be found.

* Music: I can’t get Rythmbox to play music off of the network. My music is on the network, is that so hard?

* Saving Files did I already gripe about not being able to navigate to an smb share in the open office save dialog?