Skip to content

Instantly share code, notes, and snippets.

View chusri's full-sized avatar
🏠
Working from home

Thaweesak Chusri chusri

🏠
Working from home
  • Bangkok
View GitHub Profile
@chusri
chusri / docker-ssh-forward.bash
Last active June 24, 2016 04:32 — forked from d11wtq/docker-ssh-forward.bash
How to SSH agent forward into a docker container
docker run -rm -t -i -v $(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK ubuntu /bin/bash
@chusri
chusri / app.js
Created January 21, 2017 19:25 — forked from Turbo87/app.js
webpack + font-awesome test
require('font-awesome/css/font-awesome.css');
document.body.innerHTML = '<i class="fa fa-fw fa-question"></i>';
@chusri
chusri / .minttyrc
Created March 7, 2017 17:46
cmder (conemu + clink) y babun (cygwin - zsh)
ForegroundColour=131, 148, 150
BackgroundColour= 0, 43, 54
CursorColour= 220, 50, 47
Black= 7, 54, 66
BoldBlack= 0, 43, 54
Red= 220, 50, 47
BoldRed= 203, 75, 22
Green= 133, 153, 0
BoldGreen= 88, 110, 117
@chusri
chusri / nginx.conf
Created March 17, 2017 16:22 — forked from hjr3/nginx.conf
nginx phpfpm + CORS configuration
upstream phpfpm {
server 127.0.0.1:9000;
}
server {
listen 80;
server_name _;
root /var/www/html;
index index.php;
@chusri
chusri / aes-256-cbc-nodejs-crypto.md
Created June 3, 2018 16:25 — forked from umidjons/aes-256-cbc-nodejs-crypto.md
AES-256-CBC example in Node.js using crypto module

AES-256-CBC example in Node.js using crypto module

'use strict';
const crypto = require('crypto');

// get password's md5 hash
let password = 'test';
let password_hash = crypto.createHash('md5').update(password, 'utf-8').digest('hex').toUpperCase();
console.log('key=', password_hash); // 098F6BCD4621D373CADE4E832627B4F6
@chusri
chusri / autoreload.md
Created November 12, 2018 16:25 — forked from deehzee/autoreload.md
Auto reload of modules in jupyter notebook

Module autoreload

To auto-reload modules in jupyter notebook (so that changes in files *.py doesn't require manual reloading):

# for auto-reloading external modules
# see http://stackoverflow.com/questions/1907993/autoreload-of-modules-in-ipython
%load_ext autoreload
%autoreload 2
@chusri
chusri / tmux_cheatsheet.markdown
Created December 23, 2018 02:24 — forked from henrik/tmux_cheatsheet.markdown
tmux cheatsheet

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

@chusri
chusri / cuda_installation_on_ubuntu_18.04
Created January 13, 2019 12:37 — forked from Mahedi-61/cuda_11.8_installation_on_Ubuntu_22.04
cuda 9.0 complete installation procedure for ubuntu 18.04 LTS
#!/bin/bash
## This gist contains step by step instructions to install cuda v9.0 and cudnn 7.2 in ubuntu 18.04
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
@chusri
chusri / install_nodejs_and_yarn_homebrew.md
Created May 4, 2019 15:24 — forked from nijicha/install_nodejs_and_yarn_homebrew.md
Install NVM, Node.js, Yarn via Homebrew

Install NVM, NodeJS, Yarn via Homebrew

Prerequisites

  • Homebrew should be installed (Command line tools for Xcode are included).

Getting start

Install NVM and NodeJS

  1. Install nvm via Homebrew