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 / logging.go
Created January 17, 2025 06:52 — forked from panta/logging.go
zerolog with file log rotation (lumberjack) and console output
package logging
import (
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"gopkg.in/natefinch/lumberjack.v2"
"os"
"path"
"io"
)
@chusri
chusri / GolangSSHTunnelForwardAndReverse.go
Created January 17, 2025 06:43 — forked from 0187773933/GolangSSHTunnelForwardAndReverse.go
Golang SSH Forward and Reverse Tunnel
package main
import (
"context"
"fmt"
"os"
"os/signal"
"path"
"sync"
"syscall"
#!/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