Skip to content

Instantly share code, notes, and snippets.

Hi ;)

Tuan Anh Tran tuananh

Hi ;)
View GitHub Profile
View gist:22e0fec5e43f6f56190a10df4822ed00
apiVersion: extensions/v1beta1
kind: Ingress
name: cheese
annotations: traefik
- host:
tuananh /
Created Mar 30, 2017
Install RabbitMQ on Debian/Ubuntu based systems
# Variables
# Assert Root User
if [ "$SCRIPTUSER" != "root" ]
tuananh /
Created Mar 20, 2017 — forked from oodavid/
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see for other systems like ubuntu etc


Git cheat list

  • all commits that your branch have that are not yet in master

    git log master..<HERE_COMES_YOUR_BRANCH_NAME>
  • setting up a character used for comments

    git config core.commentchar <HERE_COMES_YOUR_COMMENT_CHAR>
tuananh / BotLovin.cs
Created Jan 24, 2017 — forked from NickCraver/BotLovin.cs
Some bot/crawler fun on Stack Overflow. 10 hours of fun, to be precise.
View BotLovin.cs
private static readonly string[] tenHoursOfFun =
View install consolas on mac
# Thanks to this post:
$ brew install cabextract
$ cd ~/Downloads
$ mkdir consolas
$ cd consolas
$ curl -O
$ cabextract PowerPointViewer.exe
$ cabextract

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

View MacBook Pro Wifi on Fedora

The current kernel/drivers of Fedora 24 do not support the Wifi chip used on my Mac Book Pro. Proprietary Broadcom drivers are packaged and available in the rpmfusion repo.

Verify that your card is a Broadcom using: lspci -vnn -d 14e4:

Sample output:

02:00.0 Network controller [0280]: Broadcom Corporation BCM4360 802.11ac Wireless Network Adapter [14e4:43a0] (rev 03)


Install the rpmfusion repo, note only "nonfree" is required, as the Broadcom Driver is proprietry:

tuananh /
Created Jan 4, 2017 — forked from olpoco/
Installing Fedora 23 on Macbook Pro Retina 2016, and attaching Airport Extreme

Installing Fedora on Macbook Pro retina

  1. Download Fedora 23 iso, create a usb bootable media Follow instructions here Basically,
  2. use diskutil list to figure out which drive is the usb, on macbook pro with 1 hardrive, the usb is /dev/disk2
  3. umount the disk using diskutil unmountDisk /dev/disk2 or use Mac's Disk Utility (just umount, don't eject, umount removes it from directory structure and eject disconncet it altogether)
  4. use dd(a low level cp) to write iso content into the usb drive, sudo dd if=~/Downloads/Fedora-Live-Desktop-x86_64-20-1.iso of=/dev/disk2 bs=1m, this will take a bit of time, make sure you wait until it's done, additionally compare the size or checksum to make sure all has been copied (not that necessary since if it weren't copied, it'll err at boot time)
  5. use Disk Utility to shrink Mac's harddrive
View 00_copy_key.lua
-- @desc: The fastest, type-agnostic way to copy a Redis key
-- @usage: redis-cli --eval copy_key.lua <source> <dest> , [NX]
local s = KEYS[1]
local d = KEYS[2]
if"EXISTS", d) == 1 then
if type(ARGV[1]) == "string" and ARGV[1]:upper() == "NX" then
return nil