## Mendeley Migration

posted in: Linux, Other, Technicalities | 0

Alreet.Sometimes Mendeley content has to move. There’s no easy way to tell Mendeley that. So.

1. sudo apt-get install sqlitebrowser
2. cd ~/.local/share/data/Mendeley\ Ltd./Mendeley\ Desktop/
3. sqlitebrowser <you@whatever>@www.mendeley.com.sqlite
4. Go to »Execute sql«-tab
5. update Files set
localUrl = replace(localUrl, 'file:///old/path/‘, 'file:///media/new/path/‘);
6. click »Execute« (or F5 or ctrl+return)
7. click »Write changes«
8. Done. Easy, right?

Thanks to 3.14a

## Automatically batch rename photo files

Following Robert Seale’s advice, I was looking for a solution to batch rename photo files. After my last shoot I used digikam and while the results were as desired, it took a second or more per image, which I thought a bit long. After not finding a different suitable solution I asked the question on unix.stackexchange and was overwhelmed by two people’s in-depth answers. I learned a lot from both mikserv and Gilles and in the end settled with Gilles’ suggestion. I take zero credit for the solution, I don’t even understand parts of what is going on, but I amended it a little bit nonetheless and thought the extended version might help someone.*

### Preliminaries

What I get when I come home is file names looking like this: _DSC1234.NEF. What I wanted instead was

1. date-shot in YYYYMMDD-format plus
2. a descriptive shoot-name plus
3. image-number

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.

### The code

# 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

#

## Network Sync

posted in: Linux, Technicalities | 0

I recently got my hands on a shiny eee-PC for surprisingly little money. As I am travelling a fair bit at the moment, the opportunity was more than welcome. Now, mobility comes at a price and the price is called »multiple instances of files«. When

## Bibtex going openout_any = p

posted in: LaTeX, Technicalities | 4

Working with multibib, Bibtex started failing me after a recent reinstallation of texlive on xubuntu. On
bibtex <project-path>/src.aux
I got:

bibtex: Not writing to &lt;project-path&gt;/src.blg (openout_any = p). I couldn't open file name &lt;project-path&gt;/src.blg'

To get rid of the error, open texmf.cnf, which resides in /usr/share/texlive/texmf/web2c through
sudo

## Cloud a la ownCloud

posted in: Technicalities, www | 0

After an earlier failed attempt at owncloud 4 I’m prety happy with OC 5 now and succesfully sync contacts, calendars and some files in between a crunchbang netbook, a xubuntu notebook and my Android phone:

### Desktop Client

• Setting it up:
Somehow it only worked as root, chown did the trick (see here):
sudo chown -Rc USER:USER /home/USER/.local/share/data
• Syncing
Syncing works pretty well – but unfortunately not well enough. I do like that one can connect random folders to sync (for example a local folder »Documents« may be called »docs« on OC). What I like not so much is that you can only run two-way-sync. There is no option »sync only from server to machine« or »sync only from machine to server«. It would be very helpful as I use Unison to sync very large parts of my hard drives among several machines – much more then I want or need in OC. Yesterday I lost some data and I think it was due to owncloud got confused with two machines syncing to it in addition to syncing directly in between each other.
• Android
The oc-app allows syncing to the phone on a file-by-file basis, which is neat. It also adds an owncloud-option to the share-menu. What I find really convenient though is that owncloud allows es-file-explorer to connect.

### Further tutorials and resources I used

[article started in August 2012;

## xubuntu 12.04

posted in: Linux, Technicalities | 0

Way too many issues with a first attempt drove me to the decission to reinstall. I had a look around and made eye contact with fedora, arch and debian but in the end thought I’d give a clean xubuntu installation a second chance – and I did

## Strikethrough in LaTeX

posted in: LaTeX, Technicalities | 8

Today I found a second way to achieve a strikethrough in LaTeX (what is done by »line-through« in css: strike out text). If you want to put a line across text, your choices are »ulem« and »cancel«:

## Strikethough in LaTeX using »ulem«

\usepackage{ulem} in the preamble

## Deny Internet in Ubuntu

posted in: Linux, Technicalities | 0

I have phases in my work cycle, where I want to limit internet access to myself. Thus, I created a »work-user« and in the user’s properties I unticked the boxes

• Connect to internet using a modem
• Connect to wireless and ethernet networks
• Use modems

I thought that should do the trick, yet it didn’t restrict internet

## ffmpeg-GUI

posted in: Linux, Technicalities | 0

I was somewhat flabberghasted when I found out my mobile phone (Sony Ericsson Cyber-shot) was unable to play .mp4, .flv, .avi and what else I tried. It refuses to play all video formats save .3gp.

I was unable to convert to this with avidemux. Google

## Fonts in LaTeX

posted in: LaTeX, Technicalities | 0

In short: To avoid the standard pixel bitmap fonts and go for smooth, scalable post script ones, use one of the following:

\usepackage{palatino}
\usepackage{times}
\usepackage{bookman}
\usepackage{newcent}

or, for standard post script fonts

\usepackage{pslatex}

## Position:Absolute in LaTeX

posted in: LaTeX, Technicalities | 0

In css there is the handy absolute positioning. Today I found out how to do it in LaTeX:

In the preamble

\usepackage{textpos}

In the document

\begin{textblock}{2}[0,0](8,1.5)     Lorem ipsum dolor sit amet \end{textblock}

The arguments are as follows:

\begin{textpos}
{<width>}

## ΛαΤεΧ in Greek

posted in: LaTeX, Technicalities | 0

There are various possibilities to include Greek text in your LaTeX document. The three ones I found are these:

1. $\Gamma\rho\varepsilon\varepsilon\kappa$ gets you Γρεεκ allright, but it looks clumsy and lacks all the accents etc.
2. betababel. It does not work with my customised control sequences, and I am too lazy to change them and learn them all anew.
3. polutonikogreek. Neat, slim, worked straight away.

Nos. 2 & 3 use ngerman, so make sure they don’t start a fight with german.

## update

I had a slight problem with polutonikogreek and titletoc. Whenever I used something like

\greek{p’olemos}

which referred to this entry in the preamble:

\newcommand*{\greek}[1]%    {\selectlanguage{polutonikogreek}{#1}%    \selectlanguage{german}}

the .toc-file looked like this at the corresponding place:

[…] \contentsline {section}{\numberline {1.1}KAPITEL-1.1}{14} \contentsline {subsection}{\numberline {1.1.1}UNTERKAPITEL-1.1.1}{14} \select@language {polutonikogreek} \select@language {german} \select@language {polutonikogreek} \select@language {german} \contentsline {subsection}{\numberline {1.1.2}UNTERKAPITEL-1.1.2}{20} […]

Wherever \select@language appeared in the toc, the styling of my toc entries of the subsection level was being messed up. I style subsection entries in the toc in a way that they all get written in a single line. It looks like this:

\titlecontents*{subsection}[3.5em]   {\vspace{-0.5mm}\itshape\footnotesize}{}%   {}{\dots\normalfont\footnotesize%   \thecontentspage.\enspace}%   [\itshape][\vspace{1mm}]

There are two solutions.

Ignore the problem, compile your document, open the .toc-file, delete all \select@language entries and compile again (but only once). Use the following specifications in your preamble:

\usepackage{ucs}\usepackage[utf8x]{inputenc}\usepackage[polutonikogreek,german]{babel}\newcommand{\gdir}%`

## Custom Counter in LaTeX

posted in: LaTeX, Technicalities | 0

## How it does work:

Here is what we do: We define the counter

\newcounter{MyCounter}

\renewcommand\theMyCounter{\roman{MyCounter}}

after it, and it works. Thanks to Axel for his help on this.

## How it does not work:

When you define a new counter like this

\newcounter{MyCounter}

And later use it like this

\refstepcounter{MyCounter}\label{example} \roman{MyCounter}. Beispiel eins

And then reference it like this:

And now I reference an example \ref{example}. \end{document}

Then LaTeX still interprets it as