Skip to content

Instantly share code, notes, and snippets.

@yuanjs
yuanjs / autostart.sh
Created July 14, 2021 01:32 — forked from faniska/autostart.sh
Autostart mining
#!/bin/sh
sleep 10
export DISPLAY=:0
/usr/bin/xset -dpms
/usr/bin/xset s off
sudo /usr/bin/nvidia-smi -pm 1
sudo /usr/bin/nvidia-smi -pl 90
@yuanjs
yuanjs / eth-mining-manjaro.md
Created July 14, 2021 01:32
ETH Mining - Manjaro OS
  1. Install Manjaro OS selecting nonfree drivers

  2. Run

sudo EDITOR=nano visudo

and uncomment the line

%wheel ALL=(ALL) NOPASSWD: ALL
-module(palinserver).
-export([start/0, server_stop/1, serverloop/1, processloop/0, check_palin/2]).
%% start 5 processloop to process the request of palindrome check
%% then start the server to listen request
start() ->
ServerList = [spawn(palinserver, processloop, []) || _S <- lists:seq(1, 5)],
spawn(palinserver, serverloop, [ServerList]).
%% select random processloop to do the check job
@yuanjs
yuanjs / index.erl
Last active May 22, 2020 06:23
erlang indexing a file
-module(index).
-export([get_file_contents/1,show_file_contents/1,
get_string_words_index/4,get_all_lines_index/1,build_range/1,
build_words_occurs/1,sort_words_index/1, get_index/1]).
% Used to read a file into a list of lines.
% Example files available in:
% gettysburg-address.txt (short)
% dickens-christmas.txt (long)
@yuanjs
yuanjs / Documentation.md
Created January 13, 2017 13:21 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@yuanjs
yuanjs / v2ex_api.md
Created February 24, 2016 11:50 — forked from fanzeyi/v2ex_api.md
V2EX API