Sunday, December 25, 2011

espresso jelly

This is a howto/documentation for Espresso jelly.

One day a couple of friends and me got the idea of espresso jelly. We all like to drink espresso (or moka or whatever the correct term for this kind of "coffee" is (see the coffee pot in the images below)) and found the idea of a brown jelly with intense coffee taste smeared on the morning bread rolls quite amusing.

Ingredients:
  • Gelling sugar with a fruit-sugar relation of 2:1 (in this case espresso-sugar relation).
    Other terms for gelling sugar:
    • Sugar with pectin
    • Jam sugar (British)
    • Jelly sugar (US)
    • Aspic sugar
    (Not to confuse with Preserving sugar, which does not contain additional pectin)
    See Wikipedia - gelling sugar
  • Espresso
  • Sugar (optional)

Variants:
Gelling sugar Espresso Sugar Description
Variant 1 250 g 375 ml - variant tends to get a bit more liquid / syrup-like. Qualified as ice cream topping ;-)
Variant 2 250 g 300 ml 1 Tablespoon Firm jelly. You may want to leave the additional sugar out. Tries to resist the bread-roll-distribution.
  • Variant 1 corresponds to the instructions of the gelling sugar.
  • As the comment in variant 2 states, to get a firm jelly - use less espresso and maybe add an additional spoon of sugar.

The following pictures show variant 2.

This is the used gelling sugar.


300ml Espresso (~3 Times of cooking with the used pot ;-))
Variant 2 says 250g of gelling sugar with one Tablespoon of (normal) sugar.

Pouring the espresso into the mixed sugars.

Heating it up. Following the instructions on the gelling sugar: Boil for approximately 4 minutes and test the gelling ability (take a teaspoon of it, put it on a dish and see if it gets firm; if it's still liquid, keep cooking). Do not interrupt the boiling. Boil for max. 8 minutes.

Quickly pouring the hot jelly into the prepared glassed and closing them in an instant.

Waiting a day.. aand Yummie!

Change font size and font type of text-only mails in gmail webinterface

Problem:
Writing emails in gmail webinterface using the 'plain text' option results in wrong aligned text because gmail uses a non-fixed-width font.
Additionally some forwarded mails are displayed very small.

Steps to reproduce the 'very small font' effect:
  • Write mail with 'plain text' option in gmail.
  • Send mail.
  • Receive mail with stand-alone mailclient, e.g. Thunderbid/icedove,
    • configure client to compose mails in html/rich text mode
      ( Edit|Account settings|Composition&Addressing|Compose messages in HTML format (Icedove 3.1.16) )
  • Forward mail to gmail account
  • View mail in gmail webinterface.

Solution:
Found a userscript which sets the font in gmail to the browsers default monospace font. No further configuration needed.
The script can be found on userscripts.org - Gmail Fixed Font or directly downloaded from GitHub - jparise / gmail-fixed-font.
  • Chromium pops up an install notification. Userscripts are directly supported. Browser restart seems to be needed after install to apply changes to the gmail webinterface display style.
  • Firefox needs an extension to be able to handle userscripts. Greasemonkey can do that. Get it here (installation of the greasemonkey extension needs a browser restart). Now greasemonkey pops up a notification when clicking on a userscript and asks for installation. Reload gmail tab to apply display changes made by the script.

See the following screenshots for the difference. Take a look at the mail text for additional information.

Default gmail display settings:
The composed mail. The same mail forwarded with an external email client set to html mail-formatting back to gmail.

This time with the userscript 'Gmail Fixed Font' enabled:
The composed mail like above. The forwarded mail like above.


(Btw: It will be listed in the extension tab in chromium.)
Tested with chromium 15.0.874.121 (Developer Build 109964 Linux) Debian wheezy/sid and
Firefox 8.0 with Greasemonkey 0.9.13.
'Gmail Fixed Font' version 1.23 in both cases.

edit: (25.12.11)
- added install information for chromium and firefox.

Thursday, December 15, 2011

LaTeX tables - from spreadsheets to tex

Writing tables in LaTeX is a pain in the ass.
Create a table as draft, find an error, move a column etc. AAarrrrgh.

A nice way to create the basic table and fill it with data is to use a spreadsheet application like MS Excel.

I found some promising tools to convert from spreadsheet applications to latex:
  • OpenOffice.org / LibreOffice
    • calc2latex
      A macro. Generates tex code from selected table area.
      Tested. Works with LibreOffice 3.4.4 (debian package '1:3.4.4-2').
  • MS Excel
    • exceltex
      Directly include .xls files in latex documents.
      Untested.
    • excel2latex
      macro for Excel. Export to latex code.
      Untested.

Monday, December 5, 2011

pdfTeX - get rid of pdf inclusion version warnings

When you include pdf-images in your LaTeX document and get this kind of warnings:
pdfTeX warning: pdflatex (file ./fig/fig_FooBar.pdf): PDF inclusion: found PDF version <1.5>, but at most version <1.4> allowed [...]
Then give pdfTeX this command:
\pdfminorversion=5
This way pdfTeX builds the document with pdf Version 1.5 instead of 1.4.
Before:
> file document.pdf
document.pdf: PDF document, version 1.4
After:
> file document.pdf
document.pdf: PDF document, version 1.5
and no more warnings.

Thanks to Mads Darø, found the solution in his blog:
Kedelig Data: Controlling PDF Minor Version in LaTeX


Just for reference:
> This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
Debian package version: texlive 2009-14

Thursday, September 29, 2011

External usb hdd WD Elements - avoid spindown -- #2

A little update regarding the USB HDD spin-down-problem (discussed here: External usb hdd WD Elements - avoid spindown).
I found a better workaround somewhere (sorry to the original author - i forgot where...).

By default, the APM_level is set to 96(d) (60h) after every reconnect.
When setting this value to 128(d) (80h), the drive spins down after .. approx. 30-45 minutes (i haven't tested this exactly, but it definitely doesn't spin after.. lets say 1h).

The APM_level can be set with hdparm:
# hdparm -B /dev/disk/by-label/WD_500G_NTFS
/dev/disk/by-label/WD_500G_NTFS:
APM_level = 96

# hdparm -B 128 /dev/disk/by-label/WD_500G_NTFS
/dev/disk/by-label/WD_500G_NTFS:
setting Advanced Power Management level to 0x80 (128)
APM_level = 128
Note: The hard disk doesn't remember this setting. Like written before - after every reconnect it has its default setting of 96d.


Update1 / additional information:
The hdparm method works for me on the following Kernel:
$ uname -s -r -v -o
Linux 3.0.0-1-686-pae #1 SMP Sat Aug 27 16:41:03 UTC 2011 GNU/Linux
but on
uname -s -r -v -o
Linux 3.1.0-1-686-pae #1 SMP Mon Nov 14 08:24:20 UTC 2011 GNU/Linux
i get the following error when running hdparm:
# hdparm -B /dev/disk/by-label/WD_500G_NTFS
/dev/sdb:
HDIO_DRIVE_CMD(identify) failed: Invalid argument

edit1: (17.12.2011)
-added information regarding different kernel versions.

Monday, September 19, 2011

Tuesday, September 6, 2011

Quick encryption with gpg

Today another kind of bookmark-style post;
Scenario:
You want to protect some file with a password to
  • store it on your local computer
  • send it to someone else.
You need the same password on both sides (=encryption and decryption).
(If sent to someone else, make sure to transfer the password on another way than the file.. )
  • encrypt:
    • % gpg --symetric foo.txt
      results in a file foo.txt.gpg which contains binary data
    • % gpg --symetric --armor foo.txt
      gives foo.txt.asc which contains ascii characters, which makes sense (for small files) when you want to paste it directly into an email
  • decrypt:
    • % gpg --output foo.txt --decode foo.txt.gpg
    • % gpg --output foo.txt --decode foo.txt.asc

source: http://advosys.ca/viewpoints/2006/07/pgp-symmetric-encryption/

Wednesday, August 3, 2011

Repack a .deb-archive

Today just a bookmark.
Needed to change some files inside a .deb archive; found a short tutorial here:
Repack a .deb-archive with dpkg-deb

For backup reasons a c&p from the blog above:

Thanks maff.

Sunday, July 31, 2011

Firefox 5 / Firefox 6 / Firefox 7 / Firefox 8 / Firefox 9 / Firefox 10 - javascript confirm/alert box freeze

I have exactly this problem:
support.mozilla.com - Firefox hangs sometimes on javascript "confirm"

A workaround is to change the appearance of javascript alerts:
support.mozilla.com - Change appearance of javascript alerts
short: go to 'about:config', search for 'prompts.tab_modal.enabled' and set it to 'false'. done.

This way the boxes come with a os-dependent style instead of the nice 'fade out' FFox5 style, but they do work again ;-)
Here is a site where you can test it: JavaScript Confirm


Just for reference, i'm using:
Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0 Iceweasel/5.0
on a debian unstable/sid.
Update:
Problem persists on
Firefox:Mozilla/5.0 (X11; Linux i686; rv:6.0) Gecko/20100101 Firefox/6.0 Iceweasel/6.0
Update2:
Mozilla/5.0 (X11; Linux i686; rv:6.0.2) Gecko/20100101 Firefox/6.0.2 Iceweasel/6.0.2
Update3:
Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20100101 Firefox/7.0.1 Iceweasel/7.0.1
Update4:
Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20100101 Firefox/8.0 Iceweasel/8.0
Update5:
Browser version info like above; debian package version: 8.0-3+b1
Update6:
Mozilla/5.0 (X11; Linux i686; rv:9.0.1) Gecko/20100101 Firefox/9.0.1 Iceweasel/9.0.1
Debian Package: 9.0.1-1
Update7:
Wow. still not working. Might be a problem at my side.. whatever..
Mozilla/5.0 (X11; Linux i686; rv:10.0.2) Gecko/20100101 Firefox/10.0.2 Iceweasel/10.0.2

edit:
Added update for new Browser Version.
Changed Title (added "Firefox 6").
edit2:
Added update for ffox 6.0.2.
Added link for testing.
edit3: (07.10.2011)
-Updated info for FFox 7.0.1
-Changed Title (added "Firefox 7").
edit4: (25.11.2011)
-Updated info for FFox 8.0
-Changed Title (added "Firefox 8").
edit5: (17.12.2011)
-Updated info for FFox 8.0
-new sub-update (debian-specific)
edit6: (03.02.2012)
-Updated info for FFox 9.0.1
-Changed Title (added "Firefox 9").
edit7: (06.03.2012)
-Updated info for FFox 10.0.2
-Changed Title (added "Firefox 10").

Sunday, May 29, 2011

External usb hdd WD Elements - avoid spindown

Update: I got a new workaound here: External usb hdd WD Elements - avoid spindown -- #2

I've got an external 2.5", 500G USB HDD from WesternDigital
- this one: http://images.google.com/images?q=WDBABV5000ABK-00.
Without being accessed, it spins down after 5-10s (seconds, not minutes!) automatically.
This behavior seems to be hardcoded in the hardware/firmware by WD and cannot be changed (if anyone knows better, please leave a comment). It can be very annoying, for example when starting a file manager or open a 'save as...'-dialog etc. because the hard drive has to spin up every time adding a delay of some seconds until the dialog appears. The same happens when reading or writing at a low speed (let's say ~ <10KiBytes/s) - the drive spins up and down multiple times a minute.

A dirty workaround is to keep the drive busy by touching and syncing in a short interval.

A quick way to do this via commandline:
while [ 1 ]; do echo "touch at - `date`"; touch /media/WD_500G_NTFS/tempfile; sleep 5s; sync; done
A bit nicer with the following script:


edit: inserted link to new post.

Tests with code and syntax highlighting.

Hello, this is my first blog entry and i'm just testing how to add code.
  • The 'Quote' option in the 'new Post' editor just indents the text block; one possibility is to change the font for the selected text block to e.g. Courier, a fixed width font, but of course there is no syntax highlighting.

There are some other solutions i found in the internet:

Below a simple shellscript example with http://gist.github.com/. Just copy&paste your code there, get the 'embed code', paste into the blogger/blogspot html-editor, done.
[EndOfFirstBlogEntry] - Woohoooo.