Skip to content

Instantly share code, notes, and snippets.

View coin8086's full-sized avatar
🏠
Working from home

Robert Zhang coin8086

🏠
Working from home
  • @Azure Microsoft
  • Shanghai, China
View GitHub Profile
@coin8086
coin8086 / nas_server.md
Last active April 8, 2018 02:11
Raspberry Pi

Raspberry Pi NAS Server Getting Start

Install Raspbian OS

Get the OS image file(RASPBIAN STRETCH LITE) from https://www.raspberrypi.org/downloads/raspbian/, and write it into a SD card as said by https://www.raspberrypi.org/documentation/installation/installing-images/README.md

Config for Remote Access

@coin8086
coin8086 / getting_start_on_rest.md
Last active April 20, 2018 06:57
Getting Start on REST​

Getting Start on REST

A Simple Definition

REST is a style and a set of guide lines for web service, such as web API.

It

  • is resource oriented
  • uses HTTP method to convey method information
  • uses URL to scope the resource to operate on
@coin8086
coin8086 / _document.md
Last active December 27, 2018 08:57
Bulk insert/upsert method for ActiveRecord on PostgreSQL(9.5 and later)

ActiveRecord Bulk Write Patch

Usage

Suppose there's a table

create table users (
  id integer primary key,
  name text,
@coin8086
coin8086 / git-on-windows-eol-and-mode.md
Created March 1, 2019 03:23
Git on Windows: File EOL and Permission Mode

Git on Windows: File EOL and Permission Mode

@coin8086
coin8086 / docker-cmd-completion.md
Last active March 1, 2019 03:25
Docker command line completion in Bash

Docker Command Line Completion in Bash

Prerequisites

  1. Make sure bash completion is installed(It's installed by default in major Linux distributions, and Cygwin).
  2. Put completion files to /etc/bash_completion.d/

Completion Files

@coin8086
coin8086 / git_notes.md
Last active October 31, 2019 03:25
Git Notes

Git Notes

EOL

  1. Windows Git client sets core.ignorecase to true by default, you may need to disable it to detect server changes on file names. Check it by git config --get core.ignorecase, and set it by git config core.ignorecase false.
  2. Detect file EOL by git grep -I '^M'. It searches for a literal CR character in files.

Diff

  1. To git show more lines before and after the changed lines, use git show -U <NUM>.
  2. To git diff a file/dir between two commits, use git diff [--] . Either commit can be omitted, in which case it's as if HEAD is used for that omitted commit.
@coin8086
coin8086 / PBS in Brief.md
Last active November 16, 2021 14:01
CycleCloud

PBS in Brief

Core Concepts

  • resource, chunk, vnode and host
  • job
    • job array
  • queue
  • server

Autoscale in CycleCloud

What is CycleCloud

CycleCloud is a product that

  • makes it easy to create and manage HPC computer clusters
  • is open to integrate with various HPC schedulers, like PBS, Slurm, HPC Pack, etc.
  • is deployed by user
@coin8086
coin8086 / ubuntu-vs-centos.md
Last active December 17, 2021 03:40
Ubuntu VS CentOS

Ubuntu VS CentOS

Package Management

Ubuntu CentOS
Search package that contains the file dpkg -S <file> rpm -qf <file>
List package files dpkg -L <package> rpm -ql <package>
Search packages with glob pattern dpkg -l <pattern> rpm -qa <pattern>
Show package info dpkg -s <package> / dpkg -p <package> rpm -qi <package>
@coin8086
coin8086 / ssh-port-forwarding.md
Created June 9, 2022 08:56
SSH Port Forwarding