LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices

Just annotations of little "how to's", so I know I can find how to do something I've already done when I need to do it again, in case I don't remember anymore, which is not unlikely. Hopefully they can be useful to others, but I can't guarantee that it will work, or that it won't even make things worse.
Old

"Alpha" of an auto-renaming existing files "mv" script/function/alias

Posted 02-18-2014 at 01:02 PM by the dsc (linux-related notes)

Please don't test this on files you don't care to lose/folders you don't care to mess. I just tested once with an explicit (non-variable/"$2") destination, it seems to have worked. I don't have it as an alias or anything, it was just an "one liner" I came up with.

Code:
for on in "$1" ; do nn=$on ; num=1 ; until [ ! -f "$2/$nn" ] ; do nn="$(echo $nn | sed 's| ([0-9]*)||' | sed "s|\.| ($num).|")" ; num=$((num+1)) ; echo $nn ; done
...
Member
Posted in Uncategorized
Views 205 Comments 0 the dsc is offline
Old

"AccelMethod sna" seems to fix some issues with intel 82G33/G31

Posted 12-13-2013 at 07:26 PM by the dsc (linux-related notes)

On Debian testing/wheezy, I was having some video issues (video players, VLC and mplayer, would cease to work every now and then, and I'd need to restart X to get them to work again) with the new intel driver (2.20-something, I guess; the last one to work with no issues was 2.19, if I recall).

"Xorg -configure" wasn't generating any usable xorg.conf (exiting with error as it came up with a number of displays that "didn't match" something -- I have only one display),...
Member
Posted in Uncategorized
Views 512 Comments 0 the dsc is offline
Old

Dealing with file names (oddly) starting with an hyphen

Posted 11-19-2013 at 02:58 PM by the dsc (linux-related notes)

In a script or routine usage, you may stumble for some reason with a file starting with "-".

"ls *.lol" command in that dir will return error if the next character doesn't happen to be an option of "ls", and/or if it is an option, but the next part isn't coincidentally an "argument", which is probably unlikely.

The same applies for commands such as mv and rm.

but to deal with it you can issue something like
...
Member
Posted in Uncategorized
Views 830 Comments 2 the dsc is offline
Old

Bash script/utility to wait for keyboard and mouse inactivity

Posted 10-18-2013 at 06:42 PM by the dsc (linux-related notes)
Updated 10-22-2013 at 07:52 PM by the dsc

Sometimes you may want to have some script periodically popping up some interface or something, but it may be somewhat abrupt, interrupt something you're doing with the mouse, or keyboard. So I came up with this tiny utility that will wait for the time given as a parameter, then exit.



Code:
#!/bin/bash
a=0
time=$1
if [ -z $time ] ; then time="1.2s" ; fi

while true ; do

mouse1=$( xdotool getmouselocation --shell
...
Member
Posted in Uncategorized
Views 528 Comments 0 the dsc is offline
Old

mimeopen: a nice tool to setup default applications

Posted 10-05-2013 at 12:06 AM by the dsc (linux-related notes)

File association and default applications can be quite complicated, and hard to remember, specially if you have a hybrid environment, using stuff from Gnome, KDE, and whatever, while not being in none of the big ones, but on openbox or something.

One common source of problems are associations within web browsers, like firefox or chrome. They'll often have their own or use some secondary/wrong file association. I was having this problem with Google Chrome, "show in folder"...
Member
Posted in Uncategorized
Views 429 Comments 0 the dsc is offline

  



All times are GMT -5. The time now is 02:45 PM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration