Skip to content

Instantly share code, notes, and snippets.

View Hinaser's full-sized avatar
🏠
Developing financial plan simulator

Hinase Hinaser

🏠
Developing financial plan simulator
View GitHub Profile
# References
# https://u2pia.medium.com/ubuntu-20-04-nvidia-gpu-control-through-ssh-terminal-bb136f447e11
# https://unix.stackexchange.com/questions/367584/how-to-adjust-nvidia-gpu-fan-speed-on-a-headless-node
# This gist is for GPU configuration for mining on Ubuntu 20.04
# This worked with dual GPU machine (GTX1070/RTX3070).
# Set coolbits which enables to control all gpu fan/clock via command line
sudo nvidia-xconfig -a --cool-bits=28
@Hinaser
Hinaser / generateEnglishWordList.js
Last active November 29, 2019 02:03
英辞郎 On the web Proの単語帳内の単語を解析し、オリジナルの単語リストオブジェクトをつくるためのスニペット
function getWordWithKanaTrimmed(el) {
const cloneEl = el.cloneNode(true);
const kanaEls = Array.from(cloneEl.querySelectorAll("span.kana"));
kanaEls.forEach(kanaEl => {
cloneEl.removeChild(kanaEl);
});
return cloneEl.innerText;
}
function generateWordList() {
const allRows = document.querySelectorAll("#wordlist > tbody > tr:not(:first-child)");
@Hinaser
Hinaser / importDataToParseServer.js
Created August 14, 2017 02:49
Data import script for performance test with ParseServer.
/**
* Requirement:
* sudo npm install -g babel-cli
* sudo npm install -g babel-preset-es2015
* sudo npm install -g babel-preset-es2017
* sudo npm install -g parse
* sudo npm install -g randomstring
* sudo npm install -g shuffle-seed
*
* To execute:
@Hinaser
Hinaser / parser-server-sample.js
Last active August 14, 2017 02:47
Parse server getting started sample.
/**
* Sample parse-server/parse-dashboard script for Node.js v6.
*
* In order to use this script you must follow the procedure below.
*
* 1) Create folder for this snippet.
* $ cd <A folder you like to host script files>
* $ npm init
* # You don't need to answer all of the questions. You can safely skip this mess.
* $ npm install --save-dev babel-cli babel-preset-es2015 deepmerge express parse-dashboard parse-server simple-parse-smtp-adapter
@Hinaser
Hinaser / rock-scissors-paper.py
Last active April 24, 2017 07:33
じゃんけんの勝ち方を学習させるサンプル
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import numpy as np
import tensorflow as tf
import time
import datetime as dt
"""
じゃんけん用学習データを生成するクラス。
本来であればプログラムでデータを自動生成するのではなく、
@Hinaser
Hinaser / mlp-optimized.py
Last active April 19, 2017 15:40
MLP sample with optimizing feed performance
"""
Learn arbitrary function from training data
Architecture: MLP
Number of hidden layers: You can configure via `N_neurons_in_layers`
"""
import math
import time
import datetime as dt
@Hinaser
Hinaser / mlp.py
Last active April 15, 2017 20:43
MLP sample
"""
Learn arbitrary function from training data
Architecture: MLP
Number of hidden layers: You can configure via `N_neurons_in_layers`
"""
import math
import time
from inspect import signature
@Hinaser
Hinaser / tensorboard-sample1.py
Last active April 12, 2017 06:54
TensorBoard Sample
import numpy as np
import tensorflow as tf
# セッションを生成
sess = tf.InteractiveSession()
# トレーニングするパラメータを定義
A = tf.Variable(tf.zeros(shape=[3, 3]), dtype=tf.float32, name="A")
b = tf.Variable(tf.zeros(shape=[3, 1]), dtype=tf.float32, name="b")
sess.run(tf.global_variables_initializer())