Skip to content

Instantly share code, notes, and snippets.

View saikocat's full-sized avatar
🍂
Improving the code, one commit at a time

Duc Hoa, Nguyen saikocat

🍂
Improving the code, one commit at a time
View GitHub Profile
@saikocat
saikocat / 0. Tutorial -Submit Pig job to remote secured Hadoop cluster (MIT Kerberos).md
Last active August 29, 2015 14:18
Submit Pig job to remote secured Hadoop cluster (MIT Kerberos)

Generate Your Own Keytab

Login to your remote-clusters and run ktutil. In this example, username is hoa and realm is SAIKOCAT.COM

[hoa@remote-clusters ~]$ ktutil
ktutil:  addent -password -p hoa@SAIKOCAT.COM -k 1 -e aes256-cts
Password for hoa@SAIKOCAT.COM: 
ktutil:  addent -password -p hoa@SAIKOCAT.COM -k 1 -e rc4-hmac
@saikocat
saikocat / gvim:guifont:permanent_in_rc.md
Last active April 22, 2016 01:27
Permanent GUI font for gvim

Open dialog for font and style selection

:set guifont=*

Display current font selection will be display, for example:

"          <font>  <type>  <size>
"  guifont=MonacoB Bold 9
@saikocat
saikocat / etc-hosts
Created June 9, 2016 08:23
When CTAN NUS SG mirror is so staled...
127.0.0.1 download.nus.edu.sg
@saikocat
saikocat / dummy.md
Last active April 16, 2017 08:06
Create dummy interfaces with `ip` cmd

Useful when you want to do cross-domain testing with a single machine

root:~# lsmod 
root:~# modinfo dummy
filename:       /lib/modules/3.12.8-1-ARCH/kernel/drivers/net/dummy.ko.gz
alias:          rtnl-link-dummy
// Guava 14.0 - bundled with Spark
// https://github.com/google/guava/blob/v14.0/guava/src/com/google/common/io/Resources.java#L191
/**
* Returns a {@code URL} pointing to {@code resourceName} if the resource is
* found in the class path. {@code Resources.class.getClassLoader()} is used
* to locate the resource.
*/
public static URL getResource(String resourceName) {
URL url = Resources.class.getClassLoader().getResource(resourceName);
checkArgument(url != null, "resource %s not found.", resourceName);
@saikocat
saikocat / create_temp_binary.scala
Last active October 29, 2017 15:40
spark-shell, embedded-redis and ClassLoader
import java.util.EnumSet
import java.nio.file.{Files, Path, Paths}
import java.nio.file.StandardCopyOption
import java.nio.file.attribute.{PosixFilePermission, PosixFilePermissions}
// Exception handling omitted for brevity
def createTempRedisBinary(binaryName: String = "redis-server-2.8.19"): Path = {
val classLoader = Thread.currentThread.getContextClassLoader
val inputStream = classLoader.getResourceAsStream(binaryName)
val tempBinary = Files.createTempFile("binaryPrefix-", "-binarySuffix")
# https://github.com/harterrt/cookiecutter-python-etl/blob/master/README.md#benefits
# https://github.com/mozilla/python_mozetl/tree/master/tests
import pytest
from pyspark.sql import SparkSession
import json
@pytest.fixture(scope="session")
def spark():
spark = (
# This file contains fish universal variable definitions.
# VERSION: 3.0
SETUVAR ZO_CMD:zo
SETUVAR Z_CMD:z
SETUVAR Z_DATA:/home/hoa/\x2elocal/share/z/data
SETUVAR Z_DATA_DIR:/home/hoa/\x2elocal/share/z
SETUVAR Z_EXCLUDE:/home/hoa
SETUVAR __fish_classic_git_prompt_initialized:\x1d
SETUVAR __fish_init_2_39_8:\x1d
SETUVAR __fish_init_2_3_0:\x1d
group: travis_latest
language: python
cache: pip
python:
#- 2.7
- 3.6
#- nightly
#- pypy
#- pypy3
matrix:

The Best Medium-Hard Data Analyst SQL Interview Questions

Source

By Zachary Thomas (zthomas.nc@gmail.com, Twitter, LinkedIn)

**Tip: **See the Table of Contents (document outline) by hovering over the vertical line on the right side of the page

Background & Motivation