Pi and I
Setting up my Raspberry Pi. Experiences with crunchbang, ubunutu, bunsenlabs help, but in Raspbian some things still are slightly different, namely:
Universal Plug and Play (UpnP) is developed by the Digital Living Network Alliance (DLNA) and has interoperateability in mind. See Make Use Of for a list of possibilities.
Client: pick one from http://www.subsonic.org/pages/apps.jsp. VLC also works as a client, see https://askubuntu.com/a/109083/80611
I use play:Sub, another $5
I also tried Gerbera
Easy, cheap, but flawed.
Hat tip: Lifewire
Interestingly it was easier to setup video streaming than audio (use vlcstreamer, see upubuntu).
sudo apt-get install sqlitebrowser
cd ~/.local/share/data/Mendeley\ Ltd./Mendeley\ Desktop/
sqlitebrowser <you@whatever>@www.mendeley.com.sqlite
update Files set localUrl = replace(localUrl, 'file:///old/path/‘, 'file:///media/new/path/‘);
Thanks to 3.14a and jordi’s comment there. For related Mendeley grievances see khufkens, who can tell you how to sync Mendeley to your own server (instead of feeding Elsevier’s questionable pricing model).
Anyway, the whole setup was a true Linux afternoon, reminding me of my NDISwrapper-days, just like it was 2006 again.
First, It took me a while to get crunchbang to discover the device and connect [1] (Blueman works much better as a bluetooth manager). Then apparently I manually needed to let pulseaudio know where to send the audio [2]. Atfer fiddling with some files, pulseaudio was broken, so I needed to reinstall [3]. Finally, the sound was much poorer than via my phone. I don’t know if I overlooked it or if loading rtirq changed something [4], but in the volume control center of pulseaudio there is a tab called »configuration« where I had to choose »High Fidelity Playback (A2DP)« to get decent sound (instead of »Telephony Duplex (HSP/HFP)« or »off«). Now most of the times it changes to the Bluetooth-device automatically once I switch it on and back when I switch it off. Sometimes not. But hey.
The sources I used were these:
What I get when I come home is file names looking like this: _DSC1234.NEF. What I wanted instead was
looking like this: 20140708_WeddingAdamAndEve_0001.NEF
There are a few issues with this:
ad 1. Date Shot: sometimes I can only copy and rename the files a few days after shooting, so the date should reflect the date the picture was taken, not the date it was copied. Getting date-shot from the file itself is difficult as there is no birth time recorded. The closest is mtime which is the time the file’s content has last been modified. However, creation date is stored in image file’s EXIF data.
ad 2: Name of Shoot: Ideally I wanted this to be a variable I could set as a parameter when calling the script.
ad 3. Number of Image: This should reflect the age of the image with the oldest one having the lowest number. The problem is that cameras usually restart numbering at 0000 once they hit 9999. So images n-9999 can potentially be older than 0000-n. I needed a solution that would cater for this special case.
# original solution by @Gilles (http://unix.stackexchange.com/questions/141138/) # set base path and navigate to "basepath + parameter 1" BASEPATH='/media/data/photo/'; cd $BASEPATH$1 # add "EXIF creation time" as prefix to original file names exiv2 mv -r %Y%m%d-%H%M%S:basename: *.NEF # Now we have files with names like 20140630-235958_DSC1234.NEF. # final rename i=10000 for x in *.NEF; do i=$((i+1)) mv "$x" "${x%-*}_$2-${i#1}_Copyright-Jan-Soehlke.NEF" done
Walkthrough
Line 4: Here we set our base path. We choose the highest directory ever useed to store pictures.
Line 5: Navigate to base path + parameter 1. If our script is called rename and the pictures are in /media/data/photo/weddings/adam+eve, then we call the script through
./rename weddings/adam+eve
Line 8: In a first iteration we add EXIF-creation time as a prefix to the original file names. We use exiv2 for this operation. -r is for rename and we use YYYYMMDD-hhmmss, which is %Y%m%d-%H%M%S in strftime(3), plus :basename: to keep the original filename after the time stamp.
Through creation time as a prefix we now sort files by age, even if the files would sort differently by name. This could happen if during a shoot we reach 9999 and the camera’s counter continues at 0000 or if we shot with two different cameras.
By also retaining the original file name for now, we make sure that in case there are multiple files with the same time stamp, they still have individual names. EXIF time’s finest unit is a second, so if we fire bursts of images (Nikon’s D4s for example shoots at 11 frames/second), we have multiple files with the same creation date and thus potentially 11 files with the same name.
Line 12: The counter variable i counts from 10000 and is used with the leading 1 digit stripped; this is a trick to get the leading zeros so that all counter values have the same number. If you want more (or less) than four digits, set i accordingly.
Line 15: ${x%-*} removes everything that follows the - character, in our case it is hours, minutes and seconds as well as the original filename. ${i#1} writes the new four digit file number.
$2 provides a second variable, which we use for the shoot name. In this case we want it to be WeddingAdamAndEve, so we call the script through
./rename weddings/adam+eve WeddingAdamAndEve
Finally, I added _Copyright-Jan-Soehlke. It not only reminds someone who downloads the file that it is indeed copyrighted, it also helps with SEO as my name is automatically associated with each image I upload.
Possible Problems
a) The original file names already have a
-
in place. In this case change the - in line 8 to something different (like _) and use the same character in the ${x%-*}-part in line 15 (in this case ${x%_*}, otherwise the script will not work as intended.b) A burst of images reaches across the
9999
/0000
-mark. These specific files will not be in order after renaming – but they weren’t in order in the first place, so I have no idea how to tackle this rare scenario other than by setting your camera’s counter to reset to 0000 after each formatting.c) Your files do not contain EXIF data. In this case see mikeserv’s solution which uses a different angle of attack and is thoroughly and well explained.
___________________________
* Stackexchange uses the CC-BY-SA license, so all the code in this example is naturally also CC-BY-SA.
A slightly outdated version is in debian’s repositories, but if you want a newer one, go to »Kbyte’s Hideout«. Download .deb package and dpkg -i rawtherapee_<xxx>.deb
If there are unsolved dependencies: apt-get install -f and then dpkg -i rawtherapee_<xxx>.deb
Well.
It still is the most straightforward programme I know for editing, simple retouches and exporting smaller sizes. I’m not happy with wine, I’m not happy with a google tool, but I cannot and cannot find an alternative (see here). Hence:
before following the webupd8 tutorial I needed
apt-get install libwine-cms:i386
After installation, use
cd ~/.wine/drive_c/Program\ Files/Google/Picasa3 && wine Picasa3.exe
to launch it.
If you would then create a script called »picasa« somewhere, say in ~/scripts containing the following:
#!/bin/bash cd ~/.wine/drive_c/Program\ Files/Google/Picasa3 &amp;&amp; wine Picasa3.exe exit 0
Picasa can then be launched from command-line with a simple »picasa« after a final
sudo ln -s ~/scripts/picasa /usr/bin/picasa
To change the format from Hour:Minute open ~/.config/tint2/tint2rc and consult strftime-man to change to your liking.
Keyboard shortcuts can be changed in ~/.config/openbox/rc.xml
After saving, go to Openbox menu > Preferences > Openbox Config > Reconfigure. (Thanks, MysteryMember)
sudo add-apt-repository ppa:webupd8team/unstable
sudo apt-get update
sudo apt-get install go-mtpfs
Optional:
sudo apt-get install go-mtpfs-unity
Mount:
go-mtpfs /media/MyAndroid
Unmount:
fusermount -u /media/MyAndroid
Ironic that I should now need a special programme to mount my one Linux device on my other Linux device while windows works out of the box…
Setting it up was a lot easier then I though. All it took was rbgeek’s exccellent article »File Synchronization Between Two Ubuntu Servers using Unison«.
Falko Timme’s article »Setting Up Unison File Synchronization Between Two Servers On Debian Squeeze« at howtoforge was also helpful. Another insightful article is Chris Lale’s »Synchronising laptop and desktop files using Unison« at Sourceforge.
One issue: normally your device gets an IP address automatically from your router. Unison settings depend on the IP address (for ssh connection), so if the IP address changes, Unison gets confused. Thus, we want a static IP address on the remote machine. Johnathan Hobson’s »Networking Tips and Tricks« are a good start. The settings that finally worked for me I got via chili555’s post on ubuntuforums. Using Netman’s GUI, I set:
Method: Manual
Address: 192.168.0.9
Netmask: 255.255.255.0
Gateway: 192.168.0.1
DNS Servers: 8.8.8.8, 192.168.0.1
Search domains: –
I understand little, but what I do understand is this:
You can easily determine the router’s ip-address and the scope for auto DHCP from the router’s admin interface.
[article started in January 2013; final, rewritten version from January 2014]
The problem is described in many places and many different fixes, remedies and work arounds exist. Most of them lack proper documentation, so I am reluctant to try them. Even thinkfan, which is quite popular, scares me more than it helps.
Here is a collection of relevant information I found:
For now I went with #7 (thinkfan howto by Neolocus), and I do hear a substantial difference in fan activity – but I am still scared.
First surprise:No issues. Only: apparently all of a sudden my computer needs a /boot partition, so my partition map looks like this:
1. primary ext2 254MB /boot
2. logical swap 4000MB
3. logical ext4 <rest> /
sudo apt-get install arandr
Here is your way out: UNetbootin
I thought that should do the trick, yet it didn’t restrict internet access to this user. I tried various other things to deny access to network and web and finally found something useful at ubuntuusers.org (German):
create a file in /etc/init.d (filename doesn’t matter)
sudo touch /etc/init.d/iptab-filter.sh
Open the file you created:
sudo gedit /etc/init.d/iptab-filter.sh
I was unable to convert to this with avidemux. Google quickly told me that ffmpeg could do the trick. But being unfamiliar with bitrates and stuff I was happy indeed when I found Mobile Media Converter, which is a neat and lean GUI for ffmpeg (Mac, Linux and Win). It even sports convenient batch process via drag & drop. Have fun.