Skip to content

Instantly share code, notes, and snippets.

@sameei
sameei / devproxy.md
Last active October 13, 2019 06:07

Setup Proxies for Dev

Requirements

brew install stunnel
brew install socat

Your stunnel config file in client (/etc/stunnel/stunnel.conf, /usr/local/etc/stunnel/stunnel.conf) :

@sameei
sameei / GitConfigHttpProxy.md
Created October 13, 2019 04:59 — forked from evantoli/GitConfigHttpProxy.md
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@sameei
sameei / multiple_ssh_setting.md
Created October 9, 2019 04:31 — 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 "your_email@youremail.com"
package com.githib.gist.reza_sameei.comparingiterator;
import java.util.*;
public class ComparingIterator<L, R> implements Iterator<ComparingIterator.Pair<L,R>>{
public static interface Comparator<L, R> {
public int compare(L l, R r);
}
@sameei
sameei / delete_git_submodule.md
Created September 14, 2019 15:19 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@sameei
sameei / gist:1ec2f3f4a1e973c3fdae9da96fe39c57
Created August 20, 2019 08:45 — forked from dmitshur/gist:6927554
How to `go get` private repos using SSH key auth instead of password auth.
$ ssh -A vm
$ git config --global url."git@github.com:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "git@github.com:"]
	insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!
@sameei
sameei / Makefile
Created August 20, 2019 08:14
Makefile for a Gelang project
# A Self-Documenting Makefile: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
OS = $(shell uname)
# Build variables
BUILD_DIR ?= build
VERSION ?= $(shell git describe --tags --exact-match 2>/dev/null || git symbolic-ref -q --short HEAD)
COMMIT_HASH ?= $(shell git rev-parse --short HEAD 2>/dev/null)
BUILD_DATE ?= $(shell date +%FT%T%z)
LDFLAGS += -X worker.version=${VERSION} -X worker.commitHash=${COMMIT_HASH} -X worker.buildDate=${BUILD_DATE}
@sameei
sameei / go-os-arch.md
Created June 9, 2019 12:10 — forked from asukakenji/0-go-os-arch.md
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.8.3 darwin/amd64.

A list of valid GOOS values

(Bold = supported by go out of the box, ie. without the help of a C compiler, etc.)

  • android
  • darwin
@sameei
sameei / SparkCmd&Cnf.txt
Created August 19, 2018 05:03
Spark Command & Configs
$SPARK_HOME/sbin/start-master.sh --host $HOST
# OR
$SPARK_HOME/bin/spark-class org.apache.spark.deploy.master.Master --port 7077 --webui-port 8080 --host $HOST
# in $SPARK_HOME/conf/spark-env.sh
JAVA_HOME=/path/to/jdk8
$SPARK_HOME/sbin/start-history-server.sh
# http://2min2code.com/articles/log4j_intro/rolling_file_on_size_prop
# Appender
log4j.appender.APPENDER_NAME=APPENDER_CLASS
log4j.appender.APPENDER_NAME.PROP_KEY=PROP_VAL
# Console Appender
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout