EmmonsNet

Geek Stuff

Home Software Linux

Linux

FFmpeg and BASH: A way to impress the ladies and be the envy of your friends!

E-mail Print PDF

bash consoleWant to show off some mad bash skills while impressing hot babes and being the envy of your friends?

Then have a look at the bash goodness I laid on my linux neophyte friend. About about an hour ago he wanted to convert a whole directory of home videos (stored .wmv format) into .flv and thumbnails for upload to his site.

He had the option of using WinFF. But after playing with it for a while he realized it could not make thumbnails for him. So he called me to help.

First I showed him how to generate a thumbnail for each video file, then create flash versions of each of the videos using for loops and ffmpeg.

Last Updated ( Tuesday, 04 August 2009 22:50 ) Read more...
 
Share/Save/Bookmark

In Linux - power comes with responsibility

E-mail Print PDF

Tux Linux Penguin ... or accountability.

I think every Linux user has committed the cardinal sin of working as root when they should not have been as they were cutting teeth on the OS.

I know I had my colossal blunder when typing the ill fated command at 'rm -rf ./*'  while I was root. Furthermore - I really sealed the fate of my workstation at that time because I was currently in /etc! Only after the command had finished and the command prompt was blinking at me again did I start to get that sick cold and sticky feeling in my gut. I realized what I had just done and hoped there was a way to undo it.

I had a a IRC session currently open and was idling in the #linux channel. I let my fellow Linux users know what I did and asked what the solution was.

I have never seen so many 'LOL's before or since. After all the laughter had finished they confirmed what I knew in my heart of hearts to be the stone cold truth .... I had LOBOTOMIZED my OS. Nothing left to do except stop the sobbing and get to re-installing.

Linux has no undo. Like other *nix OS's, it assumes that since you are bright and brave enough to login to it as root, then you are big boy ( or girl ) enough to take your lumps if you do something stupid.

Last Updated ( Thursday, 30 July 2009 22:20 ) Read more...
 
Share/Save/Bookmark

Useful Linux Trick 'tee'

E-mail Print PDF

In a production web environment that has several web servers, databases and mail daemons running countless domains, having a cool set of utilities is key for monitoring, logging and debugging.

A number of scripts I have written can have a 'testing' parameter handed to them so when they are run with that parameter set they will echo out all kinds useful information. Most of the time sending this to a log file for parsing later is good enough. But, sometimes I have a need to watch it as it happens while still writing the output of my script to a file.

Here is where the command 'tee' comes in very handy.

From the man page 'tee' is defined as follows:

 'tee - read from standard input and write to standard output and files'

Simple enough, eh? You bet it is.

For instance, let's say I have written a script called uber-leet-script.sh, but I want to watch the output as it runs and still log the output to a file called 'uber-leet-script.out'. Just for simplicity, we will assume both the script (which I have chmod'd 755) and the file I want to log the output to are in the same directory.

I would run my script like so from the command line:

$ ./uber-leet-script.sh | tee ./uber-leet-script.out

Once I hit enter, I see all the output. Sometimes the bug in my script will be blatently obvious in what I see from the output and I can just CTRL-C it on the spot. Other times it may scroll past so fast and I could miss the telling bit of output. No problem there because I have the file, uber-leet-script.out to parse through until my heart's content.

Last Updated ( Thursday, 23 July 2009 12:34 )
 
Share/Save/Bookmark

OMG! My Console is Fracked!!

E-mail Print PDF

Screwed Up Console SessionI have a friend who I recently turned on to Linux. A few months ago his frustration level with Windows prompted him to call me - begging to help him install Linux on a second drive he just dropped into his home desktop computer. A few hours later we had the latest release of Fedora installed.

Since that day, he has called me up for a few tips from time to time on how to do things. Until last night, all of his queries were easily answered over the phone or instant messanger. But last night, he called me frantic.

'My terminal console is Fracked!!! I just echos garbage characters.'

This I had to see. Ten minutes later I was sitting in front of his desktop and sure enough, his terminal session was echoing nothing but unreadable characters.

'What was the last thing you did before this started happening?

'I wanted to know more about "cat", so I typed "/usr/bin/man cat"'.

Right then, I knew what we did. Why did I know? Because when I was a linux neophyte ( aka NEWB ), I did the same thing myself more than once. I inverted words at the command line and sometimes it gave spectacular and terrifying results.

Last Updated ( Tuesday, 23 June 2009 12:04 ) Read more...
 
Share/Save/Bookmark

Google Earth Slow in Linux? Update your OpenGL / Mesa!

E-mail Print PDF

Open GL LogoI love using Google Earth on one of the windows workstations at the office. But, until tonight, I did not use it very much in Linux.

I use Slackware on my desktop workstation and home and Fedora 9 on my laptop. With both distributions of Linux, Google Earth ran at a glacial pace. The maps rendered partially at times, others they would tile incorrectly showing the same map tile over and over. Always it took several long moments for the map to refresh with any input.

It was frustrating as hell! So, I abandoned the idea of using Google Earth on linux and contented myself to using it only on Windows.

All this while I was making the classic 'newbie' mistake. Back in the mid '90s when I was fist learning Linux, many of the gurus in the #linux channels of the IRC networks never failed to tell me RTFM when I would ask the simplest questions. At first I thought they were being elitist and mean.

Last Updated ( Thursday, 28 May 2009 23:10 ) Read more...
 
Share/Save/Bookmark
Page 2 of 2