Skip to content

Instantly share code, notes, and snippets.

View 3265's full-sized avatar

74k35h1 k4n3k0 3265

  • Yoyodyne
  • TARDIS
View GitHub Profile
@3265
3265 / 0-corporate-HP.md
Last active July 1, 2021 09:10
A memo when I created corporate HP on free instance on GCP.

trouble shooting

check proxy

$ sudo docker-compose logs -f  nginx-proxy
$ sudo docker-compose exec nginx-proxy /bin/bash

only last log

nohup sh ./train.sh > out.log &
tail -f ./out.log
ps aux | grep sh
import psutil
import humanize
import os
import GPUtil as GPU
GPUs = GPU.getGPUs()
# XXX: only one GPU on Colab and isn’t guaranteed
gpu = GPUs[0]
def printm():
process = psutil.Process(os.getpid())
print("Gen RAM Free: " + humanize.naturalsize( psutil.virtual_memory().available ), " | Proc size: " + humanize.naturalsize( process.memory_info().rss))
@3265
3265 / 1-about.md
Last active January 25, 2019 08:04

OAuth 2.0とは

  • 認可のための仕様
  • ROのリソースサーバーにあるリソースをClient(色々なアプリ)がアクセスすることを目的とする
  • アクセストークン(ROが認可したりリソースサーバーへのクレデンシャル)を使用する

4つのロール

  • Resource Owner(RO)
    • ヒトのこと、エンドユーザー
  • User-Agent
@3265
3265 / rails.md
Last active March 8, 2019 04:19
rails memo
$ rails g model Article name:string
$ rails g migration AddColumnTitles # Alter, Drop, Create, Change
$ rails db:rollback
remove_index :items, [:shop_id, :item_id]
add_index :items, :item_id
@3265
3265 / ubuntu-setup.md
Last active January 30, 2019 01:06
thinkpad x1 carbon(english keyboared) with ubuntu OS basic instruction for myself

Make LiveUsb for install by ubuntu

  1. mount usb
  2. download ubuntu iso image
  3. delete data by gparted
  4. install or launch startup disc creator
  5. burn image to usb

Otherwise install the pkg

@3265
3265 / css-memo.md
Last active January 27, 2019 05:24

vertical-align middle line-height

async function sleep() {
console.log("good night")
await new Promise(r => setTimeout(r, 2000))
console.log("zzzz")
}
@3265
3265 / wait.js
Last active July 25, 2018 07:28
const print = () => {
console.log('This is first')
}
const sleep = (waitSeconds, someFunction) => {
return new Promise(resolve => {
setTimeout(() => {
resolve(someFunction())
}, waitSeconds * 1000)
})