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.

67p_photoscan_blend2web

You can see the result in your browser at http://hannes.enjoys.it/geo/67p.html (~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 http://hannes.enjoys.it/geo/67p.7z (~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.

https://transfer.sh/

curl --upload-file "01_Name_Game_(Intro).mp3" https://transfer.sh/

Maximum Filesize: 5 Gigabytes
Expiration after: 2 weeks
Uses HTTPS!
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): https://transfer.sh/SGNl/01-name-game-intro.mp3
1GB.zip upload: ~30-110 Megabit/s
1GB.zip download: ~240 Megabit/s

http://curl.io/

curl -F "file=@01_Name_Game_(Intro).mp3" http://curl.io/send/abcd1234

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: http://curl.io/get/kegcxfza/85866a9bcfaf6f8eccab136238c07f659d580b25
1GB.zip upload: ~60-75 Megabit/s
1GB.zip download: 100 Megabit/s

http://chunk.io

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

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: http://chunk.io/f/afb01d527ceb4d03b9bf9e62bb32263e
1GB.zip upload: ~8 Megabit/s (until it errored :) )

http://purrrl.link/
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
[Unit]
Description=MPD to system shutdown

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

[Install]
WantedBy=multi-user.target

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.