Category Archives: Others

Lua in a Nutshell: A Quick Tutorial for Lua

I'm reading source code written with Torch these days. Torch is a well-known deep learning framework written by Lua. So I summarize the grammar of it and provide a quick tutorial here. Run As we know, Lua is a C-like language. Therefore, it is case-sensitive. The following code outputs "Hello World" with Lua. Note that the semicolon at the end of a line is optional, like JavaScript. You can use the interrupter of Lua in the command line: Also, you can run a Lua script with a file in the command line: Grammar Comment Variables The numbers in Lua are all doubles with 64 bits. And you can use the following expressions: You can use both double and single quotes for…

Continue Reading

Install QQ/TIM in Linux with Wine

This tutorial introduces how to install QQ/TIM in Linux with Wine, which had been tested on ArchLinux with Wine 2.4. Prerequisites Before starting, you need to get the latest Wine. I'm not sure whether QQ/TIM can run on a lower version of Wine. In ArchLinux, you can easily get the latest Wine using the following command: However, in Debian, you need to install Wine with some more steps. You can see this tutorial. Then, you need to install a helper of Wine, Winetricks. Winetricks is a script to download and install various redistributable runtime libraries needed to run some programs in Wine. To install Winetricks, you can use the following command: After that, we need to fix some problems manually caused…

Continue Reading

Setup Raspbian on Raspberry Pi

This resource explains how to install the Raspbian operating system and set up a Raspberry Pi. You will need another computer with an SD (or MicroSD) card reader to install the image. Install Raspbian Download the Image Raspbian is the Raspberry Foundation’s official supported operating system and can be downloaded from the Raspberry Pi website Downloads page. After downloading the .zip file, unzip it to get the image file (.img) for writing to your SD card. And you can write this image to an SD card with the help of Win32 Disk Imager in Windows. Setup for HDMI Output Once the write is complete, edit config.txt in boot partition as following for HDMI output. Once you’ve stepped above, place the SD…

Continue Reading

April Fools Pranks with a Squid Proxy Server

Introduction Note: This guide was tested using Ubuntu Server 14.04.4 LTS. This is a HowTo for setting up Upside-Down-Ternet on Ubuntu. Basically, when a user browses the web, all the images are flipped upside-down. While it's not useful, it's quite a good April Fool's prank. The process uses a transparent proxy, web server, and script to flip the images. Web traffic is routed to the proxy, instead of the default gateway, which is intercepted by the proxy which then downloads and modifies the images and then serves them back to the client browser. Setting up the Proxy The proxy used in this guide is Squid v3.3.8. The IP of this server is 192.168.113.253. Installation Configuration Edit the configuration file located in…

Continue Reading

Signing commits using GPG in Git

Git is cryptographically secure, but it’s not foolproof. If you’re taking work from others on the internet and want to verify that commits are actually from a trusted source, Git has a few ways to sign and verify work using GPG. Introduction to GPG First of all, if you want to sign anything you need to get GPG configured and your personal key installed. If you don’t have a key installed, you can generate one with gpg --gen-key. Once you have a private key to sign with, you can configure Git to use it for signing things by setting the user.signingkey config setting. Now Git will use your key by default to sign tags and commits if you want. Add…

Continue Reading

Building and Installing HHVM on CentOS 7

What's HHVM? HHVM is an open-source virtual machine designed for executing programs written in Hack and PHP. HHVM uses a just-in-time (JIT) compilation approach to achieve superior performance while maintaining the flexibility that PHP developers are accustomed to. To date, HHVM (and its predecessor HPHPc before it) has realized over a 9x increase in web request throughput and over a 5x reduction in memory consumption for Facebook compared with the PHP 5.2 engine + APC. HHVM runs much of the world’s existing PHP. Developers and hosts are adopting HHVM. We are aware of minor incompatibilities (please open issues when you find them), but we can run the top 20 Github PHP frameworks out of the box. The HHVM team, along with many wonderful community members, has…

Continue Reading
Contact Us
  • Nanyang Technological University, Singapore
  • root [at] haozhexie [dot] com