Skip to content

Instantly share code, notes, and snippets.

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

Rocky Chen rockyhmchen

🏠
Working from home
View GitHub Profile
@rockyhmchen
rockyhmchen / multipart_upload.go
Created December 16, 2020 14:22 — forked from mattetti/multipart_upload.go
Example of doing a multipart upload in Go (golang)
package main
import (
"bytes"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
"os"
(a) http://www.example.com/
(b) http://www.example.com
(c) https://www.example.com/
(d) https://www.example.com
(e) https://example.com/
(f) https://example.com/fish
(g) https://example.com/fish/
Trailing slash on hostnames don't matter:
(a) = (b), (c) = (d)
@rockyhmchen
rockyhmchen / multiple_ssh_setting.md
Created October 15, 2019 09:45 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@rockyhmchen
rockyhmchen / curl.md
Created June 11, 2019 11:36 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups command.

  1. List the topics to which the group is subscribed
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describe

Note the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.

  1. Reset the consumer offset for a topic (preview)
using System.Threading.Tasks;
using Newtonsoft.Json;
using Refit;
using System.Net.Http;
using System;
namespace wms_xamarin
{
public class LoginApi
{
@rockyhmchen
rockyhmchen / minikube-mac-install.md
Created October 23, 2018 15:46 — forked from sitkevij/minikube-mac-install.md
minikube mac install

Hello Minikube Mac Install

install brew

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
@rockyhmchen
rockyhmchen / gist:c575e34276cd9e0f47a4d11fdd572da9
Last active July 29, 2018 15:54
Switching between Java Versions on Ubuntu linux

Switching between Java Versions on Ubuntu linux

If you're using Ubuntu Linux on your daily basis work, you've probably Java installed on your machine. Personally I prefer using Wepupd8 PPA to manage JAVA installation, it makes my life a lot more easier especially for updates. The Wepupd8 team didn’t add any binary for Oracle JAVA installation and they made a script to download the Oracle JAVA from Oracle website and install it straight away. So whenever Oracle will release the update, I can simple upgrade via package manager.

Working with multiple Java versions in your machine is a normal thing, especially if you're a Java developer, and because I'm a (very) lazy person, I'm always looking for a quicker/easier way to make the switch.

Today, I'll share with you my tip on this subject. First, let's run the following command:

@rockyhmchen
rockyhmchen / git-maven-howto.md
Created June 15, 2018 22:26 — forked from fernandezpablo85/git-maven-howto.md
how to create your own maven repository on github

How to create a maven repository for your github project step by step

Clone your project in a separate folder

(note: replace ORGANIZATION and PROJECT)

git clone git clone [email protected]:ORGANIZATION/PROJECT.git my-repository

Cd into it