I had an issue with Apache2 improperly serving a JavaScript file which I seem to have fixed by making sure the file was terminated with a new-line character… this was really hard to diagnose and resolve! The behaviour in Firefox was that the file just didn’t finish to download, whereas the Apache2 logs indicated a 200 result… I think it may have had something to do with automatic compression, which is a dark art that I do not understand (mumbles something about mod deflate…).
rsync errors
I was having an issue with my rsync command:
time rsync --progress --verbose --acls --xattrs --exclude="/lib/mysql/ibdata1" --exclude="*.tmp" --stats --human-readable --recursive --del --force --times --links --hard-links --executability --numeric-ids --owner --group --perms --sparse --compress-level=6 diligence-test:/usr/ /data/temp/2017-11-15-163925/usr/
getting stuck during “receiving incremental file list” then giving up with:
Timeout, server diligence-test not responding. rsync: connection unexpectedly closed (16384 bytes received so far) [receiver] rsync error: error in rsync protocol data stream (code 12) at io.c(235) [receiver=3.1.2] rsync: connection unexpectedly closed (32569 bytes received so far) [generator] rsync error: unexplained error (code 255) at io.c(235) [generator=3.1.2] Command exited with non-zero status 255
I could see the server-side process hang in select() with:
root@diligence-test:/home/jj5# ps aux | grep rsync
root 5421 0.0 0.1 15636 2660 ? Ss 18:55 0:00 rsync --server --sender -vlHogtpAXrSe.iLsfxC --numeric-ids . /usr/
root@diligence-test:/home/jj5# strace -p 5421
strace: Process 5421 attached
select(1, [0], [], [0], {42, 979828}) = 0 (Timeout)
Anyway I figured out how to dodge the problem by nominating –delete-before instead of –del, e.g.:
time rsync --progress --verbose --acls --xattrs --exclude="/lib/mysql/ibdata1" --exclude="*.tmp" --stats --human-readable --recursive --delete-before --force --times --links --hard-links --executability --numeric-ids --owner --group --perms --sparse --compress-level=6 diligence-test:/usr/ /data/temp/2017-11-15-163925/usr/
Backup Thunderbird data
I wanted a backup of my Thunderbird data on my Debian desktop, and I created it like this:
jj5@tact:~$ tar -c -f jj5-.thunderbird.tgz --use-compress-program='pigz -p 7 --best' .thunderbird
Waiting for VirtualBox guests to close before reboot or shutdown
vim /etc/init.d/virtualbox chmod +x /etc/init.d/virtualbox update-rc.d virtualbox defaults
The /etc/init.d/virtualbox script should look like this:
#!/bin/sh
# 2017-08-07 jj5 - SEE: How make Debian wait for all VirtualBox guests to
# stop during shutdown/reboot?: https://superuser.com/a/929292/615689
### BEGIN INIT INFO
# Provides: virtualbox_start_and_stop
# Required-Start: $local_fs $network
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description:
# Description: Start virtualbox on boot, and shutdown safely on shutdown/reboot.
### END INIT INFO
case "$1" in
start)
echo "Starting Virtualbox "
# Do whatever to start or resume your virtualbox instances.
# Perhaps look for a txt file someplace with VMs that need to be
# restarted or resumed... then start 'em.
;;
stop)
echo "Stopping Virtualbox"
# Do something to either shutdown or savestate your virtualbox instances.
# maybe also save the instances that should be resumed into a txt file
# someplace for the start method above.
# 2017-08-07 jj5 - SEE:
# https://askubuntu.com/a/457564
# 2017-08-07 jj5 - NOTE: You should make sure that ACPI Shutdown actually
# shuts down the guest...
# 2017-08-07 jj5 - SEE: Force Ubuntu Desktop to shutdown on power button:
# https://www.progclub.org/blog/2017/08/07/force-ubuntu-desktop-to-shutdown-on-power-button-keypress-acpi-shutdown/
while [ -n "$( sudo -u jj5 VBoxManage list runningvms )" ]; do
sudo -u jj5 VBoxManage list runningvms \
| sed -r 's/.*\{(.*)\}/\1/' \
| xargs -L1 -I {} sudo -u jj5 VBoxManage controlvm {} acpipowerbutton;
sleep 1;
done;
;;
*)
echo "Usage: /etc/init.d/virtualbox {start|stop}"
exit 1
;;
esac
exit 0
You may also need to Force Ubuntu Desktop to shutdown on power button keypress…
Force Ubuntu Desktop to shutdown on power button keypress (ACPI Shutdown)
See How to Shutdown Ubuntu with the PC Power Button. Basically edit /etc/acpi/powerbtn.sh and as the first command use e.g.:
shutdown -h now; exit 0;
VirtualBox VBoxManage for autostart
I have a script tact:/etc/vbox/register-autostart.sh which will register a VirtualBox VM for auto-start. It required other config in /etc/vbox the details of which I don’t remember, but I think it’s done now anyway… there’s more information in Starting virtual machines during system boot.
online "$machine" && {
report "halting machine '$machine'...";
ssh "$machine" sudo poweroff;
report "waiting a moment...";
sleep 8;
};
run VBoxManage modifyvm "$machine" --autostart-enabled on;
run sudo service vboxautostart-service restart;
New word: ennui
Today I learned: ennui: boredom, basically.
mdadm bitmap removal
I’m not certain, but I think the write-intent bitmap on my RAID5 array was slowing down my system without any real advantage. So I deleted it, like this:
# mdadm --grow --bitmap=none /dev/md0
Adding weekday to Date column in Dolphin in KDE on Debian GNU/Linux
cd /usr/share/i18n/locales cp en_AU en_JJ vim en_JJ
Change metadata:
title "English locale for John Elliot V" language "John's English"
And prefix d_fmt with:
d_fmt "<U0025><U0061><U0020>
Then:
sudo localedef -f UTF-8 -i en_JJ en_JJ.UTF-8
Then:
vim /etc/environment
add add:
LC_TIME="en_JJ.UTF-8"
Up-Goer 1984
Do you see what I did here? :)
- Perhaps one did not want to be loved so much as to be understood.
- Who controls the past controls tomorrow. Who controls the present controls the past.
- Fighting is not fighting. To be free is to not be free. Not knowing makes us strong.
- The best books… are those that tell you what you know already.
- If you want to keep something hidden, you must also hide it from yourself.
- It was a bright cold day one month, and the time was ten and three.
- If you want a picture of tomorrow, imagine a foot kicking a human face—for ever.
- We will meet in the place where there is only light.
- But if thought breaks talking, talking can also break thought.
- Two-think means the power of holding two thoughts against each other in one’s mind at the same time, and accepting both of them.
- Until they start thinking they will never fight, and until after they have fought they can not start thinking.
- Now I will tell you the answer to my question. It is this. The Party wants power only to its own end. We are not interested in the good of others; we are interested only in power, real power. What real power means you will understand one day soon. We are different from the people in control in the past in that we know what we are doing. All the others, even those who seemed like us, were scared and spoke two ways. The bad people and the other bad people came very close to us in their ways, but they never had the no-fear to see their own reason. They pretended, perhaps they even believed, that they had taken power without want and for a small time only, and that just around the corner there lay a happy place where humans would be free and the same. We are not like that. We know that no one ever takes power with the want of giving it away. Power is not a means; it is an end. One does not start an office in order to save a turn over; one makes the turn over in order to start the office. The point of pain is pain. The point of hurting is hurting. The point of power is power. Now you begin to understand me.