Mailbag
This month's answers created by:
[ Amit Kumar Saha, Ben Okopnik, Kapil Hari Paranjape, Karl-Heinz Herrmann, René Pfeiffer, Neil Youngman, Ramon van Alteren, Rick Moen, Samuel Kotel Bisbee-vonKaufmann, Suramya Tomar, Steve Brown, Thomas Adam ]...and you, our readers!
Still Searching
How to assign static device node with devfs ?
JOYDEEP [j.bakshi at unlimitedmail.org]
Fri, 04 May 2007 13:25:46 +0530
Dear list,
I am using debian with devfs. I have a usb based removable microsd drive. I have no problem to access the drive through usb but the problem is with non-static device node. Like I have checked through log that the devfs has assigned node /dev/sda1 for that device.
so I have added in my /etc/fstab
/dev/sda1 /media/microsd vfat rw,user,auto 0 0and I have no problem to work with it. but next time when I again plug in the device it has a device node called /dev/sdb1 and then I have to modify the corresponding entry in fstab. So is there any way to assign static device node in devfs.
thanks
Our Mailbag
Doing Everything at the Console
Cleverson [clever92000 at yahoo.com.br]
Sun, 20 May 2007 11:35:39 -0300
Hello Gang
I'd like to know if there's some kind of "reference guide" for Linux console-based applications, or perhaps a web site / community of people who enjoy doing everything via command line and ncurses-based apps, without setting up graphical desktop environments.
I've already encountered several apps, e.g., for working with e-mails (Mutt), browsing the web (Elinks), playing music (Moc), chatting over MSN (Pebrot), and so on, but I'd like to try more options on each of those activities, and do other things such as recording and playing CDs and DVDs, sharing files over p2p, resizing partitions, reading PDFs and word documents or converting them to text, chatting over VoIP, reading RRS feeds, editing audio, etc etc.
Thank you very much and congratulations for your work on Linux Gazette, my favourite magazine.
Cleverson
[ Thread continues here (15 messages/19.56kB) ]
FTP Client suppporting SSL/TLS
Amit Kumar Saha [amitsaha.in at gmail.com]
Thu, 3 May 2007 18:34:19 +0530
Hi all,
Please suggest me some Graphical FTP client which supports SSL / TLS (preferably for the GNOME desktop).
Thanks
-- Amit Kumar Saha GSM :+91 9903140286
[ Thread continues here (9 messages/5.67kB) ]
Time Solaris sync to Windows time server
Icksan nurdian [inurdian at yahoo.com]
Mon, 21 May 2007 01:29:59 -0700 (PDT)
HI, I've already tried to sync.time solaris client to the Windows Time server, but it's always failed. but when I sync. with another solaris timer server it's succeed. What should I do..?
Thanks
[ Thread continues here (5 messages/6.68kB) ]
Installing user written Daemons
Cook, William [William.Cook at Vishay.com]
Wed, 02 May 2007 20:11:02 -0700
I am fairly new to linux. I've written windows services (a pain), I have just written my first Linux Daemon on Red Hat 9.0. Where can I find info on the proper lay to install my Daemon?
Thanks in advance, WHC
[ Thread continues here (4 messages/3.14kB) ]
Dumping MIDI as a series of events
Jimmy ORegan [joregan at gmail.com]
Sat, 26 May 2007 16:21:35 +0100
I was looking at some tablature programs today, and found that there's an extension to MIDI called "Rich MIDI Tablature Format" to represent some guitar specific things. A few Windows programs support it, but none of the open source programs do.
I was wondering how to even go about finding out the differences between this format and regular MIDI (without having to find out too much about MIDI), when Perl (or, more specifically, Perl's MIDI module) came to the rescue: it has an option to dump everything as a series of events.
Take this short piece of Lilypond:
\header { title = "Flowers" dedication = "Ona wie" subtitle = "1 January 2005" } \new TabStaff { \repeat volta 2 { d'4\4 b'8\3 d'\4 a'4.\3 e'8\4 e'\4 fis'\4 g'\4 e'\4 fis'\4 g'\4 a'4\3 d'4\4 b'8\3 d'\4 a'4.\3 e'8\4 a'\3 g'\4 fis'\4 e'\4 d'2\4 } \repeat volta 2 { a4\5 e'8\4 fis'\4 g'4.\4 e'8\4 e'\4 fis'\4 g'\4 e'\4 fis'\4 g'\4 a'4\3 a4\5 e'8\4 fis'\4 g'4.\4 e'8\4 g'\4 fis'\4 e'\4 b'\3 a'2\3 } \repeat volta 2 { a8\4 d\4 fis\4 g\4 e\5 a,\5 cis\5 d\5 d\5 cis\5 b,\6 a,\6 a,\6 cis\5 e\5 g\4 a8\4 d\4 fis\4 g\4 e\5 a,\5 cis\5 d\5 d\5 cis\5 b,\6 a,\6 a,2\6 } }I recreated the first 4 bars in one of the Windows tablature programs, and with this command:
$ perl -MMIDI -e 'my $o=MIDI::Opus->new({"from_file"=>$ARGV[0]});$o->dump({"dump_tracks"=>1});' flowers-rtmf.midI got this output:
[ ... ]
[ Thread continues here (1 message/6.68kB) ]
C programming - when to use pointers
David Chanters [david.chanters at googlemail.com]
Sat, 26 May 2007 14:32:34 +0100
Hey all,
I'm fairly new to C programming but am familiar with most programming principles from Java and Perl. I understand what pointers are in C, but I have lots of problems knowing when best to use them, since many, if not all tasks, can be obtained just from passing parameters into function directly.
Are there any good tips for knowing when or when not to use pointers?
David.
[ Thread continues here (4 messages/4.78kB) ]
specifying trusted devices other than eth0
qqq1one @yahoo.com [qqq1one at yahoo.com]
Tue, 1 May 2007 23:24:37 -0700 (PDT)
Hi Everyone,
Does anyone remember how Fedora Core 4 let the user specify trusted devices (e.g. eth0, sit0, nlv0) through the system-config-securitylevel tool? That feature seems to have gone away with Core 5. I always liked that feature because it let me open up just the nlv0 device for VPN. With that feature gone, I have to open up a lot more it seems.
Does anyone know of a workaround? Or did the feature just get moved somewhere else? Thanks in advance. Oh, and I did find the ASCI version of the tool, system-config-securitylevel-tui - it knows that eth0 can be set as a trusted device, but that's it. Even when nlv0 is up (as confirmed by ifconfig), system-config-securitylevel-tui only lists eth0 as a device that can be set as trusted.
-- Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around https://mail.yahoo.com
[ Thread continues here (2 messages/2.58kB) ]
about linux
neeraj kumar [neeraj.shankar at gmail.com]
Wed, 25 Apr 2007 04:39:55 +0530
Respected sir,
i am completely new user in linux and now i am not able to install linux interprises 4 in my usb 40 gb harddisk, so pls give me some tips about it i will always oblique to you thanks
[ Thread continues here (5 messages/4.08kB) ]
Switching VT Remotely?
Dave Lindquist [dlindquist at castoracer.com]
Fri, 04 May 2007 15:34:39 -0600
Is there a way to switch the VT of a linux box remotely?
Specifically, I have X running on my desktop, and have trained my wife to click the KDE "switch user" to log in herself (and get her email), which allocates another VT for her.
This works really well -- I can leave myself logged in on VT7, and she can use VT8. Unfortunately, she doesn't know how to switch it back to VT7 when she's done (Ctrl-Alt-F7).
I have a VNC server installed as an X module, that allows me to remotely VNC to my X session (on VT7), but due to X quirks, I can only VNC to it if VT7 is "selected" -- ie, if she's left the machine sitting on VT8, I can't VNC in.
So, I would like to know if there is a way for me to switch which VT is "selected" remotely (ie, SSH in, su to root, and do something to switch VTs).
Thanks in advance! ;-)
[ Thread continues here (5 messages/4.82kB) ]
Followup: lpr works for user not root in Basiclinux 2.1
Rick Moen [rick at linuxmafia.com]
Fri, 25 May 2007 11:27:36 -0700
Forwarding at author's request.
----- Forwarded message from sindi keesan <keesan@sdf.lonestar.org> -----
Date: Fri, 25 May 2007 16:13:30 +0000 (UTC) From: sindi keesan <keesan@sdf.lonestar.org> To: Rick Moen <rick@linuxmafia.com> Subject: Re: [TAG] (forw) Re: (forw) Re: lpr works for user not root inBasiclinux 2.1
I deleted most of this thread from my mailbox. Please could you get this email to the right place in the thread?
I just noticed you have posted our long discussion of lpr and user in the April edition. There is one piece missing. Karolis found the solution to the eznet problem. Eznet (which our little linux uses as a front end for pppd) changes file permissions while it is being used, which is why the devices needed to dial kept reverting to not being user-accessible. So in order to dial as user, one would need to use pppd directly without eznet.
I am trying to keep things simple, and eznet is very simple to set up. I am totally incapable of rewriting eznet to behave properly.
Would it make a big difference in security if the user dialed as root, then logged in and did everything else online as user?
I can now print as root (and hopefully as user) with gs 8.54, which I compiled with default device deskjet, at default resolution 300 dpi, on default letter size paper:
gs -sOutputFile=/dev/lp0 filename.pdfI put together a package with a bit of documentation. Init files are compiled into the executable, and it works without added fonts. I included only the older deskjet and laserjet printers and devices needed to view with an svgalib viewer and to convert ps < > pdf. 2.7MB standalone executable.
https://keesan.freeshell.org/bl/gs-8.54-HP-noX.tgz (glibc 2.2.5) Compiled without x11 (use svgalib 1.9.25 and svp to view, also posted at my site as packages).
Since it does not require x11, it should work with libc5 BL3.50 (whose X is not compatible with glibc X) as well as later linuxes.
There is now a basiclinux BL3.50 with a nicer wm that does not require a mouse, and a more complete menu that makes life easier for beginners. It still uses eznet.
https://distro.ibiblio.org/pub/linux/distributions/baslinux
Added to the 5MB of BL3.50, along with a few extra libraries, Opera 8, and Abiword (each about 12MB), this gs should make for a nice 50MB linux that browses, does word processing and prints, works with some cameras, and might run off a flash drive if you first boot from a 1-floppy USB-capable linux and chroot to the flash drive. (I did something similar with camera-linux, 8MB of files needed to download photos from my camera and display them on any computer with a floppy drive and USB 1.0 port, in a loop file in a DOS directory on the camera memory card).
Thanks for the education.
keesan@sdf.lonestar.org SDF Public Access UNIX System - https://sdf.lonestar.org
----- End forwarded message -----
perl fork: How to keep restarting a child till timeout?
Karl-Heinz Herrmann [kh1 at khherrmann.de]
Sat, 5 May 2007 22:43:01 +0200
Hi tag,
I'm trying to write a perl progam to automatically record internet radio. The current setup uses at to start a recording process which checks the radios webpage, filters the proper straming adress and wget it for wget'able streams -- otherwise mplayer is used to dump the stream.
My increasing problem is, that the recording process exits prematurely. What I currently do in perl is a main routine which does all the webfetching and then forks out two processes:
* the recorder * the killer -- waiting and then killing the recorder after preprogrammed time
main program exits. This protects mplayer from any input on stdin as this immediately kills mplayer (a problem if perl program is started by atd as I had to find out).
Now I tried to setup a signal handler for SIGCHLD in the main part and then let the main go to sleep instead of exiting. On receiving a SIGCHLD it checks if this was because of the killer (time up, killer exited) or if the time is not yet up and the recorder exited too early. In the latter case I restart the recorder, kill and restart the killer for the new recorder-pid and then I want back in main, set the sighandler and go to sleep as before.... but I seem unable to get out of the sighandler. So this restarted recording exactly once -- but not again.
Is something like the above possible? Or do I have to switch to a loop in main checking regularly on the status and react actively without the use of sighandler to get any number of restarts?
I'm not too worried of too fast forking as wget/mplayer takes a while till they decide to fail -- but just in case a small delay and restart counter (or count/time) could be calculated and watched in case network is down and wget/mplayer are exiting to quick.
Since I would very much like to learn how the sighandlers are supposed to work and how to use them I would find the first strategy more interesting.....
As reading material I've the perl CD bookshelf including Programming perl and the cookbook (Advanced Perl Programming doesn't have much on forking and signal handlers). Both are not too deep into what's to do once the sighandler was activated and I don't just want to terminate after some cleaning up.
K.-H.
[ Thread continues here (8 messages/29.08kB) ]