Skip to content

Instantly share code, notes, and snippets.

View thuandt's full-sized avatar
💀
This.isDevOps(powah_code=36)

Thuan Duong thuandt

💀
This.isDevOps(powah_code=36)
View GitHub Profile
@thuandt
thuandt / zfs-raidz.md
Created March 31, 2016 19:02
ZFS RAID-Z NOTES

RAID-Z

The strongest valid recommendation based on exact fitting of blocks into stripes is the following: If you are using RAID-Z with 512-byte sector devices with recordsize=4K or 8K and compression=off (but you probably want compression=lz4): use at least 5 disks with RAIDZ1; use at least 6 disks with RAIDZ2; and use at least 11 disks with RAIDZ3.

To summarize: Use RAID-Z. Not too wide. Enable compression.

Keybase proof

I hereby claim:

  • I am thuandt on github.
  • I am thuandt (https://keybase.io/thuandt) on keybase.
  • I have a public key ASAOXz-V0iQWVO2CXIGKgcuhu_js3JzwICItI0Szy2unOAo

To claim this, I am signing this object:

@thuandt
thuandt / userChrome.css
Last active August 29, 2015 14:20
userChrome.css
/* Disable "List all Tabs" Button */
.tabs-alltabs-button {
display: none !important;
}
/* Disable Container box for "List all Tabs" Button */
.tabs-alltabs-box {
display: none !important;
}
@thuandt
thuandt / install_xenserver_usb.md
Created October 30, 2013 15:56
Create XenServer USB Install

Installing XenServer 6.2.0 from a USB Stick

  • Download the XenServer 6.2.0 ISO image

  • Format a USB stick using FAT32.

  • Use unetbootin to install the ISO to the USB stick. Use the “DiskImage” option instead of the “Distribution” one, and point it right to the ISO file.

  • Now we need to fix up some boot stuff (All paths are relative to the root of the USB drive)

@thuandt
thuandt / XenServer-software-RAID1.md
Last active June 4, 2017 08:26
Instructions for switching to RAID 1 for XenServer 6.2 with GPT

Instructions for switching to RAID 1 for XenServer 6.2 with GPT

  • Create new partition for Local Storage
# gdisk /dev/sda
  • Check /dev/sda partition table
@thuandt
thuandt / bash_shortcuts
Created May 1, 2013 21:39
Keyboard Shortcuts for Bash
Ctrl + A Go to the beginning of the line you are currently typing on
Ctrl + E Go to the end of the line you are currently typing on
Ctrl + L Clears the Screen, similar to the clear command
Ctrl + U Clears the line before the cursor position. If you are at the end of the line, clears the entire line.
Ctrl + H Same as backspace
Ctrl + R Let’s you search through previously used commands
Ctrl + C Kill whatever you are running
Ctrl + D Exit the current shell
Ctrl + Z Puts whatever you are running into a suspended background process. fg restores it.
Ctrl + W Delete the word before the cursor
@thuandt
thuandt / umask
Created May 1, 2013 06:37
UNIX/Linux umask
Umask Created Files Created Directories
-------------------------------------------------------------
000 666 (rw-rw-rw-) 777 (rwxrwxrwx)
002 664 (rw-rw-r--) 775 (rwxrwxr-x)
022 644 (rw-r--r--) 755 (rwxr-xr-x)
027 640 (rw-r-----) 750 (rwxr-x---)
077 600 (rw-------) 700 (rwx------)
277 400 (r--------) 500 (r-x------)
@thuandt
thuandt / star_animation.cpp
Created March 12, 2013 06:31
Star Animation
#include <GL/gl.h>
#include <GL/glut.h>
#include <cmath>
static GLfloat spin = 0.0;
void init(void)
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glShadeModel(GL_FLAT);
#include <GL/gl.h>
#include <GL/glut.h>
GLubyte rasters[24] = { 0x00, 0x00,
0x06, 0x00,
0x06, 0x00,
0x06, 0x00,
0x06, 0x00,
0x06, 0x00,
0x06, 0x00,
import sys
def gcd(a, b):
t = b
b = a % b
if b == 0:
return t
else:
return gcd(t, b)