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

#

Redecorating the place II

posted in: Random, Technicalities, www | 0

After almost eight years using (and helping develop) Polypager, a very versatile and friendly content management system, and after three years of having Zenphoto manage my pictures, I finally decided I had to retire both and move to a different system

MTPFS FAIL

posted in: Linux, Technicalities | 2

My ubuntu 12.04 computer cannot see my Android 4.1.2 phone, instead I must install go-mtpfs and control it via command line. Thankfully, Andrew over at webupd8 provides all the necessary tools (all credit goes to him, for long version see there):

sudo

Removing Juice from Keyboard

posted in: Other, Technicalities | 0

Recently I bought a faulty pack of grapefruit juice. The plastic nozzle was not glued to the carton properly, so instead of filling my glass, I filled my trusty old Logitech UltraX Premium keyboard. I wiped it clean immediately, but the next day the

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

Custom Shortcuts in Kile

posted in: LaTeX, Technicalities | 0

If you use Kile as LaTeX editor and if you find yourself typing the same code all over again – like a specific table environment, or a slide environment in beamer or whatever, why not create your own user tag and assign a custom shortcut?

posted in: Linux, Technicalities | 2

Since 12.04 my thinkpad (T60) regularly shuts down due to heat. I don’t like it and I am afraid of damage – to hard drives or to the system.

The problem is described in many places and many different fixes, remedies and work arounds exist. Most

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;

New Xampp Security Concept

posted in: Technicalities, www | 2

After quite some time I installed xampp again. Everything worked smoothly, only when trying to access phpmyadmin, I was greeted with

New XAMPP security concept:
Access to the requested object is only available from the local network.
This

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

Scholarship Search Engine

posted in: Other, Technicalities | 0

Says Mira Maier, founder of MyStipendium.de:

One in five foundations does not receive suitable applications, thus they don’t know where to put their money.

Another fun fact: 92 % of all applications go to only 0.8 % of all foundations.

Maier’s

Feeds a la Tiny Tiny RSS

posted in: Technicalities, www | 3

[update 2012-10-04] In the meantime, I helped Nic with what he calls scratching some itches for ex-Google-Reader users: we now have gritttt, and gritttt has a) a means to import shared/stared items from g-reader into tt-rss; b) drive-by

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>}

Section Footnote in LaTeX

posted in: LaTeX, Technicalities | 1

I left biting marks in the table on this one. I don’t know if it’s a general issue or just my document. Anyway:

I wanted to have footnotes from inside sections, subsections, and subsubsections. They work similar to footnotes in tables, you

ΛαΤεΧ 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