LETTERS Write Access

WRITE

a

l

e

x

w

h

i

t

e

,

1

2

3 ACCESS F

New Look I don’t mind too much that you rear- take a look at the Info box text and look ning under Windows XP Home. The ranged things so I now have to search for ways to improve readability. We system was taking several minutes to for the familiar. I suppose in time I will agree that legibility is of paramount boot, and it was really slow overall, de- get used to it. However, what I will not importance. spite my best tuning efforts. So I bit be able to ever like is the printing of the bullet and installed Ubuntu 10.04 text in a light color, so much so that it SetUID (having swapped out the hard drive to is difficult to read. The most glaring ex- The article titled “File Sentinel” in the keep her Windows environment intact amples are in the INFO sections at the June 2010 issue improperly describes – just in case she could not get on with end of each article with the web refer- Set UID as giving the executable the Linux). ences. When the color of the type is rights of the user executing the bin. Problems? A few. I failed to get the in- light, it is difficult to differentiate a pe- This is incorrect; suid gives the bin the ternal WiFi card working – despite ex- riod, a semicolon, a colon, a dash, etc. I rights of its owner. Similar error with tensive searches of the Internet, includ- read for information, and I would like guid. ing downloading and compiling driv- to get that information as fast as possi- PS: While I normally don’t read Linux ers. But a Belkin WiFi dongle solved ble. It is very discouraging to mistype a Pro too much, I was really impressed the problem. It worked first time – with reference over and over because it is with the articles on Shinken and Secu- no configuration apart from the WPA impossible to read. There must be a rity Blanket. Uncovering new and use- key. Other problems: A very glitchy better way. ful programs is a great service for screen in bootup (it is a non-standard Rodney Leinberger Linux geeks. screen size), but the problem is com- Thanks! pletely resolved when Ubuntu loads. LM: We apologize for the inconve- Luke L. And the ACPI system is non-compliant, nience. A new design includes lots of so shutdown is manual. details, and it is often difficult to spot LM: Oops, looks like that one slipped My wife has taken to Ubuntu Linux like all the possible complications. We will through. Thanks for the feedback. We a duck to water. The system boots very are happy to print this correction. efficiently, and she has had very few FEATURES We are glad you liked the Shinken problems with using Linux programs Perl: Readline and History

Readline li- Perl wrapper for the GNU brary from CPAN as in: and Security Blanket articles. Our instead of the old Windows stuff.

hen launched, Perl’s Gnu What’s going on? W ether the FEATURES s stored in the , debugger checks to see wh Perl: Readline and History Figure 2: Command line file input for later i sessions. module really is available and,ricted if not ter- ~/.mysql_history provides a functional butthout rest a history So, I think Joe Casad is right: Microsoft nstall mission is to help our readers dis- minal environment wi Term::ReadLine, you need to i :Gnu from CPAN. ob- function. al attention, cur- Term::ReadLine: Without some manu e uses Listing 1 creates a Term::ReadLine method, sor navigation with Gnu Readlin readline() type a ch might sound ject and calls its commands, whi t that which in turn prompts the user to ns usable charac- strange for fans of .there Rumor who has actually i has spread a lot of FUD about a prod- ted cover interesting and useful appli- command. If it contai add_his- there are people out er and be A free history function in Perl scripts ters, it makes sense to call broke their fingers typingts. complica The follow- Raman Maisei, 123RF to add it to the line buffth the use tory() Emacs keyboard shortcu able to dig it out again later wi way ing option ession with the of . Figure 1: A command-line s The sample listing takesything the easyapart mysql MySQL client. put, but cations that run on Linux. Thanks uct that is more than fit for the purpose out here and accepts an er you below your home direc- from all-blank lines as usefulme in sort of in ~/.inputrc ate by auto- takes you back to the last chaptes to the of course, I could imaginetion so instead. tory will save you from this f i mode. Type viewed, and the Tab key mov nal pro- sophisticated input valida matically shifting Readline intodline V is in can still ac- e next linked bullet on a page. For more information on termie man pages If you don’t notice that Rea For the last session, you the N mod- gramming in Perl, refer to th the wrong editor mode until you cheshav cess the history after restartingwork? As menta- for tuning in. and is actually as easy – if not easier – of the two aforementioned CPA echa- started typing, Meta+Ctrl+J switlike an MySQL client. How does this Perl ules, or some fairly spartan docu modes. This looks very much ode un- Figure 2 shows, the GNU historyps m the in- tion scattered throughout several Emacs-only command, but Vi sm to Emacs nism used in this example dum ~/.mysql_history books [2]. derstands it, too, and switche ’t have a formation into the quit, doesn’t mode. If your keyboard doesnc key and Less file. The final command, e MySQL Garbled Characters in Meta key, simply tap the Es appear in the history file becausds and notices o has a ve the to install and use as Windows. the Debugger then press Ctrl+J. only saves useful comman while to save. The internal Perl debugger als users add_ Instead of pressing Ctrl+Bados to mowould that there is nothing worth ll to me old history mechanism that avoids to the left, Vi aficion mand The program exits before the ca having to continually type the sa ations, occurs. then press Esc to switchH until to com the cursor history() up I story mechanism with an editing func- commands. But on certain install mode and then press ssing need to do is include the GNU if you press the arrow keys to pullis gar- Spoiled for Perl mmers a reached the desired position. Pre Christopher J. Steggles previous commands, all you get takes you back to insert mode. Perl offers spoiled script progra librar- What XP If you are interested in adding a neat and practical hi bled characters, such as: mod- the se- convenient interface to the GNU Writing History mmands, tion to an interactive Perl tool youBy Michael have Schilli programmed, all you ies. The Perl Term::ReadLine::Gnuicates with the braries to read user input and addaccess at In a history of dozens of coare looking for w key to go ols, ule from CPAN commun librariesbraries and ain Readline and History libraries. lected commands to a pool for users will find what they are d correct layer of the installed GNU rli an object-ori- re signign that can simply press the Left arroarrowe and correct some later time. As with all GNUol withto modulele more quickly if they search for cert and history itt it. offers the Perl programme This kind of output is a susure sstall the Your excellent editorial in Issue readline t back to the start of the linelin an invoking the documentation to shows by de- he GNU or info history ented layer. The Term::ReadLine modu the command before you submsubmie MySQL in a genu- the victim has forgotten to installin utilities are real IT dinosaurs, buly info readline restrictedricted As a quick inspection of th e is included with Perl distributions FEATURES sm the man pages for the utilities feww browsing onalFEATURES readline-complete still extremely useful and widelywide mecha- fault, although it only offers rest source code reveals, the databasdatabase info to LISTING 3: used. They provide a mechanimechanism ine 1970s look. Quickly,N key tells a fe functionality. For a fully functi FSlint r input to e C read- as P FSlint T doesn’t implement this practicals the C tips: Pressing the for editing and repeating use and it nism itself; instead, it usesuse th functions jump to the next chapter, where wrapper-test any command-line program,rt on the pro- and add_history() ry li- LISTING 2: 117 entitled “Saving XP” may LM: Thank you for your comments. If line() Clean up your fi lesystem with FSlintdoesn’t involve much effoeffort onFedora, Red Hat,from the GNU Readline and Histo cates, temporary files no longer needed, grammer’s part. openSUSE, and or empty directories. FSlint finds dupli- readline-test Mandriva, are LISTING 1: cates, or multiple instances of files, that Long-Winded SQLgthyavailable SQL from the often occur in large collections of music. For example, if you type a lenFSlint homepage To define a search path, click the Add mysql MySQL client (Figure query in the eciateciate[1]. theIf you use a button and select a directory to match. have underestimated how far everyone who succeeds with installing 1), you will definitely appreappr legacyy to versionre- of You can specify multiple directories in a ability to press the Up arrowFedora, kept. This Red Hat, or single step; FSlint works its way through peat the input at the next promCentOS, com- you can them one after another. 4 9 t it after- way, you can either repeat thedownloadit it after- the packages Checking the Recurse? box enables nss don’t ISSUE 116 JULY 2010 mand, or modify it and resubmiresubmfrom Dag Wieërs’ reposi- searching in subdirectories. Now press ward. Incidentally, these functiofunctiontory\e command, [2]. OpenSUSE also has the Duplicates button on the left, and Linux has come. As a Linux Linux over Windows tells the story, the to make AGAZINE.COM rely on the MySQL client’s prebuilt packages up for grabs then select Find below the main panel ter a which opens a full-blown editoron the web [3] for both manual on the left to tell FSlint to start searching LINUX-MAGAZINE.COM | LINUXPROM over modifications. Instead, if youand enone-click installation. for duplicate files or multiple instances u Over time, a filesystem starts to look cluttered.long FSlint command helps line and thenOn disc Gnome, the installation routine of files. MAGAZINE.COM one of the words containscreates a typo, a yolauncher in the Applications | Depending on the paths you define LINUX-MAGAZINE.COM | LINUXPRO you keep your system looking good. System tools menu. FSlint comes up with and how much data you have, the search user for the past two years, result can only be a bigger user base By Erik Bärwaldt a tidy GUI that is easy to use, even if you can take some time to complete. Because JULY 2010 ISSUE 116 f 48you use your com- have never seen a filesystem cleaning you will typically run the search as a puter intensively, file- tool before, eliminating the need for normal user rather than root, the list of system inconsistencies comprehensive documentation. directories the software was unable to Icreep in over time. A In the program window on the left are process for lack of permission will tend Figure 2: You can’t just delete every empty directory. tool called FSlint quickly and large icons that branch off to individual to build up in the bottom panel (see Fig- with almost as many years in IT as for Linux. reliably discovers problems functions; you can define various search ure 1). Another special case that becomes button on the left. Renaming the files such as bad symbolic links, du- paths in the main panel. The central part At the end of the search, click the Se- more aggravated the more you use a discovered by this search will give you plicate filenames, empty directo- shows to which files or directories a se- lect button in the central panel, and then computer is the problem of broken sym- standards-compliant names. ries, and unused directory blocks. As lected function applies. In the bottom use the arrow keys to navigate to the bolic links for individual files. FSlint To avoid filling the list with a huge a nice side effect, FSlint also gets rid of right is an overview of the directories the files you want to delete. Clicking the De- tracks them down and removes them re- number of insignificant infringements, ballast and frees up disk space. application has not checked because it lete button then removes the selected liably. Although this will not free up use the slider in the main window to ad- John “maddog” Hall, I did not need Work on FSlint has made continuous lacks the necessary permissions. files; as an alternative, you can merge much space, it is always a good idea to just the search intensity. A setting that progress, and the program is included the files or store them at a different loca- remove broken links to keep your filesys- only alerts on major infringements with many Linux distributions. Packages Clean-up Work tion. tem clean. against file naming conventions will typ- for the current versions of Ubuntu and The tool’s main focus is to discover and ically be fine. other Debian-based systems, as well as remove superfluous files, such as dupli- A Word of Caution! Character Set Chaos If the duplicates you find happen to be Especially if you work in a heteroge- Conclusions any convincing. But the confirmation system files you didn’t install yourself, neous environment in which you run FSlint is a powerful tool for cleaning up Please send your comments use caution before you decide to delete. Linux and other operating systems, an your filesystem and freeing up wasted And you should be generally cautious exchange of data between these systems storage space quickly and easily. The in- when deleting temporary files or empty can lead to incompatibilities that are tuitive interface and the avoidance of directories. In most cases, it is a good often due to non-standards-compliant functional overkill in the menus mean idea to delete less rather than more. character sets. that any newcomer will feel at home of the practicality of Linux came when Some applications need certain directo- Linux itself uses either UTF-8 or an- with the software right from the start. and suggestions to ries and check whether these files exist other, typically country-specific, charac- FSlint can’t protect incautious users when they launch. If the directories are ter set that complies with an interna- against causing serious damage. Because missing, the application might refuse to tional ISO standard. Other operating sys- FSlint is unable to tell whether or not the run. tems might use non-standardized char- files and directories it finds are system Deleting system files could even pre- acter sets that cause issues. In the worst critical, unconsidered deletion can lead my wife kept complaining about her vent your computer from booting in the case, Linux might not be able to open to an unusable system. A cautious ap- worst case, or you might experience un- files whose names contain incompatible proach is recommended; after all, more [email protected] expected hardware problems. You characters. In some cases the system will is not always better. should only manually delete files and di- highlight non-standards-compliant file- rectories if you are quite certain the files names for you to change them. I N F O you are removing are duplicates. Be- If you download multimedia files fre- rather slow Packard Bell notebook run- cause of the large number of potential quently off the Internet or from other [1] FSlint: http://www. pixelbeat. org/ fslint/ alternative configurations and the result- computers, you will want to run FSlint [2] FSlint packages: http:// dag. wieers. ing dependencies, FSlint can’t provide a against the directories in which you com/ rpm/ packages/ fslint/ Dmitry Dmitry Remesov, 123rf generically reliable aid for identifying store these files to identify problematic [3] openSUSE packages: http://software. Figure 1: FSlint puts an end to duplicate files. system-critical files (Figure 2). filenames. To do so, click the Bad names opensuse. org/ search/ ? q=fslint

42 JULY 2010 ISSUE 116 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 116 JULY 2010 43

16 SEPTEMBER 2010 ISSUE 118 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM