Duck gizzard salad, the Yoz-way

Since the last recipe was for a burger, let us make something healthier. Like a salad. However let us make it tasty as well, like by adding a pint of fat.

Ingredients

  1. Mesclun
  2. Duck gizzards
  3. Tomatoes
  4. Västerbottensost (Swedish cheese)
  5. Cashew nuts
  6. Salt
  7. Pepper

Preparation of ingredients

Wash the salad, dice the tomatoes (wash them first, eh). Dice the cheese.

If your duck needs to be heated in bain-marie do so. Cut the meat to smaller pieces (keep the fat).

Cooking

Heat a frying pan. Use the fat from the duck to grease it. Throw the duck and cashew nuts in. Salt, pepper and stir for a bit.

Take a salad bowl and throw everything in. Mix vigorously.

Afterword

Making salad is easy. Just take anything you have in the fridge and throw it into a bowl. The more colors the better.

duck-salad

The almighty Yozburger

Hunger strikes again! And best remedy for hunger is food! And best food is… burgers!

Ingredients

Possibilities are endless but decisions have to be made. Usually I put this into a burger, but feel free to add whatever you like.

  1. Hamburger bun (big one)
  2. Beef burger
  3. Bacon
  4. Cheddar cheese
  5. Egg
  6. Tomato
  7. Onion
  8. Lettuce (or Chinese cabbage)
  9. Salt
  10. Pepper
  11. Brown sugar
  12. Pork fat

Preparation of ingredients

Slice the onion to stripes. Slice tomatoes to circular slices. Cut the lettuce to smaller leaves.

Cooking

Start of by melting the fat on a pan. Put the bacon in and pour brown sugar over it to make candied bacon.

yozburger

Remove the bacon, salt and pepper the burger and put it on the pan (use the same pan for everything). When the steak is almost done (rare) put the onions and tomato and lettuce in. Also start frying the egg (and salt it a bit). It is important to cook the onions, lettuce and tomato in the same oil as the bacon and the burger. If you do not have enough place to put everything into the pan then cook what you must after you have removed the burger.

Start assembling the burger. From bottom I usually do : bun, cheese, onions, tomato, burger, cheese, onions, tomato, lettuce, egg, bun. Refer to the diagram for more precise information.

Secret knack : after I finish assembling the burger, just before putting the egg in I pour all of the oil from the pan into the burger. This serves as the best sauce you will ever have and this way you will avoid using unhealthy sauces like ketchup or mayo.

Final word

No words are necessary, just look at the beauty!

yozburger-photo

Best editor for Chinese text on Mac

I have spent some time (like an hour or so) looking for a good editor for Chinese script on Mac OS X. To my surprise most of what I have tried sucked in one or more ways.

Competitors

Of course, I have started with the editor I use to edit plaintext daily - iA Writer. For once, I have said to myself, the humongous font this editor uses would be very useful. Sadly, iA Writer uses the default OS X font for chinese. This derivate of Heiti is quite broken and many glyphs are wrong (this was pointed out to me by a native speaker). Also, line height of lines with chinese characters is weird, and it changes depending of the presence of non-chinese characters in it (including blank space). I have reported the issue to the authors and it was acknowledged so there might be a different font used in future versions… we will see.

So my first choice did not work out. No worries, there are plenty other editors to check. My second choice was MacVim, which is the best invention since sliced bread. The experience was very poor. The insert mode works well, as expected, however the normal mode hates IMKQIM input method. It would seem that Vim was not meant to be used with other than standard input methods, which is understandable.

Moving on. Since alternative software did not work out I tried the native solutions. TextEdit is usually a very good text editor, if you do not need any features. When writing immediately (in plain text mode), you will run into the same problem as with iA Writer : horrible font. You can change the font for plain text mode, of course, but you have to choose the right one. STSong is a good choice, with other fonts you might run into problems with line heights (as some fonts miss some glyphs). Fraise suffers from similar problems.

I have also tried Pages, it works really well, with the right fonts. Line heights are always OK. But it is not a plain text editor, and it has all the downsides of a text processor with hundreds of options.

Conclusion

Finally, I ended up with yet another editor. I have dug up the rusty FocusWriter which I have abandoned previously to iA Writer. The possibility to switch themes makes it a good choice for different scripts. My choice was the 华文细黑 font. Best of all FocusWriter is available on all platforms, so I just use that on Linux as well.


Edit 2015-10-18

iA Writer no longer has the aforementioned problems, at least in OSX 10.11

Cannot be unseen

On my trip to London I have stumbled upon a bridge with a curious design of the cable holding contraption.

Once seen, this cannot be unseen. Well, at least it gives an interesting picture. Would be probably better in worse weather though.

cannot-be-unseen

Carbonara Supercharge

When you are dying of hunger you need to swallow something with a lot of calories of all sorts (just in case), and you need to do it fast. This is a ten minute recipe for delicious pasta with enough fat to give you a minor heart-attack.

Today we are cooking a spinoff of spaghetti (or whatever, all pasta tastes the same) carbonara.

Ingredients

ingredients

You should always have these around in your house anyways, but maybe you will have to add 10 minutes for shopping

  1. Pasta (I use spaghetti or penne)
  2. Sliced bacon
  3. Liquid cream (or any other, actually)
  4. Parmesan cheese
  5. Emmental cheese
  6. Canned sliced mushrooms
  7. Egg
  8. Onion
  9. Bonus: White Wine

Preparation of ingredients

Nada. Well, open the can of mushrooms at least. Oh, and dice the onion.

Cooking

Depending on your pasta you will have to start cooking it at some random moment during the cooking of the sauce. Or you can just cook it after sauce is ready, it can wait, the pasta can not.

Start by frying the onions in a pan. Once they are ready put in the bacon. Cook until the bacon changes colour and add sliced mushrooms. Cook for like a minute and then add some cream. Afterwards add some cheese (either or both), not too much, and cook until it disolves. If you are rich enough add a spoonful or two of white wine into the mix now. Repeat the previous step until you think you have enough cheese in the mix. Cook for a bit. Now put in the egg and stirr furiously.

Voilà! Dinner is ready.

finished

Fix the home and end keys in Firefox with Keyconfig and Vimperator

Somme funny man thought that it would be good to screw up the behavior of home and end keys in firefox on Mac. Nobody knows why and everybody is complaining. Also, the same genius have made the ⌘→ and ⌘← commands navigate in history instead of doing what they do in every other application which is “move to the end or beginning of the line”.

Oh well.. Luckily there IS a solution for this. The extension keyconfig will fix half of the problem. Get the keyconfing extension here and disable the incriminating keys. Many thanks to the author. Now you have working command keys. As for the home and end key, I fixed my problem in vimperator, since it is an extension I use on all of my firefoxes. Basically the idea is to remap home and end (along with +shift variants)) so they fire off the command+arrow commands. Here is the code, enjoy :

imap <Home> <M-Left>
imap <End> <M-Right>
imap <S-End> <M-S-Right>
imap <S-Home> <M-S-Left>

Either run it in the vimperator command line and do a :mkvimperatorrc! or put it directly into your configuration file.

Creating a document management program that actually works - Part 1

I have tried several document management programs, applications, systems - whatever you want to call them. Finally I have decided to abandon all of them for a bunch of folders, which is not exactly ideal. Thing is, I really like working with libraries rather than the filesystem itself. It is much more convenient, but also brings a lot of crap to the house. You can not really move a library, if it is in a binary form you will have hard way synchronizing it over several computers (YES! I want my files in Dropbox).

I have decided to make a document management system on my own. I have currently no idea how will it look in the end, because I do not know yet about what I want it to do. Nevertheless I will rant here for a while and maybe some day I will find out on how to do this thing right.

What should a good document management system do?

There are many things a document management system should do, but there are even more things it should not. There lies the problem with most of the applications.

As an example of a good library manager I would cite Amarok, Quodlibet and iTunes (the latter only for the music collection).

  • While using the application you do not have to worry about where the files are, what is their format and stuff like that. When you are not using the application you can, however, navigate in the files easily.
  • The metadata is actually saved in the documents (id3 tags, for example) so even if you lose your library (the database), it is very easy to reconstruct. (quodlibet does not use any database whatsoever)

As examples of bad document managers, let us have a look at iPhoto or Evernote.

  • The files are saved “somewhere”, there is no way of poking into the file structure of the application database without breaking something.
  • They provide a lot of features, which is good, but there is no way of adding some. If you use an external application to edit a photo in iPhoto library you are losing most of the features : the new version is not linked to the original, no way to revert back, no nothing.
  • If you lose your library then reconstructing it all over again from the originals is a huge pain in the ass.
  • Some things you would be able to do with vanilla files are no longer an option.

Basically what I am trying to say is that while a good management system should not require you to use the filesystem in any way, it should use it in order to get things done. There is no need to reinvent the wheel here.

Push irssi away messages to your iPhone

Using irssi for IRC is quite a must. Add some bitlbee sweetness and you have everything you need for your instant messaging needs. With a handy ssh application like iSSH you will get to a cyborg state when you are always connected. Small problem arises when compared to other IM applications, like IMO, that is that there are no notifications available and you will probably miss a lot of conversations. Fear not, however, for there is a solution for every problem.

Push notification application

First, you will need an application to get any push notification to your phone. There are several of them, I would recommend using the Push4. There is a free version if you want to test it first. Once you have installed it and created an account go to your account settings on your website and go to My Account -> Settings -> Profile to get your API key. You can also make the application send you an e-mail with the key.

Some scripting

You will need to make two scripts to send the notifications. (You could manage with less, of course, but I am too lazy). First one is a bash script which uses curl to send a notification to your phone. Here it is :

curl -d "user_credentials=YOUR_API_KEY" \
 -d "notification[message]=$1" \
 -d "notification[long_message]=$2" \
 -d "notification[title]=New irssi notification" \
 -d "notification[subtitle]=irssi message" \
 -d "notification[long_message_preview]=$1" \
 -d "notification[message_level]=2" \
 -d "notification[silent]=0" \
 -d "notification[action_loc\_key]=OK" \
 -d "notification[sound]=1" https://www.appnotifications.com/account/notifications.json

Do not forget to replace the YOUR_API_KEY by your real API key.

You can test the script immediately, although it might not work for a few hours just after your Push4 account creation. Basically this script sends you a notifications with first parameter as short text preview and second as a long text (which can use HTML markup). A second script is needed to parse the awaylog and send notifications using the first script.

#!/usr/bin/perl -n use HTML::Entities;
if (/(\d+:\d+) (?:([#&][^ ]+)+:)?.*?\/.*?\/(.*?).g.8.*?e(YOURNICK: )?(.*)/) {
    $time = $1;
    $channel = $2;
    $sender = $3;
    $message = $5;
    $message =~ s/\\/:/g;
    $message =~ s/"/\\"/g;
    $message =~ s/[;&]/:/g;
    print `./irssi_notify.sh "$sender : $message at $time" "Message from <b>$sender</b> (<i>$channel</i>) at <b>$time</b> : $message"\n`;
}

Now, to clarify things a bit. What this script does is that it takes some input, and if it is in some format, /(\d+:\d+) (?:([#&][^ ]+)+:)?.\*?\/.\*?\/(.\*?).g.8.\*?e(YOURNICK: )?(.*)/, to be precise, it will parse it and send it via a notification. Note that this works if you did not play with your irssi theme too much, as the awaylog basically copies the format of public and highlight messages. The (YOURNICK: )? part is optional, and it helps to remove the usual prefix of highlight messages. I can not help you much with the regex, you have to find one on your own or you can use this script which basically takes anything in awaylog and sends it as it is (it works well and everywhere).

#!/usr/bin/perl -n use HTML::Entities;
$message = encode_entities($_);
$message =~ s/\\/:/g; $message =~ s/"/\\"/g;
$message =~ s/[;&]/:/g; print `./irssi_notify.sh "$message" "$message"\n`;

Making it all work

Let us run the machine now. You will need to start another screen to run this (if somebody will help me with making a nohup version of the command I will gladly have it). Run a terminal on your shell and run

screen bash tailf ~/.irssi/away.log | perl irssi_notify.pl

Now detach the screen and you are on the roll.


Edit 2015-10-17

The Push4 service is no longer available. I am currently using a solution that uses Pushover. I’ll write up an article on how to use that shortly.

Autocopy links of files uploaded to Dropbox public folder with a folder action

This tutorial is largely based on this post on the Dropbox forums, all credit on the script goes to the original author Christian G. My contribution is that this script also invokes a Growl message (thus, you will need Growl installed) also, the # character is replaced by %23 (because Dropbox does not like it much) Here goes the script :

on adding folder items to this_folder after receiving added_items
    try
        set the item_count to the number of items in the added_items
        if the item_count is equal to 1 then
            set theFile to item 1 of added_items
            set theRawFilename to ("" &amp; theFile)

            set tid to AppleScript's text item delimiters
            set AppleScript's text item delimiters to ":"
            set theFileName to (text item 6 of theRawFilename) as text
            set AppleScript's text item delimiters to tid

            set theWebSafeFileName to switchText from theFileName to "%20" instead of " "
            set theWebSafeFileName to switchText from theWebSafeFileName to "%23" instead of "#"

            set theURL to "http://dl.dropbox.com/u/YOUR_DROPBOX_ID/" &amp; theWebSafeFileName
            set the clipboard to theURL as text

            tell application "GrowlHelperApp"

                set the allNotificationsList to ¬
                    {"Public URL"}

                set the enabledNotificationsList to allNotificationsList

                register as application ¬
                    "CopyDropboxURL" all notifications allNotificationsList ¬
                    default notifications enabledNotificationsList ¬
                    icon of application "Dropbox"

                notify with name ¬
                    "Public URL" title ¬
                    "Dropbox Public Folder Updated" description ¬
                    (theURL &amp; " copied to clipboard.") application name "CopyDropboxURL"

            end tell
        end if
    end try
end adding folder items to

to switchText from t to r instead of s
    set d to text item delimiters
    set text item delimiters to s
    set t to t's text items
    set text item delimiters to r
    tell t to set t to item 1 &amp; ({""} &amp; rest)
    set text item delimiters to d
    t
end switchText

How to use this

First of allyou have to know your Dropbox user ID and change the YOUR_DROPBOX_ID to it. This is the number that appears after /u/ in your public Dropbox links. Now open the apple script editor and save this script into

Macintosh HD/Library/Scripts/Folder Action Scripts as CopyDropboxURL.scpt. Next navigate to your Dropbox public folder in finder, right click (or ⌘-click) it. Choose Services→Folder Actions Setup… from the menu. In the menu that opens choose the CopyDropboxURL.scpt.

Beijing Soup

I’ve been searching for this recipe for quite a long time. Finally I got hold of it thanks to my brother. And due to popular demand here is the recipe complete for one of the best soups out there. So… without further delays.

Ingredients

  1. One whole chicken
  2. Shiitake mushrooms (dried)
  3. Black mushrooms (dried)
  4. A carrot
  5. Bamboo sprouts
  6. Two eggs
  7. Soy sauce
  8. Rice vinegar
  9. Sambala sauce
  10. Tapioca starch
  11. Salt
  12. Whole black pepper
  13. Chicken bouillon cube

Preparation of ingredients

Hint : I recommend reading the whole recipe first as some of the steps can be done at the same time.

It is best to begin by dipping the mushrooms in warm water (shiitake and black mushrooms separately) as it takes about 30 minutes for them to soak well. The longer the better. After they have soaked cut the shiitake to small pieces.

Cut off the legs and breasts of the chicken, put them aside we will not be needing them for this meal.

Clean the carrot and cut it to small pieces. Cut the bamboo sprouts as well.

Crack the two eggs into a bowl and scramble them.

Cooking

Heat about 1.5L of water, salt it, put in a dozen of grains of the whole pepper and put the chicken inside. Cook for about 45 minutes.

Take the chicken out and put the bouillon cube as well as the mushrooms (both), carrots and bamboo sprouts inside.

Cut off all of the meat from the bones of the chicken and put it back into the soup (the meat, not the bones).

Cook for about ten minutes, then add two table spoons of vinegar, three table spoons of soy sauce and two spoonfuls of Sambal sauce (or more, if you wish the soup to be more spicy).

Cook for another 10 minutes, afterwards add in the eggs and stir well. Finally prepare two spoons of tapioca starch in a bowl - add a bit of water and mix until all of the starch has diluted. Then add the mix to the soup. Cook for about 10 minutes and you are done.

Afterword

img-soup

The soup is to be eaten very hot. If you do not have chicken you can use more bouillon cubes instead (still, it is much better with real meat).