Skip to content

Instantly share code, notes, and snippets.

View rangsimanketkaew's full-sized avatar
:octocat:
Learning something..

Rangsiman Ketkaew rangsimanketkaew

:octocat:
Learning something..
View GitHub Profile
@rangsimanketkaew
rangsimanketkaew / settings.json
Created May 6, 2022 13:30
Setting config for VS Code
{
"files.autoSave": "afterDelay",
"editor.formatOnSave": true,
"workbench.iconTheme": "material-icon-theme",
"git.autofetch": true,
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"git.enableSmartCommit": true,
@rangsimanketkaew
rangsimanketkaew / color_tufte.sty
Created April 19, 2022 21:47
LaTeX source of custom color style for tufte book/handout
% usage: \usepackage{color_tufte}
\ProvidesPackage{color-tufte}[2021/03/11 Color Tufte]
%%%%%%%%%%%%%%%%
% Requirements %
%%%%%%%%%%%%%%%%
\RequirePackage{xcolor}
\RequirePackage{graphicx}
@rangsimanketkaew
rangsimanketkaew / tufte_book_style.tex
Last active May 6, 2022 13:31
LaTeX source for a tufte-book supporting Thai and English, modified by Rangsiman Ketkaew
% LaTeX source for a tufte-book modified by Rangsiman Ketkaew
% Multiple languages support: Thai and English
\documentclass[fullbook,nohyper,nobib,justified,titlepage]{tufte-book}
\usepackage{nameref}
\ifxetex
\newcommand{\textls}[2][5]{%
\begingroup\addfontfeatures{LetterSpace=#1}#2\endgroup
}
@rangsimanketkaew
rangsimanketkaew / tensorflow_cc_guide.md
Last active January 1, 2022 07:55
Compile TensorFlow C++ API

Dependencies

  • Conda environment
  • Python 3.9.0
  • TensorFlow 2.7
  • Bazel 3.7.2
  • Protobuf 3.9.2 (must be compatible with the version of TensorFlow-built protobuf or protoc)

Environment setup & install Python

@rangsimanketkaew
rangsimanketkaew / install-tensorflow.md
Last active January 1, 2022 07:56
Install TensorFlow v2

Create virutal env

conda create -n tf
conda activate tf
conda install python
conda update --all -y

Install TF via PIP

@rangsimanketkaew
rangsimanketkaew / render-img-vmd.txt
Last active January 1, 2022 07:56
Produce a good figure with VMD for publication
1. Select representation like
2. In display setting, turn on shadows, Amb, Occl., DOF, ...
3. Render image using Tachyon with, i.e., following command
"/home/modules/vmd/1.9.3/lib/tachyon_LINUXAMD64" -aasamples 12 vmdscene.dat -format BMP image.bmp -res 4096 4096'
You can incease pixels, i.e. change 4096 to 8192, to produce a higher resolution image.
do i = 1, N
read(10,*) atom(i,1), coa(i,2:4)
end do
import re
coord_pattern = re.compile(
r"(\w+)\s+([0-9\-\+\.*^eEdD]+)\s+([0-9\-\+\.*^eEdD]+)\s+"
r"([0-9\-\+\.*^eEdD]+)")
#####################################################
#### FIX X Server for Displaying
#### https://github.com/microsoft/WSL/issues/4106#issuecomment-501532834
####
#### run 'cat /etc/resolv.conf'
#### Then set DISPLAY to an IP address of the nameserver
export DISPLAY=172.19.112.1:0
#####################################################
aws ec2 create-launch-template --region ap-northeast-1 --launch-template-name TemplateForSpot --version-description TemplateForSpotVersion1 --launch-template-data "{\"NetworkInterfaces\":[{\"DeviceIndex\":0,\"SubnetId\":\"subnet-93d49ac8\"}],\"ImageId\":\"ami-06cd52961ce9f0d85\",\"InstanceType\":\"m4.large\",\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"Name\",\"Value\":\"EC2SpotImmersionDay\"}]}]}"