Archive for April, 2009

Sort CLI output by line length

Want to sort file contents by each line’s lenght? No problems:

artemn@artemn-laptop:~$ cat /etc/passwd | awk '{print length, $0}' | sort -n | awk '{$1=""; print $0 }'

Continue reading…

Faces behind Linux — Part #1

What/who you imagine when you hear the names “Ubuntu”, “Debian”, “Slackware”, etc?  Is this tux, penguin, disribution logo? Have you ever wondered who is behind certain Linux distribution?

Ian Murdock -- Debian LinuxIan Murdock (left) founded Debian while a student in 1993. He named Debian after himself and his then-girlfriend Debra, now his ex-wife, thus Deb(ra) and Ian.

From Ian’s blog:

Debian was one of the first Linux distributions and arguably the first open source project that explicity set out to be developed in a decentralized fashion by a group of volunteers. Today, over 1,000 volunteers are involved in Debian’s development, and there are millions of Debian users worldwide.


Mark Shuttleworth -- Ubuntu LinuxMark Shuttleworth (right) who founded Ubuntu Linux was the second space tourist and one of Debian’s key developers. His biography is too interesting to be published here so just use google to get more facts. Mark:

I can pay, however, because ten years ago when I was still studying at the University of Cape Town in South Africa… Linux allowed me to compete with the best companies in the world, without any obstacles between me and success. That made me a billionaire; so I could fly into space and do many other wonderful things.

Gael Duval -- Mandriva LinuxGaël Duval (left) was born 1973. He is a graduate of the Caen University in France where studied networks and documentary applications. In July 1998, he created Mandrake Linux (now Mandriva Linux), a Linux distribution originally based on Red Hat Linux and KDE. He was also a co-founder of MandrakeSoft (now merged in Mandriva) with Jacques Le Marois and Frédéric Bastok. Gaël Duval was responsible for communication in the Mandriva management team until he was laid off by the company in March 2006, in a round of cost-cutting. Duval suspected part of the reason for his dismissal was disagreement with management over the company’s future strategy, resulting in a lawsuit against the company. Gael:

It was clear for me that Linux had the potential to be an excellent alternative to Windows, or maybe even a full replacement, and at the time I thought that it would be good to provide a Linux distribution that would be as easy to use as Windows.

Patrick Volkerding -- Slackware LinuxPatrick Volkerding (right) was born 20th October 1966. He is the founder and maintainer of the Slackware Linux distribution. He is the “Slackware Benevolent Dictator for Life”. Volkerding earned a Bachelor of Science in computer science from Minnesota State University Moorhead in 1993. Patrick in 1994:

Linux is my big fun project right now – gets pretty crazy sometimes trying to keep up with all of the development going on; for instance, last week the new C libraries, GCC, and kernel were all released within a couple days of each other. Luckily, I like keeping my machine current. Judging from the mail I get when things fall a bit behind, so does everyone else.

Daniel Robbins -- Gentoo LinuxDaniel Robbins (left) is best known as a founder of Gentoo Linux project. During his time as a system administrator at the University of New Mexico in Albuquerque Robbins first came into contact with Linux. He became a developer on Stampede Linux, and later formed his own distribution Enoch Linux, which was later renamed Gentoo in 2002.
Daniel in 2007:

The logic is as follows: it is impossible to write a kernel module without it being a derivative work of the kernel, which is GPL, so in turn the module itself must be distributed under the terms of the GPL and thus cannot be binary-only/proprietary in nature.

To be continued…

Tiny bash scripts: check Internet connection availability

Sometimes it is necessary to check whether server you want to run some big bash script is connected to Internet. Usually it makes sense while running scripts periodically using cron.  Below is the tiny bash script for this purpose:

#!/bin/bash

WGET="/usr/bin/wget"

$WGET -q --tries=10 --timeout=5 http://www.google.com -O /tmp/index.google &> /dev/null
if [ ! -s /tmp/index.google ];then
	echo "no"
else
	echo "yes"
fi

As you see it tries to download google’s index page, if it’s not empty script returns “yes”, if there is not Internet connection available script will return “no”. If it is impossible to fetch the page in more than 5 seconds script will return “no” as well.

Anything to add? You are welcome! :)

Watching HD Media on Linux made easy

h1_camcorder_1

This article is presented to you by LaptopLogic.com. Go there to read the latest info on the top rated laptops and the best laptop accessories.

The High Definition (HD) content is everywhere these days, from HD and Blue Ray Discs to streaming HD media. Although HD content gives best picture quality, it also uses a lot of computational power to decode and play.

This was made easy for Windows by the introduction of new drivers from graphics card manufacturers, Nvidia and ATI, which allowed the whole media to be decoded on the dedicated graphics card, saving cost in computational power, and the need to have a stronger processor.

nvidia graphicsNvidia recently released a new set of drivers for Linux supporting PureVideo technology for its line of graphics hardware, enabling full hardware HD-decoding, and giving smooth HD content playback, even on less powerful computers. The 180 series supports PureVideo decode acceleration. These drivers adds a new VDPAU API, which provides PureVideo like features on Linux, adds CUDA support, X Render optimizations, new workstation performance optimizations and some other improvements. The new versions offer optimizations and support for a wide range of Nvidia hardware, and is expected to improve with future releases.

Linux uses X-Video (Xv) as output extensions, where as X-Video MotionCompensation (XvMC) is an X-Video extension which offers some video decoding on GPU. With the new drivers, Nvidia implements VDPAU (Video Decode and Presentation API for UNIX).

VDAPU is capable of hardware acceleration and the decoding of MPEG-1, MPEG-2, VC-1 and H.264 bit streams. It also provides an API for post-processing of decoded video in order to apply operations such as noise reduction and temporal and spatial de-interlacing, timestamp-based presentation of final video frames, and compositing of sub-picture elements.

amd-4800-series-graphic-cardAMD also supports hardware acceleration through X-Video Bit stream Acceleration or XvBA API. The recent drivers can take advantage of Unified Video Decoder (UVD2).

These new technologies are also supported by new video playback softwares, which can fully utilize the Graphics Hardware for video playback, providing smooth frames in HD and Blue-Ray movies. The VDPAU supported players include libavcodec, mplayer and ffmpeg.

CUDA support is also provided with 180 series drivers for Linux, and it can also be used to accelerate videos, and also to do any processing involved, like CoreAVC 1.9.0 is the first media player to offer this decoding.

The video acceleration on Linux came late, but certainly, with these new advancements by Graphics chips manufacturers, Linux users will be able to experience HD media playback, even on less powerful systems.




Friendly Sites:Who is behind Linux Screw?
GeekyBits³ | Bash Cures Cancer | OMG! Ubuntu!
My SysAd Blog | Web Upd8
ZEPY | Linux config Wiki | Planet Sysadmin
a non-geek's linux notes | Linux Today
Linux HOWTOs, Tutorials & Projects with Adam Palmer | LinuxAlt.Com
My name is Artem N. (artiomix AT gmail DOT com) and I'm Linux/Unix, Cisco systems engineer. The main idea of Linux Screw is to share relevant knowledge, skills and observations over The Web. Here you can find a lot of information related to different Linux distributions, FreeBSD, IOS as well as a other Open Source around staff. Read more ››