Skip to content

Instantly share code, notes, and snippets.

View ImanMousavi's full-sized avatar

Iman ImanMousavi

View GitHub Profile
@ImanMousavi
ImanMousavi / run-a-vpn-in-a-docker-container-using-softether.sh
Last active August 31, 2020 14:53
Run a VPN in a Docker Container Using SoftEther
sudo docker run -d -p 500:500/udp -p 4500:4500/udp -p 1701:1701/tcp -p 1194:1194/udp --name softether-vpn -e PSK=En4EW25eI0 -e USERNAME=iman -e PASSWORD=20WSs7Ff4YSm siomiz/softethervpn
#!/bin/bash
cd ~
# tmux session name
SN=PRIVXMR
tmux kill-session -t $SN
cd ~/testnet
@ImanMousavi
ImanMousavi / XKB IR Keyboard
Created July 18, 2020 18:04 — forked from amiraliakbari/XKB IR Keyboard
XKB Customized Persian Keyboard Layout
// Iranian keyboard layout
// Replace with "/usr/share/X11/xkb/symbols/ir"
// Customized Version
////////////////////////////////////////
// Persian layout,
// based on
// Information Technology – Layout of Persian Letters and Symbols on Computer Keyboards
// ISIRI 9147 – 1st Edition
#=============================================================================
# dark_powered.toml --- dark powered configuration example for SpaceVim
# Copyright (c) 2016-2017 Wang Shidong & Contributors
# Author: Wang Shidong < wsdjeg at 163.com >
# URL: https://spacevim.org
# License: GPLv3
#=============================================================================
# All SpaceVim option below [option] section
[options]
@ImanMousavi
ImanMousavi / start_docker_registry.bash
Last active June 7, 2020 13:44 — forked from PieterScheffers/start_docker_registry.bash
Start docker registry with letsencrypt certificates (Linux Ubuntu)
#!/usr/bin/env bash
# install docker
# https://docs.docker.com/engine/installation/linux/ubuntulinux/
# install docker-compose
# https://docs.docker.com/compose/install/
# install letsencrypt
# https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04
@ImanMousavi
ImanMousavi / socket_check.py
Created February 16, 2020 12:45
check network port in python
# test if an [ip:port] is open
import socket
def isOpen(ip,port):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
s.connect((ip, int(port)))
s.shutdown(2)
return True
@ImanMousavi
ImanMousavi / reset_sequence.sql
Created December 1, 2019 09:44
reset All sequence in postgresql
SELECT
tablename,
reset_sequence ( C.tablename, 'id', C.tablename || '_id_seq' )
FROM
pg_catalog.pg_tables AS "c"
WHERE
schemaname <> 'pg_catalog'
AND schemaname <> 'information_schema'
AND tablename NOT IN ( 'layer', 'spatial_ref', 'spatial_ref_sys', 'combination_has_province', 'statement', 'combination_has_category', 'combination_has_city', 'discount_has_category', 'value' );
@ImanMousavi
ImanMousavi / speedtest.py
Last active December 31, 2019 09:58
speed test in terminal
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2019 Iman Mousavi
# Use : curl -s https://gist.githubusercontent.com/irmaster/a7abd59737aea230426e52a1275bcb03/raw/5b5d0a012e279d2c5eb742aadf3f197f2a6c2ebb/speedtest.py | python -
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
@ImanMousavi
ImanMousavi / GenerateEthereumWallet.php
Last active November 28, 2022 06:14 — forked from onimusya/GenerateEthereumWallet.php
Generate Ethereum Wallet using PHP
<?php
require_once "vendor/autoload.php";
use Sop\CryptoTypes\Asymmetric\EC\ECPublicKey;
use Sop\CryptoTypes\Asymmetric\EC\ECPrivateKey;
use Sop\CryptoEncoding\PEM;
use kornrunner\keccak;
/**
@ImanMousavi
ImanMousavi / litecoin.conf
Created September 25, 2018 14:29
litecoin config
paytxfee=0.00000000
minrelaytxfee=0.00000000
minmempoolfee=0.00000000
mintxfee=0.0000001
discardfee=0
minrelayfee=0