Browsing all articles tagged with software

How to Copy Terminal Session into a File

Have you ever wondered how to copy the output of your terminal into a text file? Or maybe you teach Linux and you want to see what your students typed in and as well as the output? You think that running history is not enough? Then you need the script command.

Running script command

Open the man page of script command and you will see this:

Script makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an interactive session as proof of an assignment, as the typescript file can be printed out later with lpr(1).

In a nutshell, it is history and tee all rolled into one. It will record everything you see on your screen, even the color. So if you typed in an invalid command, you will see the error in the log or if you run it correctly, you will have the output. But commands like top that refreshes the screen at an interval will most likely ruin the session or the log, so try to avoid similar commands.

To use it, just type the command script and it will begin recording the session. Once you are done, just type exit.

This is script in action:

rai@host1:~> script -a /tmp/script_test.log

Script started, file is /tmp/script_test.log
rai@host1:~> ls /home
R20 r200 R21 rai xx19
rai@host:~> thisnotacommandbutirunitanyway
bash: thisnotacommandbutirunitanyway: command not found
rai@host1:~> exit
Script done, file is /tmp/script_test.log
rai@host1:~> cat /tmp/script_test.log
Script started on Mon 17 Jan 2011 06:24:12 PM PHT
rai@lhost1:~> ls /home
R20 r200 R21 rai xx19
rai@host1:~> thisnotacommandbutirunitanyway
bash: thisnotacommandbutirunitanyway: command not found
rai@host1:~> exit

Script done on Mon 17 Jan 2011 06:24:54 PM PHT

The example above shows that script was started with -a option meaning it will append the output the specified file.

A better way to do this is to use it together with mkfifo command:

On Terminal 1 (Student’s terminal):

rai@host1:~> mkfifo /tmp/script_test.fifo
rai@host1:~> script -f /tmp/script_test.fifo

On Terminal 2 (Teacher’s terminal, same machine):

rai@host1:/tmp> cat /tmp/script_test.fifo

The above scenario will perform the following:
1) On the Student’s terminal, it will create an named pipe /tmp/script_test.fifo (man mkfifo) then run the script command with the -f option that ‘flushes’ out the output after each run. The Student’s terminal will look like it is not responding at this point, but don’t worry, it is perfectly normal.
2) On the Teacher’s terminal, the command cat will read the output file. Once you run the cat command, the session will be started.

Try the above steps and see how each screen behaves. Check also if doing the script command will create a populated output file.


Mozilla Breaks Guinness World Records!

It is now official! Guinness officials announced that Firefox holds the record for the largest number of software downloads in 24 hours with 8,002,530 number of Firefox 3 downloads beginning 18:16 +UTC on June 17, 2008 to 18:16 +UTC on June 18, 2008.

Firefox community now has 180 million users in 230 countries all around the world. The best part of it is I am part of the event! And of course you are too, if you downloaded Firefox 3 on that date. And to celebrate this joyous event, you can get your personalized Firefox Download Day certificate here.

Congratulations, Firefox team!


MythBusters: 7 Tech Headaches – and How to Fix Them

You read it right. Mythbusters just served us painkillers for those tech problems that makes our heads ache. This article in was written by Jamie Hyneman from the oh-so-cool Discovery Channel show Mythbusters.

From the article:

Computer operating systems loaded with stuff I don’t want and will never use.

In the tech world this phenomenon is known as “software bloat” or “feature bloat.” It’s a well-documented problem and a frequent complaint about Windows OSs—Vista in particular. In addition to being buggy, the extra features tend to bog down your system by demanding more processing power and memory. Computer-makers: Don’t load up operating systems with features and then make us sweat to figure out how to get rid of the fat.

Most features can be set up as options. Why not start with a computer loaded with basic stuff that works 100 percent of the time? Then, give us the option of adding the bells and whistles. There’s another solution available to consumers: Switch to a Linux-based OS such as Ubuntu. Since most Linux OSs are free, there’s no business reason to bloat up the system with feature frills.

And high-tech companies—stop messing with us on your treadmill of upgrades while making the old stuff obsolete. It may be that any software company that didn’t routinely upgrade its product would go out of business. But what if the rest of the world worked this way? Oh, I lost a sock. I need to get a whole new wardrobe because the replacement sock is version 2.0.1, and the stores now only sell version 2.0.3.

And I so totally agree with him. The only reason I want to upgrade my software is if there are any vulnerabilities that need fixing. If not, wise men say don’t fix it if it ain’t broken. That’s why I love Linux. You do not have put in what you don’t need. You wouldn’t want food shoven down your throat, do you? :D


Torvalds: Microsoft is bluffing on patents writes:

Microsoft’s aggressive defense of its intellectual property, which includes claims that Linux violates a number of its patents, is nothing more than “a marketing thing,” according to Linus Torvalds, creator of the Linux kernel.

“They have been sued for patents by other people, but I don’t think they’ve — not that I’ve gone through any huge amount of law cases — but I don’t think they’ve generally used patents as a weapon,” Torvalds said. “But they’re perfectly happy to use anything at all as fear, uncertainty and doubt in the marketplace, and patents is just one thing where they say, ‘Hey, isn’t this convenient? We can use this as a PR force.’”

Torvalds made the comments during the second half of an interview conducted by the Linux Foundation Executive Director Jim Zemlin on Oct. 16. The foundation is expected to make the rest of the interview publicly available on its Web site Monday. The foundation released the initial portion of the interview in January.

“Another reason why I don’t think Microsoft really seriously would go after patents is when you’re a convicted monopolist in the marketplace you really should not be suing your competitors over patents,” Torvalds continued. “I think that most Microsoft lawyers would say, ‘You know, let’s not do that; that sounds insane’.”


Save Your Files With FlyBack

Still looking for a backup program for your Linux files? Finally, FlyBack is available to Linux users to backup our stuff and save our a$$es from humiliating and headache-producing data loss.

FlyBack is a snapshot-based backup tool based on rsync It creates successive backup directories mirroring the files you wish to backup, but hard-links unchanged files to the previous backup. This prevents wasting disk space while providing you with full access to all your files without any sort of recovery program. If your machine crashes, just move your external drive to your new machine and copy the latest backup using whatever file browser you normally use.

Bernaz’s Weblog writes about FlyBack and you can continue reading here.