Tuan Anh Tran I make computers and phones do things

Filco Majestouch 2 Ninja Italian Red (TKL) review

This is a short review of a Filco Majestouch 2 Ninja TKL (Italian Red version). I ordered mine from eBay and the keyboard arrived 3 days later. The keyboard came with some additional keycaps (WASD and Escape keys in red and black) and a keycap puller.

First impression

This thing is sexy as hell. This was one of the main reason I purchase this board to begin with.

The case feels really sturdy. Let me put it this way: the HHKB case is very solidly built, this keyboard’s case is even better. That’s how good it feels when you hold the keyboard.

There’s no backlit, media keys, OS X friendly keys (can be solved with software), usb hub built-in or detachable cable. Some of those are nice features to have but not essential to me. I personally hate backlit and think it’s to gaming-y. I bought this board because it’s a simple, no bullshit keyboard. Overall, I’m very satisfied with the aesthetic of this keyboard.

The switches

I went with the blue switches option. It’s my personal favorite choice of Cherry switch. One downside as you probably already have already known is this thing is really loud. I mean REALLY loud. If you want to make your colleagues secretly hate you, buy one of those blue switch mechanical keyboard.

The keycaps

The default keycaps look pretty good and it matches well with the whole design. I’ve always wanted a set of Dolch or Granite keyset but I don’t think it’s going to look good with this board. I haven’t have the luxury of trying them out yet though.

There were reports of fading key labels with other Filco’s keyboard so they release this keyboard with front face printing keycaps. I think it’s a lame reason but it looks pretty cool though.

For this keyboard’s price range, it should have shipped with thick PBT keycaps instead of coated ABS.

Conclusion

This keyboard is a simple, no-bs, very high quality keyboard. I love everything about this keyboard: the look, the feel and the sound. Though it’s a bit more expensive than the competitors’ keyboards, it’s totally worth it IMO. The fact that it is sturdier than a premium keyboard (HHKB) says it all.

It’s probably the best TKL keyboard with Cherry switches available right now.

Filco Majestouch 2 Italian Red (TKL) with blue switches

My latest addition to my keyboard collection: an Italian Red Filco Majestouch 2 (tenkeyless version) with blue switches.

It’s really hard to find a shop with Filco in stock here in Thailand. I could only find one with black switch in stock, which I am not a huge fan of as it’s the linear type with no tactile feedback and too stiff for my taste. Other shops mostly stock Razer, Rocco, SteelSeries and Ducky.

I was a bit hesitate at first with this purchase because I thought this board uses red switches (which is like black but less stiff) but turn out, it comes with blue one which is my favorite.

The keyboard comes with a keycap puller and some alternative keycaps: WASD cluster, 2 windows key and an Esc key, all are in red.

My next step is waiting for someone to sell their sexy SP’s Dolch (or Granite, or both :D) keyset to go with this board. In the meantime, this stock keyset probably will do just fine.

How to find table name when knowing column name and column value in Oracle

A tester in my project asked me today for a little help: how to find a list of tables that has column name A with value B. So I wrote a short script and sent him. I thought I would share it here too, in case if might be useful to someone.

Usually cases like this, you will query from user_tab_cols or all_tab_cols for list of tables that has a column with that name and find out.

The query below will do exactly that but with the loop added to make searching easier. Make sure you have DBMS output enabled.

declare
  col_name varchar2(100) := 'COLUMN_NAME';
  search_value varchar2(100) := 'COLUMN_VALUE';
  cnt number := 0;
  cursor c is select distinct table_name from all_tab_cols where upper(column_name) = upper(col_name);
begin
  for e in c loop
    cnt := 0;
    execute immediate 
      'select count(' || col_name || ') from ' || e.table_name || ' where to_char(' || col_name || ') = to_char(''' || search_value || ''')'
    into cnt;
    
    dbms_output.put_line('Found ' || cnt || ' record(s) in ' || e.table_name);
  end loop;
end;

Sample output:

Found 0 record(s) in TABLE_NAME
Found 1 record(s) in TABLE_NAME1
Found 0 record(s) in TABLE_NAME2

Some useful use cases for Java Reflection

While most will recommend you not to use Reflection because:

  • Lose ability to refactoring because you hard-code the name of class/method as String.

  • Lower runtime performance,

  • No compile time safety check.

However, there’re many cases Reflection can become very useful that it pros might outweight its cons. Or it’s just cool to show colleagues some new cool tips.

Easier to implement toString() method for debugging

You can use Reflection to loop through an Object’s attribute and print it out instead of using StringBuilder to append it yourself. This feature is available in Apache Common Lang. Or you can write it yourself if all you need is this method.

public String toString() {
  return ReflectionToStringBuilder.toString(this);
}

Note: This is actually not used often because modern IDE(IntelliJ, Eclipse, NetBean, …) already has ‘generator’ for this kind of thing.

Create object/call method using name

This is one of the reasons why Reflection exists in the first place. It’s useful in case like you have some configuration stored in database and you want to create object using class name (e.g.: like building cache using class name and table name on startup).

Or another case would be like: You get tired of calling .add for BigDecimal so you write a function to sum it up, taking an ArrayList of BigDecimal as parameter. But it’s not convenient because in reality, you have object of other data type and you will have to create the ArrayList of BigDecimal by looping through the collection. This is when Reflection comes in handy. You can use Reflection to create a function, passing a collection of anything and a method name to get the BigDeicmal value out.

@SuppressWarnings({ "rawtypes", "unchecked" })
  public static <T> BigDecimal getSumBigDecimal(ArrayList<T> bcArr, String methodName) {
    BigDecimal sum = BigDecimal.ZERO;
    if (null != bcArr && bcArr.size() != 0 && !StringUtil.isEmpty(methodName)) {
      try {
        T firstItem = bcArr.get(0);
        Class klass = firstItem.getClass();
        Method method = klass.getMethod(methodName);

        for (T each : bcArr) {
          BigDecimal bc = (BigDecimal) method.invoke(each);
          sum = sum.add(bc == null ? BigDecimal.ZERO : bc);
        }
      }
      catch (NoSuchMethodException | SecurityException | IllegalAccessException
          | IllegalArgumentException | InvocationTargetException e) {
        // do what you must here, I'm catching because it's an example
        e.printStackTrace();
      }
    }
    return sum;
  }
}

Reflection is cool and all but please use it with care. Make sure the pros outweight the cons. Know what you’re doing.

Poker 2 keyboard with Granite and Dolch keycaps

I’m thinking of getting a Poker 2 keyboard and a Granite keycap set just for the sake of looking at “her”. She’s so beautiful, it hurts.

Poker 2 keyboard with Granite and Dolch keycaps
1 - Poker 2 keyboard with Granite and Dolch keycaps - credit of SpaceCadet2000
KBParadise V60 Mini keyboard with Dolch keycaps
2 - KBParadise V60 Mini keyboard with Dolch DSA keycaps/RGB modifiers - credit of SpaceCadet2000

My current favorite keyboard is the Laptop Pro with the Matias Silent Switch. It’s so fun to type on though I prefer the shape of the HHKB Pro 2. The downside of HHKB Pro 2 is the lack of supply for novelty keycaps. Poker 2 is the closest thing to HHKB’s form factor at the moment I believe. Plus, there are plenty of novelty/custom keycaps made for MX Cherry including the beautiful, gorgeous Granite keyset above.

Poker 2 is currently available for around $110 on mechanicalkeyboards.com. Used one goes for around $60. Granite keyset will cost another $120-$130, makes it a total of $240 for a new one and $190 for a used one. For reference, it costs 1 HHKB Pro 21

Totally worth it for such beauty IMO.

  1. I got mine through a Japanese proxy call WhiteRabbitExpress. They quoted me $220 for the keyboard (shipping included) and $20 for their proxy service, which is very reasonable I believe.

Force Safari to refresh website's favicon

Force Safari to remove its website’s favicon database by issuing this command in Terminal.

rm ~/Library/Safari/WebpageIcons.db

How to setup your VPS as a seedbox in under 15 mins

Zero (well, almost) Linux knowledge required!!!

This script is not mine. I just stumbled upon it and found it rather useful. If you are afraid about malicious script, you should download and verify it yourself.

This script will setup basically everything you need for a seedbox from thin client, web ui as well as FTP.

All you need to do is logging in and copy, paste these commands below, answer a few questions, then wait.

wget https://raw.githubusercontent.com/SeedboxCreator/SeedboxCreationScript/master/seedbox-setup
chmod +x seedbox-setup
./seedbox-setup

Read and follow the instruction. The installation instruction is very straight forward and easy to understand. Upon finish, the setup script will also print out the information about web url, FTP address, etc… Note it down somewhere if you’re not sure.

I’ve tested this with Ubuntu 14.04 x64 on DigitalOcean and it works flawlessly. It should work on any other VPS as well.

Looking for a VPS provider? Check Hetzner or OVH out. RamNode is also good if you’re looking for a low cost VPS provider. For $15 a year, you can setup yourself a rather decent seedbox.

rutorrent
Fig.1 - ruTorrent web ui upon finished

LaunchRocket

A Mac PreferencePane for managing services with launchd/launchctl. LaunchRocket was primarily created for managing various services installed by Homebrew, though it should work with most launchd-compatible plists.

A poor man's seedbox for $15 a year

Seedbox is basically just a server with torrent client installed. A seedbox usually goes for $15 a month for a decent one and $7 a month for a cheap one. It’s rather easy to setup a VPS as a seedbox and save yourself some money.

I have a pretty good experience with RamNode. In fact, I’m running my website on one of their VPS right now. Though it’s cheap but it’s actually more than what I need for my static website.

For $15 a year, you will get 80GB of space/500GB bandwidth monthly, 128MB RAM and 100Mbps ethernet, which is ok if you’re just a casual torrent downloader like me. If you’re looking for more, I suggest you take a look at Hetzner or OVH.

Get a VPS at RamNode

Sign up for the massive plan (cheapest one) for $15 a year and select the geolocation closeast to your location. There are 4 datacenters that you can select from which are NYC, ATL, SEA and NL. Also, select Ubuntu 14.04 64bit as OS for the sake of this tutorial. Enter your domain if you have one. If not, you’re going to access to your seedbox by IP address.

I got myself one at Atlanta and the speed is very decent from Thailand.

download speed from seedbox

RamNode will send you an email with the VPS’s login information few minutes after signing up.

Connecting to your VPS

If you’re on Linux or Mac, ssh is pre-installed and ready to use. To connect on Mac/Linux, use the command below. Enter password when asked.

ssh username@ip-address

If you’re using Windows, you need to download a SSH client to connect to your VPS and set it up. PuTTY is a decent one.

Open PuTTY, enter IP address you get from the email and click open. Enter username and password you get from the email.

PuTTY

Now if you’re panic about server’s security, you can go ahead and follow this tutorial to add a few extra layers. As for me, I usually just installed fail2ban, disable login by password, and using public key authentication only.

Installing deluge and deluge-web

I’m going to ignore all the security practices so that this tutorial can be as simple as possible. I’m assuming you’re still using root account for now.

Copy and paste the commands below, press Y when asked. These commands will update/upgrade to lateast package and then install deluge, deluge-weband nginx. Append sudo if needed.

apt-get update
apt-get upgrade
apt-get install deluged
apt-get install deluge-web 
apt-get install nginx

deluge is a torrent client, deluge-web is deluge’s web interface for easy management and nginx allows you to download files to your computer.

rtorrent is another decent torrent client (better web ui, lower memory footprint) but requiring a bit more work to setup it up and running. Also, you can setup FTP and download your files using FTP instead of direct HTTP. I choose direct HTTP simply because I have nginx server already installed so less work for me. You can also secure your public folder in nginx by following this tutorial.

Once finished, start deluged and deluge-web.

service nginx start
deluged
deluge-web --fork

You can access your deluge-web at your seedbox’s IP address, default port 8112 with default password deluge.

Now, in order to download your files from seedbox, you will move the download folder of deluge into nginx www folder. For example: downloads folder (/usr/share/nginx/www/downloads). Your files will be accessible at http://ip-address/downloads.

If you hit any problem, feel free to drop me an email or tweet me at @tuananh_org. I’ll be happy to help.

Update: I added a blog post for those who doesn’t want to tinker much with command line.

Download accelerators, managers for Mac

Maxel - $7.99

This is my favorite download accelerator by far. I usually do a lot of torrenting on my VPS and download them later via direct HTTP. I just need some basic features of a download accelerator. Heck, axel was working well enough for me, except the part that I have to manually parse the link1 to it.

Maxel offers Safari/Chrome extension (Firefox is currently in beta-testing phase) and they are quite good. You can select some text on the website and right click -> Download selected links with Maxel. Maxel will identify the selected text and filter out the links for you. This is what make Maxel a little better than Fat Pipe below.

Maxel doesn’t offer speed control but it’s on checklist of the developer.

Fat Pipe Downloader - Free

Another decent download accelerator, Fat Pipe is very similar to Maxel above in term of features. I find it a bit unstable and the browser extension is less convenient than Maxel.

Fat Pipe is currently (as of this post) free on Mac App Store.

Folx - $19.99

Some notable features:

  • Tagging system
  • iTunes integration
  • Scheduling
  • Speed control

Offers more features than most. More expensive than most ($19.99). The app can download torrent files as well as creating it. Though, if you’re using a private tracker, there’s a fat chance that the app is not white-listed. None of the private trackers that I use (WhatCD, BTN, PTP, etc..) whitelist Folx.

SpeedTao - Free (beta)

SpeedTao is currently in beta (for quite awhile now). SpeedTao also support torrent download but struggles with the same problem of private trackers as Folx.

SpeedTao has an unique feature: remote download, which allows you to add transfer to a remote machine via iCloud or Dropbox.

Personally, I don’t really like SpeedTao because the app seems like an abandonware already.

iGetter - $25

iGetter is feature-rich, works fairly well except the interface looks like it was made in the 90s. Between iGetter and Folx, I’d say go with Folx. Call me cheap but I don’t want to pay $25 for a software that was last updated over a year ago.

Conclusion

I pick Maxel simply because I don’t need more features than that. Your mileage may vary. Maxel does one thing and does it very well for me.

  1. I wrote a small bash script to parse a file contains a list of links, new line seperated to axel and let it download one by one.