Monday, April 27, 2009
How To Take Your Computer Apart
How to Take Apart a Computer -- powered by eHow.com
I think it's funny that this guy prefaces this video tutorial with "Don't know why you'd want to take it apart, but..." when so many final exams in beginning computer hardware classes, like mine, involve taking apart a computer and putting it back together. (Of course, I think it's the reassembly that's the real challenge.)
Tuesday, April 14, 2009
Fun with cat

When I started learning about the Bourne shell this semester in my Intro to Linux class, I discovered cat. No, you can't get a whole book out of it, though this interview (with the accompanying proposed O'Reilly cover) was my favorite April Fool's Day joke.
However, cat is actually pretty useful. Short for "concatenation," it directs standard output of a file or a command to the terminal. The most basic use of cat is to type the command at the bash prompt, followed by a line of text. Here's what happens:
$ cat print this line of textThe command line is "standard input." The line that prints out to the shell is "standard output."
print this line of text
Use cat to quickly view files.
OK, maybe that's not incredibly useful, at least for our purposes. But, say, what if you have a really messy home directory, with a lot of practice files? Like this:
DEADJOEYou could go into an editor like joe or pico and open each file individually--kind of the way you have to do with most GUI word processing/text editing applications. Or you could do it much more quickly with cat:
a*
a.sh*
a~*
b*
b.sh*
b~*
c*
c.sh*
cat.txt
cat.txt~
cattemp
c~*
dogs
dogs~
glupr
glurp
soopersekrit
$ cat soopersekritThat's all! I think I was trying out the joe editor with this file. Nothing to see here. But this could be really important later--say, what if you're investigating an intrusion incident and you're going through a huge number of files and directories to see if there's a nasty little rootkit script hidden away there somewhere? That can speed things up tremendously, although the security engineers I know probably use scripts that automate that process. For longer files you want to use | (pipe) and the more filter.
ok, here's a soopersekrit file that I'm going to copy.
seems pretty intuitive.
C-x-s saves.
$ cat jeoffrey | moreThis will show you a page of a file at a time--like the one above, "For I will consider my cat Jeoffry," a long, affectionate paean from harmless 18th-century religious lunatic Christopher Smart to his feline companion. (I like to use it for playing with long files, because it's a charming poem, and because it seems appropriate to use with cat.) Just press the spacebar to proceed.
Use cat to redirect output from one file into another.
You could use cp or mv to do this, but you might find cat more expedient. Here you use the redirect output symbol (>):
$ cat fun_with_cat > fun_with_cat_backupAlways be very careful with this command, though, because if you try to redirect output into an existing file, it will replace any content in that file. To safeguard against this, you can enable a feature called noclobber, which displays an error message and won't permit the command to be executed.
Use cat as an editor.
Want to get something down quickly, without leaving the command line or opening up a new shell? Just use cat to start sending input to a new file:
$cat > notes_on_catWhen you're done, control-d saves and exits the file. But as with redirecting output, be careful that if you return to the same file that you don't end up overwriting what you've previously stored there. To pick up where you left off, use the append output symbol (>>):
Things I can do with cat:
1. Preview files quickly.
2. Redirect the output from one file into another. (careful!)
3. Use cat as an editor.
$ cat >> notes_on_catCat does have limitations as an editor, though--you can't go back and edit text, and you can only delete the line you're working on. So while I first attempted to draft this entry entirely in cat, I found it a wee bit impractical. But for taking notes while playing around with the Linux shell, it's incredibly useful. There are lots of other things you can do with cat involving pipes and tees and filters, but these are the three I've found most helpful lately. I'm hoping to add more of the useful things I've gleaned from my classes here--it actually provides something of a review for me and keeps me in shape as a technical communicator.
OK, what was I saying? Cat is a very useful command.
Monday, April 6, 2009
the luxury of being alone...

"For my belief is that if we live another century or so...and have five hundred a year each of us and rooms of our own; if we have the habit of freedom and the courage to write exactly what we think; if we escape a little from the common sitting–room and see human beings not always in their relation to each other but in relation to reality; and the sky, too, and the trees or whatever it may be in themselves...if we face the fact, for it is a fact, that there is no arm to cling to, but that we go alone and that our relation is to the world of reality and not only to the world of men and women, then the opportunity will come..." --Virginia Woolf, A Room Of One's Own, 1929
Right: This nine-year-old girl currently shares a bed with two little brothers in a California motel. Her parents and a baby brother have the other bed. (Credit: Monica Almeida/NY Times)
Reading this article about families displaced by the economic crisis (can we call it a depression yet?) has been causing me to reflect on one of those privileges, generally afforded more to men than to women, and far less to kids from families in straitened circumstances: private space.
It's something I've taken for granted--X and I don't have children, so we rattle around in a 2100-square-foot, four-bedroom house. When I started coursework in computer science, though, I found myself working a lot more on the Windows box in the library, which I need for two of my classes (and now use for the third, with a PutTY connection). Being down there with X and the cats was pleasant...but, I have to admit, kind of distracting. So last week, with X's blessing, I moved the library computer upstairs to my study and realized how important it was to have a dedicated workspace where I could think and concentrate without interruption.
I've discovered now that I can work--really get lost in my work--for long periods of time without getting distracted....and that I'm not lonely--just knowing that X is somewhere in the house is comforting, but I don't have to be in the same room with him.
I think, though, how lucky I've been, mostly. Growing up, I had my own room on an upper floor in my family's house, which I did not have to share with my sister. I had a desk and bookshelves, and it was quiet. My mother, like most mothers, made a lot of noises about me spending so much time in my "ivory tower," but I was (and continue to be) rather introverted, and it was a sanctuary without which I would have gone nuts. This is what I would do when I came home: walk into my clothes closet (a tiny 4 x 6 space), close the door, breathe deeply in the darkness, and emerge into my room as though it were separate in space and time from all the craziness in other parts of the house.
I think now of women and girls who no longer have rooms of their own, who live in motel rooms and with relatives, with no place to put their books or do their homework or sit quietly and think, or write. Will they again, someday? What will it do to their hopes and dreams, all this overcrowding, this lack of lockable doors? That private space, so briefly a common expectation in shared Anglo-American culture less than ten years after Virginia's death, is now more important than ever.
Project Dignity in Southern California is helping the family of the young lady in the picture pay their motel bills each month while they get back on their feet...and hopefully, give her a room of her own sometime soon.
Tuesday, February 24, 2009
Here I have to pen a belated valentine to my beloved X.
I met him for lunch in Campustown today, and we were talking about my classes. I was telling him about battling a serious case of (beginning) programmer's block, and how I figured out how to fight it on Sunday evening by getting out my notebook and just writing pseudo--
"Code," he finished. "I was just going to suggest that." He also suggested something else I hadn't thought of: when he doesn't know where to start, he starts by writing descriptive comments: i.e. "This program will do _____," or "The user now inputs _____ variable."
From the moment that I, while contemplating the end of my full-time job, came up with the idea of going back to school, he has been, without any hesitation whatsoever, my biggest cheerleader. Actually, the general response from my boss, co-workers, and assorted friends and family members has been overwhelmingly positive...not really surprising, considering that most of the people I work with or hang around with are geeks who think computer science is good for everybody, but it's still a revelation compared to the general reaction I got from family, friends, and acquaintances when I started graduate school fifteen years ago, which was mostly veiled hostility, outright suspicion, and, in one puzzling case, malicious glee. Only X was unconditionally supportive.
But this time he's not just supportive, but excited. I suppose there's some inherent risk to having a spouse who long ago mastered everything you're studying now, that he might push or be impatient with you, but X has been none of those things. While I struggle with code late at night he sometimes camps out in a recliner in the library and dozes, in case I need his help with something. I think his training as a professor probably contributes toward his unflappability in the face of my ignorance and occasional stubborn inability to learn. He's also deeply aware of all my old math and computing hangups. More than anything, I think he wants me to fly...and he doesn't want to do anything that might damage my fragile wings.
Now he smiled at me, in the noontime sunlight. "It makes me so happy that you're doing this," he said, again, for maybe the hundredth time. He knows I won't fail. For him, this whole decision is a no-brainer. He doesn't know what the future will bring for me, but he knows that this will only help me, that the unpaid leave from work, the tuition (inexpensive, but still around $1500 a semester for a full courseload) is an investment, that it will make me more valuable in the future, when things are better. And for once, I don't find negative thoughts interfering with my ability to concentrate; I don't find myself questioning the purpose of what I'm doing, how I'm spending my time. I want to make this whole effort entirely worthwhile, and I want to make him proud of me, and there's really no need to keep these two goals apart.
I met him for lunch in Campustown today, and we were talking about my classes. I was telling him about battling a serious case of (beginning) programmer's block, and how I figured out how to fight it on Sunday evening by getting out my notebook and just writing pseudo--
"Code," he finished. "I was just going to suggest that." He also suggested something else I hadn't thought of: when he doesn't know where to start, he starts by writing descriptive comments: i.e. "This program will do _____," or "The user now inputs _____ variable."
From the moment that I, while contemplating the end of my full-time job, came up with the idea of going back to school, he has been, without any hesitation whatsoever, my biggest cheerleader. Actually, the general response from my boss, co-workers, and assorted friends and family members has been overwhelmingly positive...not really surprising, considering that most of the people I work with or hang around with are geeks who think computer science is good for everybody, but it's still a revelation compared to the general reaction I got from family, friends, and acquaintances when I started graduate school fifteen years ago, which was mostly veiled hostility, outright suspicion, and, in one puzzling case, malicious glee. Only X was unconditionally supportive.
But this time he's not just supportive, but excited. I suppose there's some inherent risk to having a spouse who long ago mastered everything you're studying now, that he might push or be impatient with you, but X has been none of those things. While I struggle with code late at night he sometimes camps out in a recliner in the library and dozes, in case I need his help with something. I think his training as a professor probably contributes toward his unflappability in the face of my ignorance and occasional stubborn inability to learn. He's also deeply aware of all my old math and computing hangups. More than anything, I think he wants me to fly...and he doesn't want to do anything that might damage my fragile wings.
Now he smiled at me, in the noontime sunlight. "It makes me so happy that you're doing this," he said, again, for maybe the hundredth time. He knows I won't fail. For him, this whole decision is a no-brainer. He doesn't know what the future will bring for me, but he knows that this will only help me, that the unpaid leave from work, the tuition (inexpensive, but still around $1500 a semester for a full courseload) is an investment, that it will make me more valuable in the future, when things are better. And for once, I don't find negative thoughts interfering with my ability to concentrate; I don't find myself questioning the purpose of what I'm doing, how I'm spending my time. I want to make this whole effort entirely worthwhile, and I want to make him proud of me, and there's really no need to keep these two goals apart.
Wednesday, February 4, 2009
I SO NEED THIS BOOK, PART I
Morrow, James. Shambling Towards Hiroshima.
X, who knows my love for all things Godzilla, will know what I'm talking about.
And Morrow is the guy who once said, "'There are no atheists in foxholes' isn't an argument against atheists, it's an argument against foxholes." If he's got a sense of humor, maybe he'll read a little like Mark Twain (who dabbled in science fiction a bit himself, after all). Here's hoping. I'm very picky about science fiction in general.
Via Scalzi.
X, who knows my love for all things Godzilla, will know what I'm talking about.
And Morrow is the guy who once said, "'There are no atheists in foxholes' isn't an argument against atheists, it's an argument against foxholes." If he's got a sense of humor, maybe he'll read a little like Mark Twain (who dabbled in science fiction a bit himself, after all). Here's hoping. I'm very picky about science fiction in general.
Via Scalzi.
Tuesday, February 3, 2009
catching up...
So. Three weeks have gone by, and this marks the fourth. How are things so far?
I'm still adjusting, I think. And there's a lot to adjust to. I haven't been a student since the spring of 2000, and a lot has changed since then.
I don't really worry too much about being a returning adult student. For one thing, I don't want to be That Woman, the one your mother's age who sits in the front of the class ostentatiously taking notes and nodding violent comprehension and shouting out the answers to all the questions and and monopolizing the professor and trying otherwise to show what an exemplary student she is, the one she should have been thirty years ago except that flunking out/marriage/pregnancy/miscellaneous adolescent rebellion got in the way.
No, I was the perfect student twenty years ago (minus the more obnoxious habits, I hope) and it didn't really get me very far. These days, I sit in class, I listen carefully, I take down anything I haven't heard, I don't speak up unless no one else has the answer, I ask questions not for the sake of asking questions but because I really need to know something or am intensely curious about it, and I don't obsess over my grades. But what I'm thinking about when I sit down at my machine and log on to the Windows XP VM two nights a week in class, or get into the online course website other evenings, is what I can get out of this session, how it will affect what I want to do later.
I do things differently, though. When asked for freehand drawings of both the exterior and internal workings of my home PC, I supplied diagrams created using PowerPoint. "I'm a technical writer," I said to my instructor. "This is how I do stuff." Freehand just wasn't going to cut it. I was a little startled that no one else in the class had thought to do this--it seems that if you have tools at your disposal, you should do things properly, and it really didn't take me that long.
One thing I'm still getting used to is the treadmill of studying, homework, studying, homework--and taking two of my classes online kind of complicates things. I have to be careful to check the schedule diligently for unexpected assignments, as there is no physical classroom where the teacher reminds everyone.
I'm also getting used to just how cut-and-dried these courses are: either you get something right, or you don't. Either it's true or false. Either the walkthrough or program works, or it doesn't. I suppose you could have points subtracted for poorly-written code, but still, it's a much less subjective system of evaluation than I was ever used to, and I find the decrease in the number of potential areas rather gratifying, not to mention the immediate feedback from those exercises which are graded automatically. I realize that there are other intangible ways in which I might be evaluated, but at least I'm not second-guessing myself so much about whether I've mastered the material.
Mastering the material, however, is one thing. Mastering Linux or VBasic programming is a horse of an entirely different color. X has warned me about not just blindly following recipes but becoming aware of similarities, parallels, differences in operating systems and languages, fundamentals that are universal (or nearly so). If something goes wrong, I don't want merely to figure out how to fix it and move on (though sometimes that's expedient and necessary): I want to understand what's gone wrong, to gain more insight into the system, so that I can handle similar or related problems later on. So as I do my homework, I try to make myself understand as much as possible, because I want to be able to call on every bit of it when necessary.
And then there's the time management issue. In the humanities, graduate seminars take place once a week. For undergraduate classes, you can often do all your preparation in one sitting--read through Paradise Lost or the "Cyclops" section of Ulysses or whatever in a single evening, scribbling marginalia as you go. But this is different. I tried doing all my programming homework in a couple of days, on the weekend, and discovered the following weekend that life had interfered to such an extent that most of what I'd learned had slipped through my fingers and I had to go back and review it all over again. So I'll do what my Linux instructor strongly urges and try spreading out the whole thing over the course of a week, working for half an hour to an hour on each subject every single night. As I've said before, practice makes perfect.
I'm still adjusting, I think. And there's a lot to adjust to. I haven't been a student since the spring of 2000, and a lot has changed since then.
I don't really worry too much about being a returning adult student. For one thing, I don't want to be That Woman, the one your mother's age who sits in the front of the class ostentatiously taking notes and nodding violent comprehension and shouting out the answers to all the questions and and monopolizing the professor and trying otherwise to show what an exemplary student she is, the one she should have been thirty years ago except that flunking out/marriage/pregnancy/miscellaneous adolescent rebellion got in the way.
No, I was the perfect student twenty years ago (minus the more obnoxious habits, I hope) and it didn't really get me very far. These days, I sit in class, I listen carefully, I take down anything I haven't heard, I don't speak up unless no one else has the answer, I ask questions not for the sake of asking questions but because I really need to know something or am intensely curious about it, and I don't obsess over my grades. But what I'm thinking about when I sit down at my machine and log on to the Windows XP VM two nights a week in class, or get into the online course website other evenings, is what I can get out of this session, how it will affect what I want to do later.
I do things differently, though. When asked for freehand drawings of both the exterior and internal workings of my home PC, I supplied diagrams created using PowerPoint. "I'm a technical writer," I said to my instructor. "This is how I do stuff." Freehand just wasn't going to cut it. I was a little startled that no one else in the class had thought to do this--it seems that if you have tools at your disposal, you should do things properly, and it really didn't take me that long.
One thing I'm still getting used to is the treadmill of studying, homework, studying, homework--and taking two of my classes online kind of complicates things. I have to be careful to check the schedule diligently for unexpected assignments, as there is no physical classroom where the teacher reminds everyone.
I'm also getting used to just how cut-and-dried these courses are: either you get something right, or you don't. Either it's true or false. Either the walkthrough or program works, or it doesn't. I suppose you could have points subtracted for poorly-written code, but still, it's a much less subjective system of evaluation than I was ever used to, and I find the decrease in the number of potential areas rather gratifying, not to mention the immediate feedback from those exercises which are graded automatically. I realize that there are other intangible ways in which I might be evaluated, but at least I'm not second-guessing myself so much about whether I've mastered the material.
Mastering the material, however, is one thing. Mastering Linux or VBasic programming is a horse of an entirely different color. X has warned me about not just blindly following recipes but becoming aware of similarities, parallels, differences in operating systems and languages, fundamentals that are universal (or nearly so). If something goes wrong, I don't want merely to figure out how to fix it and move on (though sometimes that's expedient and necessary): I want to understand what's gone wrong, to gain more insight into the system, so that I can handle similar or related problems later on. So as I do my homework, I try to make myself understand as much as possible, because I want to be able to call on every bit of it when necessary.
And then there's the time management issue. In the humanities, graduate seminars take place once a week. For undergraduate classes, you can often do all your preparation in one sitting--read through Paradise Lost or the "Cyclops" section of Ulysses or whatever in a single evening, scribbling marginalia as you go. But this is different. I tried doing all my programming homework in a couple of days, on the weekend, and discovered the following weekend that life had interfered to such an extent that most of what I'd learned had slipped through my fingers and I had to go back and review it all over again. So I'll do what my Linux instructor strongly urges and try spreading out the whole thing over the course of a week, working for half an hour to an hour on each subject every single night. As I've said before, practice makes perfect.
Friday, January 30, 2009
signs of the times
Things are bad all over. This week we heard that Caterpillar and some other global companies are laying off workers by the tens of thousands. The jobless rate has reached levels not seen since the early eighties, and it's expected to get worse in 2009 before things pick up and turn around.
That's not, of course, how most of us measure economic decline--our index is more anecdotal in nature. Yesterday I tried to buy lunch, only to be told that my bank card was invalid. No, not because I've run out of money, thank goodness. Apparently someone tried to make some purchases using my card number, one of them rather substantial. Fortunately, they were declined, and the bank put a block on my card number. I'm not sure whether it was an honest mistake or someone just trying out my card number with different PINS until they got the correct one, but it made me think immediately of stories like this one, in which an LA consumer columnist had his money and plastic stolen out of his gym locker by someone who immediately went on a spending spree and bought himself a nice new Macbook, among other things. As people get more desperate--either to meet basic needs or to feed a mass consumption addiction acquired in the last couple of decades--you can bet that there will be more ID fraud than ever. And most of it won't even involve physical theft.
Another sign of the times: more insider threats. From Wired:
But R. B. Makwana is a statistic, or will be soon. Insider threats are on the rise, and as the recession deepens, organizations will be at risk not only from disgruntled employees like Mr. Makwana, but also from employees who are dealing with increasing personal debt and are desperate for cash. Obama's administration just put out their cyber security agenda, a major aspect of which will be battling cyber-espionage. If it were a big deal back in August, when this agenda was actually formulated by Obama's campaign, it's an even bigger deal now.
That's not, of course, how most of us measure economic decline--our index is more anecdotal in nature. Yesterday I tried to buy lunch, only to be told that my bank card was invalid. No, not because I've run out of money, thank goodness. Apparently someone tried to make some purchases using my card number, one of them rather substantial. Fortunately, they were declined, and the bank put a block on my card number. I'm not sure whether it was an honest mistake or someone just trying out my card number with different PINS until they got the correct one, but it made me think immediately of stories like this one, in which an LA consumer columnist had his money and plastic stolen out of his gym locker by someone who immediately went on a spending spree and bought himself a nice new Macbook, among other things. As people get more desperate--either to meet basic needs or to feed a mass consumption addiction acquired in the last couple of decades--you can bet that there will be more ID fraud than ever. And most of it won't even involve physical theft.
Another sign of the times: more insider threats. From Wired:
A logic bomb allegedly planted by a former engineer at mortgage finance company Fannie Mae last fall would have decimated all 4,000 servers at the company, causing millions of dollars in damage and shutting down Fannie Mae for a least a week, prosecutors say.Let's set aside the utterly moronic, self-sabotaging nature of this kind of attack. You're pissed off because you think your company screwed you by firing you? You think you're going to show them a thing or two? Well, Mr. Makwana, you just guaranteed that you'll never work in IT ever again, ANYWHERE. Duh.
Unix engineer Rajendrasinh Babubha Makwana, 35, was indicted (.pdf) Tuesday in federal court in Maryland on a single count of computer sabotage for allegedly writing and planting the malicious code on Oct. 24, the day he was fired from his job. The malware had been set to detonate at 9:00 a.m. on Jan. 31, but was instead discovered by another engineer five days after it was planted, according to court records.
But R. B. Makwana is a statistic, or will be soon. Insider threats are on the rise, and as the recession deepens, organizations will be at risk not only from disgruntled employees like Mr. Makwana, but also from employees who are dealing with increasing personal debt and are desperate for cash. Obama's administration just put out their cyber security agenda, a major aspect of which will be battling cyber-espionage. If it were a big deal back in August, when this agenda was actually formulated by Obama's campaign, it's an even bigger deal now.
Subscribe to:
Posts (Atom)