LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Blogs > linux-related notes
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.
Uncategorized Entries with no category
Old

Single, "teleporting" instance of system monitor (or something else)

Posted 03-30-2011 at 01:20 AM by the dsc (linux-related notes)
Updated 03-30-2011 at 01:26 AM by the dsc (minor correction)

Code:
[ -z $(ps -A | grep ksysguard) ] && ksysguard & disown &&
wmctrl -iR $(wmctrl -l | grep "System Monitor" | sed 's/\ .*//')
Depend on wmctrl.

Are you tired of winding up with multiple instances of a program of which you don't really need multiple instances? Your problems are over! Now you can just press the hot-keys or whatever shortcuts you have, without ever worrying about earlier instances. No more sore joints for having to close...
Member
Posted in Uncategorized
Views 460 Comments 0 the dsc is offline
Old
Rating: 3 votes, 4.33 average.

Solved: "mount error: could not resolve address for <hostname>. No address associated with hostname"

Posted 01-05-2011 at 06:19 PM by the dsc (linux-related notes)
Updated 01-05-2011 at 06:24 PM by the dsc

This error may happen when trying to mount a cifs/smbfs share, be it either via fstab or command line. Most people seem to either not have the problem or circumvent it by using static IPs instead of hostnames, which will work only as long as the IPs don't change. Funnily enough, it seems that for some people the problem is exactly the other way around, IPs won't work, only the hostname. Weird. This is also kind of funny/infuriating as the share will be readily accessible via konqueror, and perhaps...
Member
Posted in Uncategorized
Views 15750 Comments 1 the dsc is offline
Old

Apparently "update-rc.d" does something essential

Posted 09-04-2010 at 10:20 AM by the dsc (linux-related notes)
Updated 09-04-2010 at 10:21 AM by the dsc

I thought all it did was to create symlinks with the proper prefixes in a automated way for a given script, something that one could do manually... but apparently it does something more.

But perhaps I just did something wrong when trying to do it manually, like using the wrong runlevel folders. Or perhaps it was just the difference from priority 20 to 19 that made the difference even though I thought the key was to be a higher priority (i.e., a lower number than) than 22.
...
Member
Posted in Uncategorized
Views 669 Comments 0 the dsc is offline
Old

If condition "if condition ... if condition"

Posted 08-28-2010 at 06:26 PM by the dsc (linux-related notes)
Updated 08-28-2010 at 06:28 PM by the dsc

If you want to have a script that would do something if either one of two consequences is true, a simple way to do that would be:

Code:
if [ condition 1 ] || [ condition 2 ] ; then
if [ condition 1 ] ; then
consequences for condition 1
fi
if [ condition 2 ] ; then
consequences for condition 2
fi
consequences of either one, but happens only once, not twice
fi
...
You check if either one is true, when "||"...
Member
Posted in Uncategorized
Views 640 Comments 0 the dsc is offline
Old
Rating: 2 votes, 4.00 average.

Batch-fixing symlink targets

Posted 08-28-2010 at 06:08 PM by the dsc (linux-related notes)
Tags batch, symlink

Sometimes you move the folder to which lots of symlinks were pointing, or something to that effect, and you want to simply "edit" these symlinks rather than recreating them pointing the correct new location. That's how it can be done with one line:

Code:
find /place-where-the-null-symlinks are/ -type l | while read nullsymlink ; 
do wrongpath=$(readlink "$nullsymlink") ; 
right=$(echo "$wrongpath" | sed s'|/whatever/is/the/old-wrong/path|/correct-new/path|')
...
Member
Posted in Uncategorized
Views 3458 Comments 1 the dsc is offline

  



All times are GMT -5. The time now is 12:18 AM.

Main Menu

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