Linux.com

Community Blogs



The Cult of the Terminal

I just signed up for a group celebrating the Terminal. It's weird that I would join a group where, in plumbing, this would be the equivalent of celebrating a monkey wrench. I still like the terminal (it certainly makes my job a hell of a lot easier). But preferring the terminal to the GUI strikes me as a bit odd.

It's not so much that the terminal is better conceptually than a GUI but that in practice most OSS GUI's are wretched. There's very little fore-thought, and the lack of design acumen simply makes using them a drag.

When a GUI is terrific, it stays out of your way and allows you to accomplish your goals in a simple manner. Your web browser is a good instance of it. You simply type in your desired destination, et voila! It brings you to a page that will betray you with a good old Rickrolling.

What I'm trying to get at is that there's not a whole lot to terminal output design, but there is for graphical design. Therefore, it requires a whole lot more care than it currently receives from the OSS camp. With positive iterative GUI design improvements though, the terminal will become less and less necessary (and that won't be a bad thing). The KDE project is doing some pretty fascinating things with the desktop, and it's getting to be less that I want to fuss over the irrelevant (read: distracting) details.

I love the terminal, I use it a lot. At the end of the day though, it's just a tool. When there's a better tool, I'll drop it like a bad habit.

 

Simple scripting to save your Wifi connection

Wireless device support and stability have come a long way in Linux since i started using Ubuntu a few years ago.

Now and again though, something can happen to make you lose your wireless connection.  Many people solve this by restarting network manager or by simply restarting the computer.  

With a small script file, you can restart your wireless driver when its on the fritz, quicly and easily.

First create a file: 

gksudo gedit /usr/local/bin/name-of-file

Then add the script code:

#!/bin/bash

modprobe -r your-wireless-device
modprobe your-wireless-device

Save and close your file and give permissions to run it:

sudo chmod +x /usr/local/bin/name-of-file

Finall, run the script by typing in the terminal:

sudo name-of-file

 

Hope this helps some people, not only with keeping you wifi going strong, but also with how to implement simple scripts to make computing easier and funner.

 

-GL

 

 

Excellent Beginning Python Series on LinuxPlanet

Hey all,

I wish to shamelessly plug a series of excellent Python articles on LinuxPlanet. Akkana Peck, ace coder and all-around cool person, has been writing a series of howtos for Python beginners.  Python is a great language for anyone wanting to learn to code; it has a nice clean syntax, an orderly structure, and because it's an interpreted language you don't have to mess with compiling and linking and all those fun things. Which are fun, after you get a grounding in a nice interpreted language like Python.

Intro to Shell Programming: Writing a Simple Web Gallery
GUI Programming in Python For Beginners: Create a Timer in 30 Minutes
Graphical Python Programming With PyGTK

Enjoy, and thanks for reading!

 

Buying or Building - System Options

I'm probably slightly older than the average member here at Linux.com at 47 years of age. I was an early... and a late comer to computers. How could I be both? Well, it's a long story. Go grab that cup of coffee you wanted. I'll wait for you to get back...

My actual career, which no longer exists in the U.S., was RF communication (radio) and audio repair specialist. I was something you may have heard your dad talk about... a component level bench technician. I did this for about twenty years. Then one day I woke up and my job had moved to Korea, then on to China, eventually.

Back in the late 70s and early 80s I was in college learning about microprocessors and machine language. Some of you older folks might remember the 8080A, 8085, and the Z80 processors. They were the bleeding edge of the technology at that time. Nowadays, they're used to control sprinkler timer systems to keep your neighbor's grass pretty and green.

My first experience with what you might call a modern computer was the Commodore Vic 20. It was a pretty amazing machine at the time. Shortly after that I acquired a Commodore SX-64 briefcase computer system. This thing was the cat's meow. Let me tell you! It had a built-in 5¼" floppy, a game slot, and a 5" color monitor. With 64K, you were rockin' and rollin'. Here's what one looked like:

It has a 300 Baud modem that I used to access Compuserve and some local BBS (electronic bulletin boards). Lotsa' fun! I wasted hours with this thing online or playing text-based adventure games like Infocom's Zork series. Shortly after this time (early 80s), I moved on in life and left the computer in the closet collecting dust. 

One day in '93, I was at my brother's office. He showed me his new system. It was a 486 DX-66 running a new operating system called Windows. Cool! This thing was amazing compared to my old Commodore. Time went on by... Early in 2000, my brother asked my advice about purchasing a new personal computer system. He knew I had friends who were big muckity-mucks locally for the Gateway store. I set my brother up with them. He got a nice new system.

He called me a few days later and asked if I'd like his old system. He knew that I didn't have a computer. At this time, I had just started flirting around with the World Wide Web and USENET using a friend's system or the one at the public library. I told my brother that I would definitely like that old system. I went over to his place and picked it up right away.

It was a Pentium I 90 with a 2Gig hard drive and 64M RAM. It was running Windows 98SE. With that little system, I entered what was to me the modern computer age. This Windows stuff was pretty cool! Oops! What's this blue screen error notice I get once or twice a day?

Hey! This is frustrating!  Heh-heh. Ah... the memories.

Anyway, that's when I became a serious USENET/boards/forums junkie. To me the Internet is about two things: knowledge and community. I've spent the last nine years partaking of both. So, getting to the point of this entire, long-winded posting... is it better to buy or build your own systems?

For me, with my technical experience, it's much better to build I can build a very customized, top-of-the-line machine for about a third of what it would cost me to buy one. That's how the ericsbane series started. I built ericsbane01 with an AMD K7 Thunderbird CPU. I built ericsbane02 with an AMD Athlon 2600+. And I built my current ericsbane03 with an AMD Athlon XP-64 3800+. Yeah, I kinda' like AMD processors.

Building your own system is not for everyone, but it's really not that difficult. Do your research. Price your hardware and peripherals. Put it all together. Install your favorite GNU/Linux distro and you're all set.

Until next time...

V. T. Eric Layton

***Tempus Fugits***

   

Pensamientos sobre el desarrollo de Linux

 Hoy quisiera compartirles algunos pensamientos sobre este fenómenal sistema operativo.

Linux ha logrado tener un lugar en el mundo informático, a veces lo vemos como algo normal dentro del mundo actual, pero su crecimiento no deja de ser fantástico.

Hoy en día grandes empresas están respaldando soluciones basadas en Linux. A nivel internacional y también a nivel regional la penetración de Linux es imparable.

Vivo en la ciudad de Torreón en México. Es una de las principales 20 ciudades del país, y veo con admiración y personal satisfacción la penetración que lleva Linux dentro de las grandes empresas regionales.

Se ha vuelto una herramienta que a las empresas comienzan a ver natural. Día a día es más difícil ver una empresa grande sin que tenga en su arsenal servidores Linux.

EN el plano internacional es todavía mayor el efecto. El compromiso de un gigante como IBM con el software libre era una fantasía hace unos años; y sin embargo, hoy es una realidad. Empresas que deciden empujar sus economías de la mano del software libre.

Estamos viviendo uno de los mejores momentos de la comunidad. Particularmente en el área empresarial.  

SIento que es un efecto natural debido a la comunidad. Gente con gran ingenio técnico y una preparación en sistemas son quienes soportan actualmente este fenómeno. La exigencia es que los sistemas sean robustos y funcionales, y estos valores son bienvenidos en las empresas. 

Conscientemente estoy dejando de lado el ambiente de escritorio, dejándolo intencionalmente para otro artículo.  

 Disfrutemos de este periodo, pues haciéndolo contribuimos a que siga adelante nuestro querido sistema operativo.

 

Japanese popular gathering "Benkyoukai"

日本では今IT業界だけではなく勉強会が盛んだ。

特定の分野に興味がある人が集まって一緒に勉強する。

People get to gether and study common interest thing.

私も今日は勉強会だった。今日のタイトルは仮想マシーン(VMM)

I attended "Benkyoukai" today. Today's focus is VMM, Virtualization.

欧米ではこんな集まりはあるのだろうか。英語ではなんて言えば通じるのだろうか?

Do people in western contories have this kind of gathering. If so, how can I say that kind of gathering?

 

でも日本独自?だとしたら日本人の勤勉さの証明?

 

 

Pensamientos sobre el desarrollo de Linux

 Hoy quisiera compartirles algunos pensamientos sobre este fenómenal sistema operativo.

Linux ha logrado tener un lugar en el mundo informático, a veces lo vemos como algo normal dentro del mundo actual, pero su crecimiento no deja de ser fantástico.

Hoy en día grandes empresas están respaldando soluciones basadas en Linux. A nivel internacional y también a nivel regional la penetración de Linux es imparable.

Vivo en la ciudad de Torreón en México. Es una de las principales 20 ciudades del país, y veo con admiración y personal satisfacción la penetración que lleva Linux dentro de las grandes empresas regionales.

Se ha vuelto una herramienta que a las empresas comienzan a ver natural. Día a día es más difícil ver una empresa grande sin que tenga en su arsenal servidores Linux.

EN el plano internacional es todavía mayor el efecto. El compromiso de un gigante como IBM con el software libre era una fantasía hace unos años; y sin embargo, hoy es una realidad. Empresas que deciden empujar sus economías de la mano del software libre.

Estamos viviendo uno de los mejores momentos de la comunidad. Particularmente en el área empresarial.  

SIento que es un efecto natural debido a la comunidad. Gente con gran ingenio técnico y una preparación en sistemas son quienes soportan actualmente este fenómeno. La exigencia es que los sistemas sean robustos y funcionales, y estos valores son bienvenidos en las empresas. 

Conscientemente estoy dejando de lado el ambiente de escritorio, dejándolo intencionalmente para otro artículo.  

 Disfrutemos de este periodo, pues haciéndolo contribuimos a que siga adelante nuestro querido sistema operativo.

 

Interactive map of Linux kernel

The Linux Kernel is one of the most complex open source projects. There are a lot of books, however it is still a difficult subject to comprehend. The Interactive map of Linux Kernel gives you a top-down view of the Kernel.
You can see most important layers, functionalities, modules, functions and calls. You can zoom in and drag around to see details. Each item on the map is a hypertext link to source code or documentation.
 

Show progress when using "dd"

dd is a generic command-line tool for copying files from 1 location to another. It is often used to copy entire disk images.

Like many Linux command line tools, it operates silently unless something unexpected happens. Its lack of visual progress feedback is a nice feature for scripting. However, it can leave you wondering about its progress if you are interactively dd-copying a large disk.

To illustrate, you run the following (valid, but perhaps not very useful) dd copy:

$ dd if=/dev/random of=/dev/null bs=1K count=100

It will run for a few minutes as it copies (and immediately discards) 100 blocks of randomly generated data, each of size 1 KB.

To get a progress report while dd is running, you need to open another virtual terminal, and then send a special USR1 signal to the dd process.

First, find out the process id of the dd process by running the following in the new virtual terminal.

$ pgrep -l '^dd$'
8789 dd

To send the USR1 signal to the dd prcoess:

$ kill -USR1 8789

Note that as soon as the USR1 signal is detected, dd will print out the current statistics to its STDERR.

$ dd if=/dev/random of=/dev/null bs=1K count=100

0+14 records in
0+14 records out
204 bytes (204 B) copied, 24.92 seconds, 0.0 kB/s

After reporting the status, dd will resume copying. You can repeat the above kill command any time you want to see the interim statistics. Alternatively, you can use the watch command to execute kill at a set interval.

$ watch -n 10 kill -USR1 8789

----------------------------------
Or you can use "pv" command from "pv" package.
pv - is a terminal-based tool for monitoring the progress of data through a pipeline.

Try for example:

pv -ptre FILE | dd of=FILE bs=1M

Gives a nice output with a progressbar, good for writing cf cards from images.

---------------------------------
Or just use dcfldd - (DoD Computer Forensics Lab) dd replacement with hashing.
 

Why you should give the Vim editor a try

I've always been a Vim user, from the moment I had to make a change to a config file on my first Linux distribution (Corel Linux, be advised: stay clear!)

Vim is one of those programs that can amaze you after 10 years of daily use. It's mysteries and powers are only known to the one or two coders that know all of it's source code inside and out. 

Enough, blabber: time for some great gems of Vim ingenuity! 

Keyword completion

While in insert mode (i) press the CTRL+N or CTRL+P to start keyword completion. CTRL+N moves to the next item in the list, CTRL+P to the previous item. Very handy when you have to keep typing some obnoxiously long word such as nantuckednantucked, which yes, I made up.

Shorties

guu    Change entire line to lowercase

gUU   Change entire line to uppercase

xp      Switch the letter under the cursor with the next letter, easy fro fixign typo's

gf       Open the filename under the cursor

*        Search for the word under the cursor

Recording

Recording multiple commands is possible the best Vim feature there is. 

qa   Start recording a macro called 'a', you can use all letters from a - z

After you started recording, simply enter all Vim commands you want your macro to execute. Stop recording by pressing q again.

@a  Execute the commands you recorded in the macro called 'a'

 

 

 
Page 124 of 139

Upcoming Linux Foundation Courses

  1. LFD312 Developing Applications For Linux
    16 Feb » 20 Feb - Atlanta - GA
    Details
  2. LFD331 Developing Linux Device Drivers
    16 Feb » 20 Feb - San Jose - CA
    Details
  3. LFS220 Linux System Administration
    16 Feb » 19 Feb - Virtual
    Details

View All Upcoming Courses


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board