Welcome to the most active Linux Forum on the web.
Go Back > Blogs > linux-related notes
User Name


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

Make bash scripts wait in line until other instances have finished their job

Posted 08-06-2015 at 04:04 PM by the dsc (linux-related notes)
Updated 08-06-2015 at 07:34 PM by the dsc

# It seems to work, but who knows. May have some terrible flaw and ruin your life. Your entire life.
# "${0##*/}" is the script name ("$0") stripped of any parameters ("##*/"), by the way.

if ls /dev/shm/${0##*/}-ticket* 2> /dev/null ; then
	while [[ -e "/dev/shm/${0##*/}-ticket$n" ]]; do
		n=$(( $n + 1 ))
touch /dev/shm/${0##*/}-ticket$n
Posted in Uncategorized
Views 253 Comments 0 the dsc is offline

Use any widget theme with Krita, outside KDE with a tiny cheat

Posted 06-23-2015 at 02:12 AM by the dsc (linux-related notes)

export KDE_FULL_SESSION=true && krita

It may have other collateral effects I haven't figured yet, not only on krita, but perhaps even elsewhere. Possibly DANGEROUS.

Be warned that other widget themes besides plastique and oxygen are known to be often broken outside KDE, that's the reason for such theme-enforcing policy. If your preferred theme doesn't work on Krita, don't complain about that to them, they've manifestly done that in order to avoid trying to make...
Posted in Uncategorized
Views 268 Comments 0 the dsc is offline

Ugly wrap-around to avoid high CPU and I/O on update-apt-xapian-index

Posted 06-16-2015 at 03:54 AM by the dsc (linux-related notes)
Updated 06-16-2015 at 04:01 AM by the dsc

I've read somewhere that someone else was also annoyed by this.

Here's what I did:

cpulimit -l 5 -e & 

ionice -c 3 /usr/sbin/ $@
That's my "/usr/sbin/update-apt-xapian-index", which is called by synaptic and whatever else. The ".py" file is the original script.

It still makes the CPU fan audibly accelerate, but it's no longer...
Posted in Uncategorized
Views 342 Comments 0 the dsc is offline

Rough script that waits until processes finish their businesses, then exit

Posted 06-15-2015 at 05:17 PM by the dsc (linux-related notes)

The processes are given as a single variable, thus one must use quotes if there's more than one process to wait for.

Usage example:

./waitprocs "lame avconv sox tar" && self-destruct

My previous attempt with a "counting" system didn't work, so I've tried a different approach. For any given process, it will check if it's running, if it is, it creates a temporary file with its name on a temporary work folder; if it isn't, it...
Posted in Uncategorized
Views 472 Comments 2 the dsc is offline

Make a bash script recognize bash aliases

Posted 05-12-2015 at 05:16 PM by the dsc (linux-related notes)
Updated 05-12-2015 at 05:22 PM by the dsc (mismatched tags)

Say, if you have a script that would take as a parameter something that you have aliased, it wouldn't work.

I mean:

$ ./ myalias whatever else
/home/dude/scripts/ line 3: myalias: command not found

In order to make it work, the said script must include:

shopt -s expand_aliases
source ~/.bash_aliases
(Or wherever your aliases are set, which would preferably be...
Posted in Uncategorized
Views 310 Comments 0 the dsc is offline


All times are GMT -5. The time now is 11:31 AM.

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