Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mahdi13's full-sized avatar
🏝️
I'm still working on my masterpiece

Mahdi Perfect mahdi13

🏝️
I'm still working on my masterpiece
View GitHub Profile
@mahdi13
mahdi13 / cafebazaar_rollout.py
Last active August 30, 2023 15:41
Release (deploy) new versions of android app (apk file) to cafebazaar automatically. Great to be used on CI/CD pipelines
import hashlib
import json
import os
import requests
import urllib3
class CafeBazaarClient:
@mahdi13
mahdi13 / myket_rollout.py
Last active August 5, 2023 09:25
Release (deploy) new versions of android app (apk file) to myket automatically. Great to be used on CI/CD pipelines
import hashlib
import uuid
import requests
class MyketClient:
def __init__(self, package_name, username, password):
self.url = 'https://developer.myket.ir/api'
self.resource_url = 'https://resource.myket.ir'
@mahdi13
mahdi13 / git-insight.sh
Created July 10, 2021 08:33
git command line insight
#!/usr/bin/env bash
(git log --reverse --pretty='format:%C(auto)%h (%s, %ad)' | head -3 ) && echo "..." && git --no-pager shortlog -s -n --all --no-merges && echo "..." && (git log --reverse --pretty='format:%C(auto)%h (%s, %ad)' | tail -3 )
@mahdi13
mahdi13 / docker-compose.yml
Created April 11, 2021 10:38
Docker compose triangular Binance arbitrage on (almost) all markets
version: '3.6'
services:
btrader_usdt:
image: gabrielmilan/btrader:latest
container_name: btrader_usdt
volumes:
- ./config_usdt.json:/config.json:ro
network_mode: "host"
command: /bin/sh -c "sleep 0 && btrader /config.json"
import random
import time
class Market:
def __init__(self):
self.time = 0
self.change = 0.0
self.market_price = 10000.0
@mahdi13
mahdi13 / ViaBtcExchangeHttpClient.py
Created January 12, 2019 11:36
The RPC HTTP API client of viabtc exchange server (https://github.com/viabtc/viabtc_exchange_server)
import json
import requests
"""
Created by @mahdi13
The RPC HTTP API client of viabtc exchange server (https://github.com/viabtc/viabtc_exchange_server)
Reference: https://github.com/viabtc/viabtc_exchange_server/wiki/HTTP-Protocol
@mahdi13
mahdi13 / perfect-token.bytecode
Created January 31, 2018 13:58
Perfect Token
{
"linkReferences": {},
"object": "606060405234156200001057600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040805190810160405280600381526020017f5052460000000000000000000000000000000000000000000000000000000000815250600290805190602001906200009d929190620001f6565b506040805190810160405280600d81526020017f5065726665637420546f6b656e0000000000000000000000000000000000000081525060039080519060200190620000eb929190620001f6565b506012600460006101000a81548160ff021916908360ff1602179055506a52b7d2dcc80cd2e400000060058190555060055460066000736884b21c7823748481db007c7eed00054ba9f70773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550736884b21c7823748481db007c7eed00054ba9f70773ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60055460405180828152602001915050604051809
@mahdi13
mahdi13 / gist:61729ac2e0236520dbc25ead7753cb98
Created January 23, 2018 03:37
open-ethereum-pool mining software commands
# Claymore
./ethdcrminer64 -epool 1.2.3.4:8008 -ewal 0xb9bb0781f80132c08f5bcf933d8d9c7cb9c37d69 -eworker zeusGPU -epsw x -mode 1 -ftime 10 -allpools 1 -esm 0
# Ethminer
./ethminer -F http://185.105.186.125:8888/0xD69af2A796A737A103F12d2f0BCC563a13900E6F/salam -G
@mahdi13
mahdi13 / pptpd-ip-routs
Created December 10, 2017 20:56
pptpd-ip-routs
sudo iptables -I INPUT -p tcp --dport 1723 -m state --state NEW -j ACCEPT
sudo iptables -I INPUT -p gre -j ACCEPT
sudo iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -s 172.20.1.0/24 -j TCPMSS --clamp-mss-to-pmtu
sudo iptables-save
@mahdi13
mahdi13 / object_proxy.py
Last active December 3, 2017 09:09
Some kind of transparent proxy to implement `singleton` beautifully
"""
Some kind of transparent proxy to implement `singleton` beautifully.
Thanks to:
* @pylover
* https://github.com/pylover/pymlconf (again @pylover!)
Usage: