Category Archives: linux

Partial 3D model of Comet 67P/Churyumov-Gerasimenko through photogrammetry

The ESA asked people to use their imagery of the Comet 67P/Churyumov-Gerasimenko. They released an archive of photos under the CC BY-SA. I took them, threw them into a trial version of Agisoft Photoscan and generated a textured mesh in it. I then exported it as .obj-model, loaded it in Blender and exported it to a WebGL scene with blend4web. In other words, I just threw some programs at it.


You can see the result in your browser at (~7 Megabytes). Be aware that while I used a lower quality version for this web version, the higher quality versions I tried were not actually that much “better”. The quality is limited by the resolution of the imagery and of course the fact that we do not have full coverage of a well-lit comet. Still totally fascinating and lots of fun to try.

You can download a higher quality .obj at (~12 Megabytes), you can import that straight into Blender.

Now could someone turn the VisualSFM suite into something that is fun to use on Linux so I can try without Photoscan? ;)

PS: I should add that I have not used Photoscan without ground control points for a completely foreign object before. Someone with more experience should be able to get a better result out of it. If you do and you read this, please share your wisdom!

“Commandline File Hosts”

These are the “terminal to URL” file hosts I know. Please tell me about others. The speed tests are not scientific at all, my servers might be uncapable of better speeds because of saturation or bad routing.

curl --upload-file "01_Name_Game_(Intro).mp3"

Maximum Filesize: 5 Gigabytes
Expiration after: 2 weeks
Serves error 500 for non-existing files. Does not serve direct downloads anymore. Bleh.
Download URLs are modeled after your original filename (“special” characters are replaced): upload: ~30-110 Megabit/s download: ~240 Megabit/s

curl -F "file=@01_Name_Game_(Intro).mp3"

Maximum Filesize: 20 Gigabytes
Expiration after: 4 hours
Requires you to visit their website to get a key (URL) assigned.
Download URLs are random and but it serves original filename with content-disposition: upload: ~60-75 Megabit/s download: 100 Megabit/s

curl --upload-file 01_Name_Game_\(Intro\).mp3

Maximum Filesize: 50 Megabytes
Expiration after: 6 months
They might increase filesize and expiration if there is enough interest, as of now you can not “sign-up” for those.
Download URLs are unreadable, filenames are lost: upload: ~8 Megabit/s (until it errored :) )
Requires sign-up.

Shutting down the operating system by playing a “kill song” in MPD

I use a 20€ Dockstar with Archlinux ARM on it as MPD music server. Since I like to turn off electronic devices when they are not needed and pulling the plug is not something you should do to running computers, I was looking for a solution to somehow shut it down from any mpd client. So I added a specific song as “shutdown file”. Once that song is played, the system will cleanly shut down and power off.

Here is the systemd .service file I came up with:

# cat /etc/systemd/system/mpdtosystemshutdown.service
Description=MPD to system shutdown

ExecStart=/bin/sh -c "sleep 10 && /usr/bin/inotifywait -e open /path/to/path/music/shutdown.mp3 && mpc clear && shutdown -h now"


You need: inotify-tools and mpc (in addition to mpd)

  1. The service sleeps for 10 seconds in the beginning because I keep the music on an external USB harddisk which gets mounted after the multi-user target is reached. This is an ugly workaround but should be good enough. A better solution would be using a udev rule or systemd mount unit to only start the service when the harddisk is mounted.
  2. Then inotifywait will monitor shutdown.mp3 for being opened by mpd (or anything else). Once this happens inotifywait will quit successfully.
  3. mpc will clear the mpd playlist as you do not want shutdown.mp3 to be played again right after booting, do you? I surely did not.
  4. Finally the system is being shut down and powered off.

You probably have to add shutdown.mp3 to your mpd database before starting this service or the database update might trigger it. Updating the database afterwards is save and does not trigger the shutdown.

Don’t blame me if this ends up with an infinite reboot loop.