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 / 00_instructions.md
Created August 10, 2018 14:30 — forked from germanny/_instructions.md
Instructions for setting up OSX 10.X.X

Setup OSX 10.X with a Clean Install

About once a year, my machine gets pretty sluggish and it's time to start fresh. Here's the process I use to update it with everything I need.

  • Back up all photos, music, apps, iTunes library, keychains, etc.
  • Deauthorize iTunes and Photoshop.
  • Deactivate CleanMyMac 3 license.
  • 1Password, Dropbox, Evenote sync
sudo du -gxd 5 / | awk '$1 >= 5{print}'
cd ~/Dev
du -d 1 -h
find . -name "node_modules" -print -exec rm -rf {} ";"
#!/usr/bin/env bash
# Ask for the administrator password upfront
echo 'Please enter your password to grant sudo-rights:'
sudo -v
echo 'Empty the Trash on all mounted volumes and the main HDD...'
sudo rm -rfv /Volumes/*/.Trashes &>/dev/null
sudo rm -rfv ~/.Trash &>/dev/null
@wechain
wechain / brewfile
Created August 10, 2018 19:19 — forked from germanny/brewfile
brewfile
cask_args appdir: '/Applications'
#
# 1 taps
#
# homebrew dupes
tap 'homebrew/dupes'
# homebrew versions
@wechain
wechain / gist:c59766c6b7a67913c8f3d30728c1e532
Created August 12, 2018 08:29 — forked from mestizo/gist:9167834
Completely disable IPv6 on OSX
#To Get List of Hardware
sudo networksetup -listallhardwareports
#To Disable IPv6 on Wifi Adapter
sudo networksetup -setv6off wi-fi
#To Disable IPv6 on Built-in Ethernet Adapter
sudo networksetup -setv6off Ethernet
// steemwhales.com data importer
// this was made in the early days of steem
//
// a lot of things are wrong in it:
//
// how it doesnt use steemjs (it uses a super old module called steem rpc)
// the way it refreshes every existing accounts without priority for active accounts
// the way it stores the data (especially the history table)
// the way it counts followers (theres a much better API function for it now)
// it doesnt count delegation numbers
@wechain
wechain / schema.sql
Created August 12, 2018 17:58 — forked from skzap/schema.sql
SteemWhales db
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.5.36 - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 8.3.0.4694
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
@wechain
wechain / ffmpeg.md
Created September 22, 2018 11:59 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

Keybase proof

I hereby claim:

  • I am wechain on github.
  • I am wechain (https://keybase.io/wechain) on keybase.
  • I have a public key ASD6DRr75VBZgUIxOC8Yfq_zMmXgMYG-jT3UiUo5r1MdeQo

To claim this, I am signing this object:

@wechain
wechain / ipfs-server-setup.md
Created October 14, 2018 07:48 — forked from claus/ipfs-server-setup.md
Host Your Site Under Your Domain on IPFS

Host Your Site Under Your Domain on IPFS

This is a step-by-step tutorial for hosting your website under your domain on IPFS, from zero, on a DigitalOcean Ubuntu 16.04.3 x64 Droplet (i am using the $10 variant with 2GB RAM).

Install IPFS

Log in as root.

First, make sure the system is up to date, and install tar and wget: