Skip to content

You know you want to….

1) Plug in antminer

2) Install software

# Get BFGMiner
git clone git clone
cd bfgminer

# install deps
yum install uthash jansson jansson-devel libevent-devel ncurses-devel

# build it
./configure --enable-bfsb --enable-scrypt

# run it
bfgminer -o stratum+tcp:// -O

3) Run software

./bfgminer -S antminer:all -o -u YOUR_POOL_USERNAME \
-p YOUR_POOL_PASSWORD --set-device antminer:clock=x0881

Clock frequencies are as follows:

Hashrate antminer:clock
1.6GH/s 0781 (DEFAULT)
1.8GH/s 0881
2.0GH/s 0981
2.2GH/s 0A81


Based off these tutorials:


Prolink provides fairly modestly priced UPSes in Singapore. They’re not that cheap, but compared to better brands like APC, they give a better price point.

So I recently bought a Prolink PRO1200SFCU UPS and there were a lot of problems. The documentation was very sparse, there was no software provided (save for a website to download an obsolete and not working 3rd party app) and there wasn’t even a USB cable provided.

The RJ45/RJ11 connectors are also only just for surge protection and is not for networking your UPS.

Anyway, on to the tutorial:

  1. Connect the USB cable between the UPS and your computer
    Verify that it is detected by your computer by running lsusb:

    [root@mediaserver ~]# lsusb
    Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 002 Device 003: ID 1a40:0101 Terminus Technology Inc. Hub
    Bus 002 Device 002: ID 058f:6364 Alcor Micro Corp. AU6477 Card Reader Controller
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 006 Device 002: ID 046d:c534 Logitech, Inc.
    Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 003 Device 002: ID 0665:5161 Cypress Semiconductor USB to Serial
    Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

    I suspected that the Cypress USB to Serial was the device but just to be sure, I ran lsusb again after unplugging the cable:

    [root@mediaserver ~]# lsusb
    Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 002 Device 003: ID 1a40:0101 Terminus Technology Inc. Hub
    Bus 002 Device 002: ID 058f:6364 Alcor Micro Corp. AU6477 Card Reader Controller
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 006 Device 002: ID 046d:c534 Logitech, Inc.
    Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

    As you can see, the device disappears so that was indeed the UPS. If you’re having cable problems you may want to run “watch -n 1 lsusb”. This will automatically run the command for you every 1 second so you don’t need to head back and forth to the keyboard.

    Take note of this “Bus 003 Device 002: ID 0665:5161 Cypress Semiconductor USB to Serial” as we will need to use the number later.

  2. Install nut and nut-client

    [root@mediaserver ~]# yum -y install nut nut-client

  3. Edit configuration files
    All your configuration files are going to be in the /etc/ups folder so let’s cd there.

    [root@mediaserver ~]# cd /etc/ups

    First, edit nut.conf and change the MODE to standalone


    Next, edit ups.conf and add the following (usually at the end of the file):

    driver = blazer_usb
    port = /dev/ttyS0
    vendorid = 0665
    desc = “Prolink UPS”
    default.battery.voltage.high = 26.8
    default.battery.voltage.low = 20
    default.battery.voltage.nominal = 24
    runtimecal = 480,100,960,50

    A few things are happening here.

    • First, we’re giving our UPS a name that will identify it to NUT. In this case, we have called it prolink.
    • Secondly, we’re setting the driver to blazer_usb as usbhid-ups does not work and neither does blazer_ser. The communication that occurs is still serial.
    • Next, we set our serial port port to /dev/ttyS0 (that’s a zero). As we have no other serial devices on our machine, it will be zero. If you have others, it may be /dev/ttyS1 or etc.
    • The next thing we set is vendorid. Without this set, NUT seems to not realise that it is dealing with a UPS and simply skips over it. From our first step, we saw that our vendor id is 0665 and our product id is 5161 (from Bus 003 Device 002: ID 0665:5161 Cypress Semiconductor USB to Serial).
    • Then we give our UPS a description.
    • Then we set our default voltages. I expected that the UPS would be able to communicate this information to NUT but it apparently does not. In fact, I had no idea that the device was 24V. The documentation makes no mention of it. So the values are really guestimations and based on observations and experience. If you change the nominal voltage to 12, when you later check your voltage in the NUT client, it will read as if it was a 12V system. How odd.
    • The last bit we set is runtimecal. This gives NUT a formula to calculate how much power remains. The syntax is runtime, usage, runtime, usage, runtime, usage…. It defines how long (runtime; in seconds) a fully charged UPS can run at a certain load level (usage; in percent). The runtime value must always be in increasing numbers and afaik, the usage value must always be decreasing. So 480,100,960,50 will work but 960,50,480,100 won’t. In fact, it will throw an error.

    Next, we edit upsd.conf and add the following at the end:

    password = yourpassword
    upsmon master

    This creates a user nutmon with the password yourpassword and identifies it as a master.

    Then, we edit upsmon.conf and add the following at the end:

    MONITOR prolink@localhost 1 nutmon yourpassword master

    This tells upsmon to monitor the UPS named prolink with the user nutmon that uses the password yourpassword and that it is a master.

    And we’re mostly done.

  4. Test your configuration
    Test your configuration by running the following command (which tells blazer_usb to look for the device named prolink):

    [root@mediaserver ~]# blazer_usb -a prolink -DDDD
    0.003925     Checking device (1D6B/0001) (004/001)
    0.003936     Failed to open device, skipping. (Permission denied)
    0.003945     Checking device (0665/5161) (003/002)
    0.012691     – VendorID: 0665
    0.012730     – ProductID: 5161
    0.012739     – Manufacturer: Cypress Semiconductor
    0.012749     – Product: USB to Serial
    0.012758     – Serial Number: unknown
    0.012767     – Bus: 003
    0.012775     Trying to match device
    0.012857     Device matches

    You may get a couple of permission denied errors but as long your device doesn’t have that problem, it should be fine. In our case, you can see that the device matches. More text will then appear below it as it tries to communicate with the UPS.

    0.015002     Trying megatec protocol…
    0.016986     send: Q1
    0.095019     read: Q1

    0.223103     blazer_status: short reply
    0.223138     Status read 3 failed
    0.223170     Trying mustek protocol…
    0.225015     send: QS
    0.575011     read: (244.4 244.4 244.4 021 50.1 26.9 –.- 00001001
    0.575189     blazer_status: non numerical value [–.-]
    0.575258     Status read in 1 tries
    0.575296     Supported UPS detected with mustek protocol
    0.577009     send: F
    0.767004     read: #230.0 003 24.00 50.0
    0.767144     Ratings read in 1 tries
    0.769003     send: I
    0.831016     read: I
    0.831101     blazer_vendor: short reply
    0.831144     Vendor information read 1 failed
    0.833004     send: I
    0.895002     read: I

    0.959082     blazer_vendor: short reply
    0.959119     Vendor information read 3 failed
    0.959150     Vendor information unavailable
    0.959245     battery runtime exponent : 1.000
    0.959291     battery runtime nominal  : 480.0
    0.959335     battery runtime estimate : 480.0
    0.959382     No charge time specified, using built in default [43200 seconds]
    0.959485     No idle load specified, using built in default [10.0 %]
    0.961001     send: QS
    1.311000     read: (245.0 245.0 245.0 019 50.1 26.9 –.- 00001001
    1.311142     blazer_status: non numerical value [–.-]
    1.311308     dstate_init: sock /var/run/nut/blazer_usb-prolink open on fd 13
    1.312988     send: QS
    1.662997     read: (245.0 244.4 245.0 019 50.1 26.9 –.- 00001001
    1.663133     blazer_status: non numerical value [–.-]
    3.313979     send: QS
    3.678975     read: (245.0 245.5 245.0 019 50.1 26.9 –.- 00001001
    3.679109     blazer_status: non numerical value [–.-]

    Once you see those last few lines, you know it works. Hit Ctrl+C to stop it.

  5. Enable and Start the nut-server service
    At this point, all that’s left to do is start the nut-server service and enable it.

    systemctl enable nut-server
    systemctl start nut-server

A couple of things to note:

  1. If you rename your device in ups.conf,  don’t forget to rename it in upsmon.conf. I couldn’t, for the life of me, find out where the upsd service was – to restart it – so I had to restart the whole computer after changing the device name.
  2. Most if not all of the drivers have executables to test your configuration. So if you were using blazer_ser, you could run:

    [root@mediaserver ~]# blazer_ser -a prolink -DDDD

    And indeed the situation is similar for usbhid-ups:

    [root@mediaserver ~]# usbhid-ups -a prolink -DDDD

  3. upsmon writes to /var/log/messages so if in doubt, check there.
  4. After checking there, you may realise that you may have to create some directories that don’t seem to be created by the nut rpm.

In this tutorial, I’ve omitted the part about setting the values for when to shutdown and etc.

If I missed out anything else or you have a better explanation, comment below.

I was very surprised to see how easy it was to design and code in Qt, especially with Qt Creator. In contrast to that, actually building, compiling and installing Qt (4.8.4) in Windows is unnecessarily complex and any instructions or even notes saying that you need to compile it yourself seem to be missing. It doesn’t even come with a compiler, which is weird since the MinGW build download will only compile with an old MinGW 4.4.1.

The installer does provide you with a link to build the debug libraries but nothing for the release libraries. Note that I have also installed CMake and added it to my PATH but am unsure if this is important to the build. Also note that this instruction list relies on you already having installed Qt 4.8.4 for Windows (mingw). Though this is likely to be very similar for other compilers but you’ll definitely need to make substitions for some of the explicit examples below.

  1. So to get this done you’ll first need to install MinGW 4.4.1.
    As I had installed “Codeblocks 10.05 with MinGW” earlier, it included the compiler’s binaries so I didn’t need to download MingW. Again, if you are getting this, for Qt4 it is imperative that you use MinGW version 4.4.1 (Qt5 claims to support the latest MinGWs but I have not tried it out yet)
  2. Make sure the the binaries are in your PATH.
    The PATH environment variable allows you to execute a program that may not be in your current directory in command prompt.
    In my case, I added “C:\Program Files (x86)\Codeblocks\bin\” to my PATH.
    In Windows, you can change environment variables in the System Info window. For Windows 7:

    1. Press the Windows key and Pause/Break. A window will popup.
    2. Near the left hit “Advanced System Settings”.
    3. Navigate to the “Advanced” tab.
    4. Near the bottom click “Environment Variables”. A dialog will popup.
    5. In the lower half of the dialog, look for PATH (in the “System variables” groupbox)
    6. Edit and add the path to your MinGW binaries. (Paths are separated by the ; character)
    7. Save, hit OK and close, etc

    Also make sure that no other paths to MinGW binaries come before it. When looking for an executable, the PATH is searched from first entry to last. For example, if you also have installed the latest MinGW binaries and thus if “C:\MinGW\bin\” comes before “C:\Program Files (x86)\Codeblocks\bin\” (or whatever you are using), those in C:\MinGW\bin\ will be executed, which in this case, will give you problems.

  3. Now the PATH variable will not be updated system wide until you restart your computer.
    If you cannot do that, go back and copy the entire PATH (including your additions) from the above steps.
    Open up a command prompt, type “PATH = ” then paste the PATH you just copied then hit enter.
    To see if it’s working, in any command prompt type “g++ -v”. Check that the version number printed is correct. If it is not, you have the wrong MinGW installed or your PATH order is incorrect. If you get an error saying cannot find the file then your PATH order is definitely incorrect or you somehow did not install all the binaries. If the version number is correct, proceed to the next step.
  4. Open up a command prompt and navigate to wherever you have installed Qt (e.g. C:\Qt\4.8.4 so “cd C:\Qt\4.8.4″). In the command prompt you may also need to type “C:\” (or whatever drive you have Qt installed on) then hit enter if your command prompt is on a different drive. As a hint, this folder should contain “bin” and “doc” directories amongst others. It should also contain an executable called uninst.exe (or just “uninst” if you’ve hidden file extensions).
  5. Save and close any Qt Development applications (QT Creator, codeblocks using QT, MSVC using QT, etc).
  6. Now type “mingw32-make clean”. This will take a while.
  7. Now type configure -debug-and-release. This will start configure with those options. Note, unlike linux systems where ./configure is usually purely a highly configurable script, this configure is interactive. So follow the instructions that it will display.
  8. When it’s done configuring, it should now say something like ‘now ready to be built by mingw32-make’.
  9. Now type “mingw32-make”, hit enter, and go clubbing… because it will take a long time.

Now both your debug and release libraries are built!

If you are using QT Creator, you’ll then need to clean your project and run qmake (all done easily via the QT Creator’s menu bars). As a new user to Qt, I am not entirely certain how it works so the way I did it was to clean while in debug, then run qmake then build and run, followed by doing the same thing for the release. Additionally, I added “CONFIG += build_all” to my .pro file.

That’s all.

I tried to make this as comprehensive as possible but it thus may have overcomplicated things or been made unclear so post comments if you are not sure about anything!

So my HTC Desire (running Acesmod007) died the other day. It just died and wouldn’t start back up. So after mucho deliberation, I went out and bought an HTC Sensation (non XE).

After spending almost two weeks trying out all the different ROMs that were available, I finally decided on Android Revolution HD (XE version) for stability reasons.

One problem I found was the lack of any “useful” official flashable MODs. Namely a circle battery mod, extended quick settings and the removal of the annoying and redundant recent app list at the top of the notification menu in Sense 3.x.

There should be a picture here but I got lazy. If you don’t already know what it looks like, you’re probably arrived at this page erroneously.

So, the dirty.

  1. Download and install apktool. Grab the apktool tar and the other tar that’s labelled for your operating system. Extract both of them to the same folder.
  2. Extract the following to the abovementioned folder:
    1. /system/framework/
    2. /system/app/SystemUI.apk
  3. Open a command prompt/shell and navigate to the folder
  4. In your command prompt, type:
    1. apktool if
    2. apktool d SystemUI.apk
  5. In your apktool folder there should now be a new folder. Navigate to
  6. Open the file
  7. Find the line
    sput-boolean v0, Lcom/android/systemui/statusbar/StatusBarFlag;->HTC_RECENT_APP:Z
    and replace it with
    sput-boolean v2, Lcom/android/systemui/statusbar/StatusBarFlag;->HTC_RECENT_APP:Z
  8. Save the file
  9. In your command prompt, type:
    apktool b SystemUI SystemUI_new.apk
  10. If you’re editing a SystemUI.apk directly from your phone (adb pull, etc), skip this and go to the next step. Now if you’re editing a SystemUI.apk from a flashable zip, I have had success with just replacing the original apk with this new apk (YMMV). [Don’t forget to delete the old apk rename the new apk from SystemUI_new.apk to SystemUI.apk.]
  11. Open up the old and new apks in 7zip or WinRAR. In the root directory, you’ll find a file called classes.dex
    Take the classes.dex from the new apk and put it into the old apk.
  12. Put the old (but modified) SystemUI.apk back into your phone. Make sure the file permissions is, like all /system/app files, 644.


You have now removed HTC’s Recent Apps. If it doesn’t work, you may not have overwritten the old SystemUI.apk.


– Disable LCD backlight at record start and re-enable at end
– Toggle backlight during recording
– Low Voltage Warning
– Low Disk Space Warning

Must be in video mode (video mode dial) and in record mode (not playback)

Parameters Available:
Low Voltage Threshold – Triggers Low Voltage alert
Low Disk Space Percent Threshold – Triggers Alert if free disk space is less than this (in percent)
Enable Low Voltage Alert – 1 means it will alert you. Any other number means off.
Enable Low Disk Space Alert – 1 means it will alert. Any other number means off.

– In ALT mode, fully depress the shutter to start the script and thus recording and press again to stop it.
– You may run this script even after you have started a recording.
– The “Display” button will toggle your backlight when you are recording.



@param d Low Voltage Threshold
@default d 2400
@param e Low Disk Space Percent Threshold
@default e 10
@param f Enable Low Voltage Alert
@default f 1
@param g Enable Low Disk Space Alert
@default g 1

rem v1.0.0.1
rem todo: set_led for recording, battery low, card almost full. To use switch case statements when if, elseif is needed
rem Original values: A = focus mode, a=buttonchecks, b=modechecks(get_mode),c=backlightstate,d=batteryalertvoltage,e=freediskspacealertpercent,f=batteryalertstate,g=freediskalertstate,h=internalmathvar,i=internalmathvar2

rem Init
if b=1 then goto “dorecmodeerror”
if b=0 then goto “dosceneerror”

rem get_prop 12 A
rem if A=0 then set_prop 12 1

rem Main
print “Starting…”

if get_movie_status=4 then
rem set the led
print “Recording already started…”
print “Turning off LCD in 1 sec”
sleep 1000
press “shoot_half”
sleep 1000
click “shoot_full”
rem set the led
print “Started recording…”
print “Turning off LCD in 1 sec”
sleep 1000

wait_click 5000
is_key a “display”
if a=1 then gosub “dotoggledisplay”
if is_key “no_key” then gosub “dochecks”
goto “loop”

rem Func
if get_vbatt <= d then
if f=1 then
playsound 6
print “Battery Voltage: “, get_vbatt, “V”

h=get_free_disk_space * 100 / get_disk_size
if (h <= e) then
if g=1 then
playsound 6
print “Disk space left:”, get_free_disk_space / 1000, “MB (“, h, “%)”

print “Toggling display…”
if c=0 then
sleep 500

print “Not in Video mode, exiting.”
sleep 1000

print “Not in REC mode, exiting.”
sleep 1000

print “Stopping recording”
rem unset the led
click “shoot_full”
rem set_prop 12 A

If you have a table within a div, like so…

    <table style="width: 100%"...

…you may experience problems with non-fixed width columns overshooting their boundaries in Internet Explorer (even IE8 under Win7).

The solution is this:

<div style="zoom: 1; overflow: auto;">
    <div id="myDiv" style="zoom: 1;">
        <table style="width: 100%"...

I’ve got this to work under IE8 in Win 7 x64 WITHOUT the second level div.

If you want to cater for those using IE6 or lesser, you will have to add an extra conditional. This is why I’ve left in the second level div.

<div style="zoom: 1; overflow: auto;">
    <div id="myDiv" style="zoom: 1;">
        <table style="width: 100%"...

<!--[if lt IE 7]><style> #myDiv { overflow: auto; } </style><![endif]-->

Why people still use IE is beyond me. Just in case you were wondering, this isn’t a “feature” or a lack of CSS implementation (of which there are many), this is a big friggin bug.

Paraphrased from:

  1. Visit:
  2. Download and install the file that is relevant to you
    e.g. Windows 32/64-bit Installer: opencodecs_0.84.17359.exe 2,46MB

Backup reference url:

It’s really that simple. Forget about Illuminable or CoreFLAC. This simply works. =)

Creative Commons Attribution 3.0 Singapore This work is licensed under a Creative Commons Attribution 3.0 Singapore.