Wednesday, October 08, 2014
Sunday, July 06, 2014
It's awesome. It's basically Sichuan hotpot but without having to deal with a fire and a huge bowl of soup on your table. And ordering for one is easy. You choose your ingredients and 3 minutes later they bring you the cooked results. Unlimited rice included, all for 680JPY (4.90EUR)!
This time I went for 激辛, the highest on their spicy scale and it still wasn't that spicy. I might be getting the "foreigners don't like spicy" treatment, I don't know. I'll ask to go off the scale next time.
They also have awesome fried shaolongbao. These things are dangerous. They're dumplings, full of soup. Even when you think you've slurped it all out, there are still pockets remaining, hidden away, waiting to shoot a jet of boiling hot liquid up your nose when you bite down!
Sunday, February 16, 2014
My ISP in Japan (OCN) blocks port 25 outgoing. It provides a relay host smtp.blue.ocn.ne.jp but it drops things if they have a dodgy looking from address. So I set up a postfix rewrite rule to make all of my mail from this server look like it was coming from my gmail account. This seems to make OCNs SMTP relay happy.
In /etc/postfix/main.cf, I added
smtp_generic_maps = regexp:/etc/postfix/genericand that file looks like
Gmail thinks this is spam, so I had to set up a filter to automatically catch emails from myaddress+antispamtoken and mark them as not spam.
There are probably several better ways of achieving the same goal but the less I know about SMTP and MTAs the happier I am.
Sunday, January 12, 2014
A couple of weeks ago, my Nexus 7 went into the sink while I was washing up. Despite my best efforts, I couldn't save it. About a year ago, a colleague dropped his Nexus 7 and smashed the screen. He was kind enough to give me that old tablet this week.
Thanks to http://www.ifixit.com, swapping the screens was fairly straightforward. I actually made it harder for myself because I read their full teardown and peeled back a lot of sticky copper shielding that I could have just left alone if I'd noticed they had an article for just replacing the display. Anyway, those guys are awesome. I was able to fix the speaker in another phone last year because of them, go buy some of their repair kits.
Here's what the insides of 2 Nexus 7s looks like :)
Also, well done Asus for making it fairly easy for me and my fat fingers to do this.
If anyone needs any help attempting the same thing, let me know.
Monday, December 23, 2013
As much as the EU has its problems, it was an agreement among nations for nations, with nations retaining sovereignty (the Lisbon treaty introduced majority voting, so that's less true now). It has respect for human rights built in and its courts are, well, actual courts. It has a pretty good track record on delivering on human rights within the EU. I dread to think where Ireland and some others would be socially without it.
The TPP and TAFTA on the other hand, are agreements by nations to hand over some of their sovereignty to corporations and opaque tribunals. The WTO is already this to some extent but is actually about international trade. TPP and TAFTA go much further and impact the laws that can be passed inside countries based on the impact they would have on international investors operating inside those countries.
There are already treaties like this and the results are not good. The Australian govt is attempting to regulate tobacco packaging and is being sued by Philip Morris because it will hit their profits (http://www.bbc.co.uk/news/world-asia-15815311). Tobacco companies making less money is exactly the point of the law. If a government decides to hit tobacco companies and the existing courts are OK with that then that should be the end of it.
The idea that someone has a right to continue to profit from a harmful industry or to be compensated for their reduced profits is nuts. It warps the investment market. Right now, investments like this are risky and capital is allocated elsewhere as a result. These treaties remove these risks by forcing governments to compensate investors who have chosen to invest in industries that end up being regulated. This makes antisocial investments more attractive.
TPP and TAFTA are more of the same, just bigger and stronger. They are being negotiated in secret with only a corporate interests represented. Some parts have been leaked, they are not nice.
You can read an American perspective on TPP here:
This article is about opposition in Japan:
If either of these passes, the other will become much more likely ("we have to follow the international standards, don't you know").
They both need to be shot down.
Saturday, July 06, 2013
I have many static files that I care about, e.g. photos, downloaded media, media that I've ripped, archives of old email, important documents. They are mostly mirrored on 2 disks but it's a bit of a mess. For some I do extra backing up, e.g. photos are supposed to end up in the cloud too. A few other things are backed up to a virtual server but that's even less systematic. Some things are over-backed up, they exist in a RAID and also on my media player disk and on a physical DVD. That's a waste of space. I don't want to have to think about any of this (at least not more than once - at the time I decide I want to be careful about a file).
I'm not trying to solve the general backup problem, this is pretty much for files that do not change once written (although their metadata or importance may change).
I want to be able to do something like
absorb --tag personal-documents --delete-when-safe tax-return-2013.pdfand in a few seconds, there's a RAIDed copy on my home server and a copy in Google drive, another in Dropbox and that working copy is gone, not cluttering up my laptop anymore.
Does this exist already? It's not just backup, it's part "document management" and there's lots of stuff I'd like to be able to do with tagging, managing, presenting, sharing but I'd settle for a partial solution that I don't have write myself for now. I can't find anything suitable but thought I'd ask before putting any effort in.
Tuesday, June 25, 2013
My job often involves running a command to do something, realising that it's going to take longer than I expected and going doing something else in the meantime. Conversely I'll run something that should take a long time, go do something else and find that it stopped with an error after a very short time and I didn't notice.
For a long time I've wanted to set things up so that any command that takes more than 20s to run would send me an IM when it was finished. What I didn't want was to have to prefix all my commands with some notification because that's annoying and I would probably forget in exactly the cases I need it.
It sounds pretty simple but getting it work turned out to be quite fiddly.
Delivering an instant message.
There's a program call sendxmpp that will deliver an instant message over XMPP. It's written in Perl and definitely works on Linux but probably also Mac and Windows if you really want. Every few months I would try to make it work and when I finally got it working, it would stop working again the next day.. Apparently Google's XMPP service is particularly finicky. I appear to have made it work for real now. I honestly don't know what I did differently, it may even be something that changed when Google deprecated XMPP in favour of Hangouts. As I write this, I see that it no longer works for one of my accounts but it's working fine with another! If there's a more reliable option, I'd love to know.
To make this work you'll need a second Google account because sending a message from yourself to yourself doesn't seem to work. So I created an account that I'm going to use only for sending IMs. After creating that account, I invited it to chat and made sure that the accounts can chat with each other through the normal Google chat interface.
Next I created a config file for it with the following commands (you'll need to replace some parts of the last one)
Now to send a notification to myself I just doecho some message | sendxmpp -t -u my.new.im.username -o gmail.com email@example.com
and the message shows up. I also get a bunch of Perl warnings but such is life.
Finally I wrapped that up as a command called notify and I can just pipe a message into that.
Spotting that a command is taking a long time to finish
I hate unix shells, they're a horrible mishmash of special cases, obscure features and crap that's only that way for backwards compatibility. What I've done is a hack in bash and it's not perfect (it seems like it would be slightly less hacky in zsh but that wouldn't fix the oddities described below). The core is this
What that does is run bash_pre_cmd every time you hit enter to kick off a command and bash_post_command every time it prints the command prompt (which indicates that the command has finished, although there are various way for this not to be true, hence the oddities but in normal usage it's true). So all that remains is sensible definitions for those two commands
You'll probably want to customize the callback for your own preferences.
Put all that into your .bashrc and cross your fingers
If you suspend a process, that will cause the prompt to be printed and may cause a notification. If you unsuspend that process with fg then when it finishes, this code will see fg as the command that just completed. Also, we cannot notify for 0 seconds otherwise just hitting enter would cause notification and the IM would refer to the last command in the history. Interactive commands obviously take a long time and so cause useless notifications. I'll probably whitelist a few common ones like man and less. There are probably some problems too but for normal type-run-complete shell use it works just fine.
Basically shells are shitty and not very flexible. Doing this correctly would involve being able to stash away some state along with each command that's started then getting access to that state when the command finishes, it would require changes to shell.
Friday, June 14, 2013
Saturday, May 04, 2013
I got a one of these
When it checked for firmware upgrades it found "220.127.116.11.260" but that would not connect to OCN no matter what I did. In the end I noticed that "18.104.22.168.270" was available, installed that and OCN worked immediately.
No special settings needed, just username and password.
Sunday, February 17, 2013
There is a rickety wooden fence pulled in front of the trucks but the 1000s of Euros of wood and who knows what else they sell is sitting right out there with no security whatsoever. How is this possible? It's not a busy street and they don't close it up any further at night time.
A few theories:
- They are paying the right people and criminals know they'll lose a finger (or more) if they try stealing from it? Or maybe they are the right people.
- There are actually no criminals in Japan. This can't be true, otherwise there'd be nothing to blame on immigrants :)
- The police are incredibly vigilant and effective...
- There is no market for stolen building materials.
Is there anywhere else in the world you could do this and expect to find everything still there on Monday morning? Switzerland?
Monday, January 07, 2013
Posting this because I spent far too much time figuring this out from various scraps here and there. I got a bunch of Japanese DVDs recently and ripped them to mkv. As part of learning Japanese, I want to be able to see the subtitles side by side, and use them in flash cards etc. I found recipes for extract subs from a DVD but it's not quite right for mkv. I also found tools that worked except but output distorted images.
There is also the very impressive subs2srs which will generate an anki deck with images and audio snippets and it works under wine but it actually is a little bit heavy for what I want.
First, you need to know what track has your subs.
mkvinfo will tell you that. Then after that you can use the following bash script (you'll need to install
You can invoke it as e.g.
extract.sh foo.mkv 4 and you'll have a bunch of
.png files generated from the 4th track of
foo.mkv in the
foo-sub-4/ directory. There will also be a
.srtx file which gives the timings for all the subs.
My next step will be to use these timings to line the subs up and output a HTML page with them side-by-side.
Saturday, January 05, 2013
I saw several people watching him, a couple of people following him on the ice and videoing him(!) and at 1:05 in the longer video, there's someone mimicking him.
Friday, January 04, 2013
Of course the story (and their attempted change to the copyright law in 2012) has not been covered at all in these papers.
Meanwhile one of the major papers carries an article titled, "Venomous and toxic social media out of control" which includes this gem: "Free speech and democracy are far better served by a regulated system of commentary, which insists on basic civilities, foremost among which is that participants identify themselves before contributing."
Right, good one, this regulated system is right now demonstrating that it cannot be trusted to report fairly and accurately (or even at all) on certain subjects - the internet and copyright law being two rather important ones.
Of course I'm not linking to this article or even saying what newspaper, not because I'm afraid of a bill but because I have no intention of ever sending another bit of traffic to one of these newspapers if I can avoid it.
Friday, December 28, 2012
Saturday, November 10, 2012
So I asked him, "can you think in your head?". He got a look of intense concentration for about 20 seconds, kind of like constipation and finally said, "no". But he tried really hard!