Skip to content

Instantly share code, notes, and snippets.

View hadisfr's full-sized avatar

H@di hadisfr

View GitHub Profile

Use Proxy for Git/GitHub

Generally, the Git proxy configuration depends on the Git Server Protocol you use. And there're two common protocols: SSH and HTTP/HTTPS. Both require a proxy setup already. In the following, I assume a SOCKS5 proxy set up on localhost:1080. But it can also be a HTTP proxy. I'll talk about how to set up a SOCKS5 proxy later.

SSH Protocol

When you do git clone ssh://[user@]server/project.git or git clone [user@]server:project.git, you're using the SSH protocol. You need to configurate your SSH client to use a proxy. Add the following to your SSH config file, say ~/.ssh/config:

ProxyCommand nc -x localhost:1080 %h %p
diff --git a/hsdev/backend.py b/hsdev/backend.py
index 10eef88..08da254 100644
--- a/hsdev/backend.py
+++ b/hsdev/backend.py
@@ -40,7 +40,7 @@ class HsDevBackend(Backend.HaskellBackend):
HSDEV_DEFAULT_HOST = 'localhost'
HSDEV_NOT_FOUND = [0, 0, 0, 0]
HSDEV_MIN_VER = [0, 3, 3, 0] # minimum hsdev version
- HSDEV_MAX_VER = [0, 3, 4, 0] # maximum hsdev version
+ HSDEV_MAX_VER = [0, 3, 5, 0] # maximum hsdev version
@hadisfr
hadisfr / plot-pandemic.py
Created August 12, 2021 21:08
plot graphs and animations of COVID-19 pandemic data from UNICEF population data and https://github.com/owid/covid-19-data
#!/usr/bin/env python3
import subprocess
import re
from os import path
import pandas as pd
import geopandas as gpd
import numpy as np
import seaborn as sns
@hadisfr
hadisfr / refah.py
Created February 24, 2021 20:55
Bank Refah Iranian DB Plotter and Aggregator - https://refahdb.mcls.gov.ir/fa/sample
#!/usr/bin/env python3
import csv
from collections import defaultdict
from sys import stderr
import numpy as np
from matplotlib import pyplot as plt
from tqdm import tqdm
@hadisfr
hadisfr / convert_gns3project_version.py
Last active December 24, 2020 15:10
convert GNS3 v2.2 project files to v2.1.21
#!/usr/bin/env python3
import json
from sys import stderr, argv
def process(topoplogy):
del topoplogy["drawing_grid_size"]
topoplogy["revision"] = 8
topoplogy["version"] = "2.1.21"
@hadisfr
hadisfr / ConfluenceRLT.md
Last active March 2, 2024 10:33
wrinting Right to Left Persian/Arabic texts in Atlassian Confluence

Confluence RLT

Adding RTL Macro

  1. go to Confluence Administration
  2. go to User Macros page under Configuration part
  3. click on Create a User Macro to add a new macro
  4. create RTL Section macro
  • use rtl-section as Macro Name
@hadisfr
hadisfr / pandoc_persian_md_html_convert.sh
Created October 6, 2020 22:41
pandoc persian tex html convert
pandoc report.md -o report.html --bibliography=biblio.bib --filter pandoc-crossref --filter pandoc-citeproc --csl ./acm.csl --resource-path=./img --self-contained
@hadisfr
hadisfr / pdftk_fix_pages_oriention.sh
Last active October 6, 2020 22:50
rotate vertical pages to horizontal in final pdf of a book
PAGES=(104-105 111-115 120)
pdftk src.pdf rotate `for PAGE in ${PAGES[@]}; do echo ${PAGE}oddleft ${PAGE}evenright; done` output dst.pdf
ZOOKEEPER_IP=esv4-hcl197.grid.linkedin.com
BOOTSTRAP_SERVER_IP=esv4-hcl198.grid.linkedin.com
# Producer
# Setup
bin/kafka-topics.sh --zookeeper $ZOOKEEPER_IP:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1
bin/kafka-topics.sh --zookeeper $ZOOKEEPER_IP:2181 --create --topic test --partitions 6 --replication-factor 3
@hadisfr
hadisfr / .jdk-14.jinfo
Created April 13, 2020 21:50
/usr/lib/jvm/.jdk-14.jinfo to make update-java-alternatives work for Java SE (JDK, etc.) 14 installed from https://www.oracle.com/java/technologies/javase-jdk14-downloads.html
name=jdk-14
priority=1411
section=main
hl rmid /usr/lib/jvm/jdk-14/bin/rmid
hl java /usr/lib/jvm/jdk-14/bin/java
hl keytool /usr/lib/jvm/jdk-14/bin/keytool
hl jjs /usr/lib/jvm/jdk-14/bin/jjs
hl rmiregistry /usr/lib/jvm/jdk-14/bin/rmiregistry
hl jfr /usr/lib/jvm/jdk-14/bin/jfr