Tux

...making Linux just a little more fun!

2-cent tips: KeyTouch, .sig generators, Corrupted ISOs, etc.

Jonathan Clark [clarjon1 at gmail.com]


Wed, 2 Apr 2008 21:58:01 -0400

Hello, all. On my laptop, I've got those lovely little function keys which, by default, do absolutely NOTHING in Linux. However, all that can change!

I've found with my current distro, PCLinuxOS, a handy little utility called KeyTouch. This program allows you to map your keys to what they are supposed to do. You can easily map your keys like this, and, from what I understand, this doesn't work just with laptops, but also with multimedia keyboard, microsoft keyboards, and so forth. Very useful.

Now, on my laptop, I've got one of those buttons which, I suspect, is supposed to change the power usage profile in Windows. However, I've found a more useful job for it to do. In keytouch-editor, I have it set so that when that key combo is pressed, it will run:

kdialog --passivepopup "`acpi`"
which pops up a little 'speech bubble' to show me the current battery status, as well as time remaining for discharge or recharging the battery. Very useful, in my opinion.

What else do I have? Oh, yes. In Compiz-Fusion, there seems to be a bug with the alt-tab application switcher, which will occasionally kill off the Emerald window manager. I thought it was a bug with the keyboard shortcut, until I remapped it to win-tab and it would still kill it. So, if this is annoying you, disable the "Application Switcher" module, enable something like "Ring Switcher", and map it to Alt-Tab. Just like that, the decoration issue is solved.

Ever wondered how people get those static-yet-dynamic sig-generators? It's easy to do, with a simple bash script. First, create a file, let's call it sig. Put in the information that you are wanting to stay static. Make sure that there is an empty line at the end of the file. Now, you probably want to use something like fortune to get the changing part of the sig, right? Here's a shell script I use, called sig.sh:

---8<---
#!/bin/bash
cat ~/sig
/usr/games/fortune
--->8---
Set this little script to be executable, then go to the mail client of your choice, tell it to get the sig from a program, and tell it to use your sig.sh.

And, finally, corrupted ISO downloads. A friend taught me how to fix these: If your ISO is corrupted, it seems like all you have to do to fix it is to create/get a torrent of it, stick the corrupted download in the directory where the ISO will be downloaded to by default, and let the torrent system correct it for you!

Hope that these may help some users, will be giving more when I can think of some more!

-- 
Clarjon1
Proud Linux User.
PCLinuxOS on Dell Inspiron 1501,1 Gig ram,80 Gig Hard drive
1.7gHz AMD Athlon 64bit dualcore processor
Contact:
Gmail/gtalk:  clarjon1
irc: #pclinuxos,#pclinuxos-support,##linux on freenode
Baruch's Observation:


Top    Back


Thomas Adam [thomas.adam22 at gmail.com]


Thu, 3 Apr 2008 07:32:38 +0100

On 03/04/2008, Jonathan Clark <clarjon1@gmail.com> wrote:

>  I've found with my current distro, PCLinuxOS, a handy little utility called
>  KeyTouch.  This program allows you to map your keys to what they are supposed
>  to do.  You can easily map your keys like this, and, from what I understand,
>  this doesn't work just with laptops, but also with multimedia keyboard,
>  microsoft keyboards, and so forth.  Very useful.

Or use lineakd.

> Here's a shell script I use, called sig.sh:
>  ---8<---
>  #!/bin/bash
>  cat ~/sig
>  /usr/games/fortune

Why not (at a fundamental level):

echo "Random stuff" > ~/.sig
echo -e "More stuff\n\n" >> ~/.sig
fortune >> ~/.sig

Note though that blindly using fortune without vetting or command-line options is misguided. Thankfully you won't get any nasties with this, but at the very least consider using:

fortune -n ...

To limit potentially long fortune cookies, and breaking the >5 line rule of ~/.signature files.

It's a nice tip, but to be honest this particular one has been done to death countless times over; there's much better randomising sig generators out there than this one.

>  And, finally, corrupted ISO downloads. A friend taught me how to fix these:
>  If your ISO is corrupted, it seems like all you have to do to fix it is to
>  create/get a torrent of it, stick the corrupted download in the directory
>  where the ISO will be downloaded to by default, and let the torrent system
>  correct it for you!

I can't see this working at all. Were you told this on April 1st? ;)

-- Thomas Adam


Top    Back


Ben Okopnik [ben at linuxgazette.net]


Thu, 3 Apr 2008 10:07:45 -0400

On Thu, Apr 03, 2008 at 07:32:38AM +0100, Thomas Adam wrote:

> On 03/04/2008, Jonathan Clark <clarjon1@gmail.com> wrote:
>
> > Here's a shell script I use, called sig.sh:
> >  ---8<---
> >  #!/bin/bash
> >  cat ~/sig
> >  /usr/games/fortune
> 
> Why not (at a fundamental level):
> 
> ``
> echo "Random stuff" > ~/.sig
> echo -e "More stuff\n\n" >> ~/.sig
> fortune >> ~/.sig
> ''

Jon's script produces output on STDOUT rather than a .sig file. Although I agree with the principle of what you're talking about, emulating its action would be more like this:

/bin/cat <<!
Random stuff
More random stuff
 
!
/usr/games/fortune
> Note though that blindly using fortune without vetting or command-line
> options is misguided.

Yes, that could be a mistake,

Dear $Company: I'm looking for a job, and I'm a very dignified, serious
individual. Thanks for your consideration.
 
-- 
Joe Smith, Funeral Director
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
"Give me your tired, your poor, your huddled masses."
And while you're at it, throw in a couple of those Dallas
Cowboy cheerleaders.
> >  And, finally, corrupted ISO downloads. A friend taught me how to fix these:
> >  If your ISO is corrupted, it seems like all you have to do to fix it is to
> >  create/get a torrent of it, stick the corrupted download in the directory
> >  where the ISO will be downloaded to by default, and let the torrent system
> >  correct it for you!
> 
> I can't see this working at all.  Were you told this on April 1st?  ;)

Actually, it seems reasonable - sort of like breaking up a large file into chunks, then rsyncing it against the "correct" set of chunks elsewhere. I'm not particularly hip to Torrent, but I think that's how it works overall - in which case, that's a very nifty solution.

-- 
* Ben Okopnik * Editor-in-Chief, Linux Gazette * http://LinuxGazette.NET *


Top    Back


Jimmy O'Regan [joregan at gmail.com]


Thu, 3 Apr 2008 15:57:34 +0100

On 03/04/2008, Ben Okopnik <ben@linuxgazette.net> wrote:

> On Thu, Apr 03, 2008 at 07:32:38AM +0100, Thomas Adam wrote:
>  > On 03/04/2008, Jonathan Clark <clarjon1@gmail.com> wrote:
>  > >  And, finally, corrupted ISO downloads. A friend taught me how to fix these:
>  > >  If your ISO is corrupted, it seems like all you have to do to fix it is to
>  > >  create/get a torrent of it, stick the corrupted download in the directory
>  > >  where the ISO will be downloaded to by default, and let the torrent system
>  > >  correct it for you!
>  >
>  > I can't see this working at all.  Were you told this on April 1st?  ;)
>
>
> Actually, it seems reasonable - sort of like breaking up a large file
>  into chunks, then rsyncing it against the "correct" set of chunks
>  elsewhere. I'm not particularly hip to Torrent, but I think that's how
>  it works overall - in which case, that's a very nifty solution.
>

Kind of - if you can /get/ a torrent of that ISO[1]. For example, http://www.thoughtpolice.co.uk/ have VMWare images of various distributions available both via HTTP and BitTorrent. Because these are exactly the same images, that method works - but it could also depend on the torrent client too (you never know what sort of silly things made sense at 5am some morning :)

[1] Well, ok, you could create your own torrent, but as you would have to take all of the information from an existing torrent, it seems a little pointless.


Top    Back


Jonathan Clark [clarjon1 at gmail.com]


Fri, 4 Apr 2008 08:54:58 -0400

On Thursday 03 April 2008 02:32:38 am Thomas Adam wrote:

> On 03/04/2008, Jonathan Clark <clarjon1@gmail.com> wrote:
> >  I've found with my current distro, PCLinuxOS, a handy little utility
> > called KeyTouch.  This program allows you to map your keys to what they
> > are supposed to do.  You can easily map your keys like this, and, from
> > what I understand, this doesn't work just with laptops, but also with
> > multimedia keyboard, microsoft keyboards, and so forth.  Very useful.
>
> Or use lineakd.

Never heard of it. How easy is it to use for someone who is usually too lazy to read the docs first?

>
> > Here's a shell script I use, called sig.sh:
> >  ---8<---
> >  #!/bin/bash
> >  cat ~/sig
> >  /usr/games/fortune
>
> Why not (at a fundamental level):
>
> ``
> echo "Random stuff" > ~/.sig
> echo -e "More stuff\n\n" >> ~/.sig
> fortune >> ~/.sig
> ''

Because I like having a different fortune for each message I send, and I've found that KMail, Thunderbird, Pan, and others all can use the same method, making life easier for me. As I'm sure you know, if you use the 'run a program' option for the sig creation in these programs, it'll run the specified program/script, then take what it gives on STDOUT, and there's your signature.

>
> Note though that blindly using fortune without vetting or command-line
> options is misguided.  Thankfully you won't get any nasties with this,
> but at the very least consider using:
>
> ``
> fortune -n ...
> ''

Yes, I had forgotten about those options. And, in Kmail at least, if I don't like the sig I get, I can just select sig, delete sig, and then go Edit -> Append Signature.

>
> To limit potentially long fortune cookies, and breaking the >5 line
> rule of ~/.signature files.
>
> It's a nice tip, but to be honest this particular one has been done to
> death countless times over; there's much better randomising sig
> generators out there than this one.
>

Oh, I agree there, but not everyone knows about them, and mine does make it very easy to change the static portion of the sig without messing up anything else, I've found.

> >  And, finally, corrupted ISO downloads. A friend taught me how to fix
> > these: If your ISO is corrupted, it seems like all you have to do to fix
> > it is to create/get a torrent of it, stick the corrupted download in the
> > directory where the ISO will be downloaded to by default, and let the
> > torrent system correct it for you!
>
> I can't see this working at all.  Were you told this on April 1st?  ;)

I was, now that I go through my chat logs, but the person who asked me about whether or not I had the file handy for a torrent, and introduced me to this, had previously posted for help for the image he was requesting, a few days before.

-- 
Clarjon1
Proud Linux User.
PCLinuxOS on Dell Inspiron 1501,1 Gig ram,80 Gig Hard drive
1.7gHz AMD Athlon 64bit dualcore processor
Contact:
Gmail/gtalk:  clarjon1
irc: #pclinuxos,#pclinuxos-support,##linux on freenode
You have Egyptian flu: you're going to be a mummy.


Top    Back