Skip to content

Instantly share code, notes, and snippets.

View nedzhang's full-sized avatar

Ned Zhang nedzhang

View GitHub Profile
@nedzhang
nedzhang / resource.md
Last active April 1, 2021 15:26
IBP IBM Blockchain Platform
  • Documentation site: https://cloud.ibm.com/docs/blockchain-sw-252
    • Check How to / Install on the OpenShift Container Platform / Deployment options / Deploy IBM Blockchain Platform 2.5.2 manually
    • Check Tutorials / Getting Started / Build a network
@nedzhang
nedzhang / station-view.lua
Last active March 22, 2021 23:56
[factorio script] #factorio
local function copy_table(obj, seen)
if type(obj) ~= 'table' then
return obj
end
if seen and seen[obj] then
return seen[obj]
end
@nedzhang
nedzhang / IBM Cloud Object Storage (COS) s3fs.md
Last active February 9, 2021 17:03
[IBM Cloud] #cloud #ibm #ibmcloud

Access IBM Cloud Object Storage using s3fs

How to access IBM Cloud Object Storage, COS, using s3fs.

Install s3fs (if needed)

  • CentOS:
@nedzhang
nedzhang / setup-manjaro.sh
Last active April 13, 2020 05:09
[Linux system setup] linux setup apt
#!/bin/sh
pacman -S snapd docker git code
# enable docker as a service
sudo systemctl enable docker
sudo systemctl status docker
# add me to the docker group
sudo usermod -aG docker $USER
@nedzhang
nedzhang / stringtonumber.py
Created March 8, 2020 15:54
[String to Number] Covert String to numbers #python #utility
# String to number testing
# Converting a string to a int64 number
# This method converts a string's first 10 characters to int64 number. It is a base27 number that
# 1. Convert the string to lowercase
# 2. map a=>1, b=>2, ..., z=>26, and anything else to 0
# 3. if it is not the 10's character, the method multiple its result by 27 and read the next character
@nedzhang
nedzhang / get-duplicates-list.py
Last active December 18, 2018 07:12
[Dup file list] Search for duplicated files #python #duplicate
#!/usr/bin/python
import sys, os
# from sets import Set
import hashlib
HASH_TBD = "?"
def hashfile( filepath ):
BLOCKSIZE = 65536
@nedzhang
nedzhang / Install multiple Windows Subsystem for Linux.md
Last active November 27, 2018 23:31
[Install multiple copyiesWSL instance using LxRunOfflin] #wsl #linux #lxrunoffline

Multiple WSL in a Windows

Use LxRunOffline to install multiple Linux instances on Windows.

LxRunOffline installation

I used Chocolatey to install LxRunOffline

@nedzhang
nedzhang / how-to-run-docker-on-wsl.md
Last active November 27, 2018 23:12
[Docker on Windows Subsystem for Linux] #docker #wsl

It is possible!

You can run Docker near natively (without VM) on Windows Subsystem for Linux. It doesn't have all the functionalities but can run Node and Angular server.

Setup

Sounds great. How do I sign up?

Enable Windows Subsystem for Linux

@nedzhang
nedzhang / docker-daemon-config-data-root-container-size.json
Created November 25, 2018 19:18
[Docker Tips] Docker and Docker Daemon stuff #docker #daemon
// Put this file as /etc/docker/daemon.json
// data-root to change where docker store data. Default /var/lib/docker
// storage-opt dm.basesize to change the container size. Default 10G
{
"debug": false,
"data-root": "/datahome/docker",
"storage-opt": [
{"dm.basesize": "20G"}
]
@nedzhang
nedzhang / ng-serve-disable-host-check.sh
Last active November 25, 2018 15:53
[Angular nodes] Angular stuff #angular #ng
// --host=0.0.0.0 to bind to all interfaces
// --disable-host-check to avoid container refusing connection through host (url is for the host)
ng serve --host=0.0.0.0 --disable-host-check --proxy-config proxy.config.json