Skip to content

Instantly share code, notes, and snippets.

View hadisfr's full-sized avatar

H@di hadisfr

View GitHub Profile
@hadisfr
hadisfr / outline-server-setup.md
Last active March 25, 2024 12:17 — forked from okeehou/outline-server-setup.md
How to setup an Outline VPN Server on Ubuntu 16.04

How to setup an Outline VPN Server on Ubuntu 16.04 Server

This guide will show you how to install Outline Server on an Ubuntu 16.04 Server and use Outline Manager.

Install Outline Manager

Outline Manager supports Windows, macOS and Linux.

Outline Manager for Windows

@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 / python_on_ubuntu.md
Last active January 14, 2024 17:03
a short guide to install python3 and pip3 on Ubuntu Server

Python on Ubuntu

Tricks

Ubuntu

Disable X-Server on Ubuntu Desktop

  • edit /etc/default/grub and change
@hadisfr
hadisfr / spin.md
Last active December 21, 2023 12:07
How to Use SPIN Model Checker

How to Use SPIN

Run Verifier

It's possible to use spin -a src.pml to create pan.[cbhmt] files. Then, it's possible to compile the generated verifier using gcc -o pan pan.c. The compiler verifier could be run by ./pan. spin -run src.pml automates the whole process.

Rerun After Failure

@hadisfr
hadisfr / pdf_stamp.sh
Last active September 10, 2023 10:39
use pdftk to stamp a pdf on another one
#!/usr/bin/env bash
# PDF Stamper Scrtipt
#
# Author: H@di (info@hadisafari.ir)
#
# pdftk in.pdf multistamp stamp.pdf output out.pdf
# https://www.pdflabs.com/docs/how-to-add-headers-footers-watermarks-and-stamps-to-pdf/
#

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 / shadowsocks_on_ubuntu.md
Created July 20, 2018 05:20
a simple guid to run a shadowsocks proxy on Ubuntu

Run a Shadowsocks Proxy Server on Ubuntu

Install Shadowsocks

It's possible to install ss-server by apt:

apt-get install shadowsocks-libev
@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