Barnoid’s Knowledge Base

Bits of Collected Wisdom

June 28th, 2007

Concatenate PDF Files

To concatenate two or more PDF files together into one, try

# gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=concatenated.pdf file1.pdf file2.pdf [file3.pdf [...]]

With the -dBATCH -dNOPAUSE option, ghostscript won’t show a prompt and you won’t have to press return after each page. Comes in handy if the PDFs are long.

June 15th, 2007

CPUFreq Daemon Fails to Stop

On my Gentoo notebook, stopping cpufreqd fails:

# /etc/init.d/cpufreqd stop
* Stopping CPU Frequency Daemon ...           [ !! ]

It seems that start-stop-daemon fails to terminate the cpufreqd processes, so let’s help it a bit. Simply add the following bold line to the stop() function in your /etc/init.d/cpufreqd script

stop() {
ebegin "Stopping CPU Frequency Daemon"
kill -9 `ps -A | grep cpufreqd | sort -n | head -n 1 | awk ‘{print $1}’`
start-stop-daemon –stop –exec /usr/sbin/cpufreqd
eend ${?}
}

Now cpufreqd should shut down nicely:

# /etc/init.d/cpufreqd stop
* Stopping CPU Frequency Daemon ...           [ ok ]