Instantly share code, notes, and snippets.

View ipfs-server-setup.md

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:

View keybase.md

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:

View ffmpeg.md

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:

View schema.sql
-- --------------------------------------------------------
-- 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 */;
View importer.js
// 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
View gist:c59766c6b7a67913c8f3d30728c1e532
#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
View brewfile
cask_args appdir: '/Applications'
#
# 1 taps
#
# homebrew dupes
tap 'homebrew/dupes'
# homebrew versions
View mac_cleanup.sh
#!/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
View node_cleanup.sh
sudo du -gxd 5 / | awk '$1 >= 5{print}'
cd ~/Dev
du -d 1 -h
find . -name "node_modules" -print -exec rm -rf {} ";"
View 00_instructions.md

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.

1. Start with a Fresh Install of OS X

  • Back up all photos, music, apps, iTunes library, keychains, etc.
  • Deauthorize iTunes and Photoshop.
  • Deactivate CleanMyMac 3 license.
  • 1Password, Dropbox, Evenote sync