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
#!/usr/bin/env bash
set -e
cd
case "$OSTYPE" in
darwin*) DOWNLOAD=https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh ;;
linux*) DOWNLOAD=https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh ;;
*) echo "unknown: $OSTYPE" ;;
esac
@chusri
chusri / nicehash.txt
Created May 16, 2020 13:04 — forked from sanzgiri/nicehash.txt
[Running nicehash on Ubuntu]
- Open a nicehash account
- Enable 2FA
- Get a bitcoin deposit address
- List of nicehash algorithms is here: https://www.nicehash.com/algorithm
- Profitability calculator that lets you determine which crypto to mine based on hardware / currency / electricity cost is here: https://www.nicehash.com/profitability-calculator
- Use this to determine the most profitable algorithm for the upcoming day
- Select stratum based on algorithm and location from here: https://www.nicehash.com/farm-mining
- Set up a configuration file as follows:
https://github.com/nicehash/ccminer-nanashi/blob/master/README.txt
https://github.com/nicehash/ccminer-nanashi/blob/master/ccminer.conf
@chusri
chusri / Install CUDA 10.1 on Ubuntu 18.04.md
Created March 23, 2020 15:59 — forked from eddex/Install CUDA 10.1 on Ubuntu 18.04.md
How to install CUDA 10.1 on Ubuntu 18.04

How to install CUDA 10.1 on Ubuntu 18.04

A clean installation of Ubuntu 18.04.02 LTS was used.

This gist is an extension to the official docs, adding missing parts and instructions.

2 pre-install actions

follow the pre-installation actions on:

@chusri
chusri / mac-vagrant-howto.rst
Created December 20, 2019 03:27 — forked from zz/mac-vagrant-howto.rst
brew, vagrant, virtualbox, and vagrant file howto...

Vagrant on Mac w Virtualbox

NSoT engineers have built Vagrantfiles for you to deploy NSoT software in a multitude of linux environments. This tutorial will help you load a Macintonsh computer (OS X) with Vagrant, Virtual Box, and dependencies so that you can start virtual servers and test the software.

NSoT publishes complete installation instructions for linux distributions, branch versions, and Vagrantfiles in addition to, not an alternative for the pip install method:

$ pip-install nsot

Update 7/28/2019: An updated version of this guide for Ubuntu Server 18.04 LTS is now available. Feel free to check it out.

Mounting VirtualBox shared folders on Ubuntu Server 16.04 LTS

This guide will walk you through steps on how to setup a VirtualBox shared folder inside your Ubuntu Server guest. Tested on Ubuntu Server 16.04.3 LTS (Xenial Xerus)

Steps:

  1. Open VirtualBox
  2. Right-click your VM, then click Settings
  3. Go to Shared Folders section

Mounting VirtualBox shared folders on Ubuntu Server 18.04 LTS (Bionic Beaver)

This guide will walk you through the steps on how to setup a VirtualBox shared folder inside your Ubuntu Server guest.

Prerequisites

This guide assumes that you are using the following setup:

You could still make this guide work with other setups (possibly with some modifications to the commands and whatnot).

@chusri
chusri / Caddyfile
Created September 22, 2019 16:42 — forked from Ocramius/Caddyfile
Example docker + docker-compose + caddy + traefik setup that routes to multiple apps from one exposed HTTP port
:80 {
root /serve
}
@chusri
chusri / delete_docker_logs.sh
Created September 17, 2019 12:37 — forked from stefanfoulis/delete_docker_logs.sh
delete docker logs
find /var/lib/docker/containers/ -type f -name "*.log" -delete
@chusri
chusri / MathCalc.kt
Created August 22, 2019 04:21 — forked from first087/MathCalc.kt
โจทย์เลข ป.4
fun calc() {
val ans = mutableListOf<Double>()
do {
val random8 = mutableListOf<Int>()
for (i in 1..8) {
random8.add(Random.nextInt(0, 9 + 1))
}
fun charToRandomNumber(ch: Char) = random8[ch.toByte() - 65]
fun transformDigit(digit: Int, ch: Char) = 10.0.pow(digit - 1) * charToRandomNumber(ch)
@chusri
chusri / git-deployment.md
Created July 22, 2019 07:34 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.