Skip to content

Instantly share code, notes, and snippets.

View tonghuikang's full-sized avatar
:octocat:
:/

Tong Hui Kang tonghuikang

:octocat:
:/
  • Singapore University of Technology and Design
  • Singapore
  • LinkedIn in/huikang-tong
View GitHub Profile
export LC_ALL=C
lspci -nnk | grep -i nvidia
sudo apt-get update
sudo apt-get install libglu1-mesa libxi-dev libxmu-dev libglu1-mesa-dev -y
# Installing driver
wget http://us.download.nvidia.com/tesla/384.111/nvidia-diag-driver-local-repo-ubuntu1604-384.111_1.0-1_amd64.deb
sudo chmod +x nvidia-diag-driver-local-repo-ubuntu1604-384.111_1.0-1_amd64.deb
sudo dpkg -i nvidia-diag-driver-local-repo-ubuntu1604-384.111_1.0-1_amd64.deb
sudo apt-get install -f sudo apt-key add /var/nvidia-diag-driver-local-repo-384.111/7fa2af80.pub
#!/bin/bash
echo 'Updating repository...'
sudo apt update
echo 'Upgrading packages...'
sudo apt upgrade -y && sudo apt dist-upgrade -y
echo 'Cleaning up...'
sudo apt autoremove -y && sudo apt clean
echo 'Done! Moving on with install.'
echo 'Installing Python (system default, probably 3.5) ...'
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@tonghuikang
tonghuikang / index.html
Created October 13, 2018 11:26
React Image Search
<div id="app"></div>
@tonghuikang
tonghuikang / people.txt
Created December 15, 2018 08:41
Line separated list of words referring to people
# Line separated list of words referring to people
#
# Explanatory notes on lines starting with hashtags, or spaces
# We will use the plural form
#
# Considerations
# As we plan to find a replace words, please exclude terms that can be interpreted another way e.g. "the right"
# Proper nouns will still be included. spaCy does not detect uncapitalised form of proper nouns
#
# GENDER CATEGORY
[{"Risk": 1, "Date of Birth": "02/07/1996", "Client Type": "Natural Person", "Date of Visit": "07/08/2016", "Name": "Marlo", "Reference": "AVNMGx"}, {"Risk": 1, "Date of Birth": "22/02/1972", "Client Type": "Natural Person", "Date of Visit": "01/05/2017", "Name": "Micki", "Reference": "rlRXPptD"}]
{"data" : [{"Risk": 1, "Date of Birth": "02/07/1996", "Client Type": "Natural Person", "Date of Visit": "07/08/2016", "Name": "Marlo", "Reference": "AVNMGx"}, {"Risk": 1, "Date of Birth": "22/02/1972", "Client Type": "Natural Person", "Date of Visit": "01/05/2017", "Name": "Micki", "Reference": "rlRXPptD"}]}
var data_string = '[{"totalUser":71,"currentPage":1,"totalPage":8,"usages": [{"Name":"Roanne","Date of Birth":"23/06/1967","Reference":"g1GgnxLjXva6","Client Type":"Natural Person","Risk":1,"Date of Visit":"18/10/2016"}, {"Name":"Wallas","Date of Birth":"09/05/1993","Reference":"dHFLx3","Client Type":"Entities","Risk":3,"Date of Visit":"23/08/2017"}, {"Name":"Antonia","Date of Birth":"02/02/1979","Reference":"TR2hK3w7x","Client Type":"Entities","Risk":2,"Date of Visit":"06/09/2011"}, {"Name":"Reeba","Date of Birth":"03/03/1988","Reference":"KfuMQxSjVSx","Client Type":"Natural Person","Risk":3,"Date of Visit":"18/09/2018"}, {"Name":"Tommie","Date of Birth":"30/07/1998","Reference":"FH4zIOxzgC","Client Type":"Natural Person","Risk":3,"Date of Visit":"21/05/2017"}, {"Name":"Shelly","Date of Birth":"12/02/1986","Reference":"nDX64QxZ","Client Type":"PEP","Risk":3,"Date of Visit":"12/03/2016"}, {"Name":"Merry","Date of Birth":"13/02/1989","Reference":"DRMeDHtNtX","Client Type":"PEP","Risk":2,"Date of Visit":"31/12/
@tonghuikang
tonghuikang / setup_record.sh
Last active February 19, 2019 06:49
record battery information daily
# create script
touch power_history.sh
sudo echo '
# create file if not exist
touch ~/power_history.txt
# create separating header
echo Power Information Recorded >> ~/power_history.txt
@tonghuikang
tonghuikang / encrypt_decrypt.js
Created August 1, 2019 03:52
Nodejs encrypt decrypt example
const crypto = require('crypto');
const algorithm = 'aes-256-cbc';
const key = Buffer.from("32charactersOnly32charactersOnly", 'utf8');
const iv = Buffer.from("16charactersOnly", 'utf8');
// const key = crypto.randomBytes(32);
// const iv = crypto.randomBytes(16);
function encrypt(text) {
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(key), iv);