Skip to content

Instantly share code, notes, and snippets.

View m2sh's full-sized avatar
🤔
hmm!

Mohammad Shahgolzadeh m2sh

🤔
hmm!
View GitHub Profile
@sau-lanvy
sau-lanvy / kubernetes-cluster-using-kubespray.md
Last active March 21, 2025 14:12
Deploy a Production Ready Kubernetes Cluster using Kubespray with Ansible

Deployment Architecture

deployment architecture

System Configuration

  1. All kubernetes nodes: set SELINUX to permissive mode
$ vi /etc/selinux/config
SELINUX=permissive

$ setenforce 0
@ezimuel
ezimuel / static.php
Created July 17, 2018 16:30
Swoole HTTP static file server example
<?php
// Simple HTTP static file server using Swoole
$host = $argv[1] ?? '127.0.0.1';
$port = $argv[2] ?? 9501;
$http = new swoole_http_server($host, $port);
// The usage of enable_static_handler seems to produce errors
// $http->set([
@numb95
numb95 / route-all-traffic-through-tor.md
Last active August 19, 2024 21:17
Route all internet traffic through Tor

Do not use in production Server or if you don't know what iptables do

Add this to torrc ( located on /etc/tor/torrc):

VirtualAddrNetwork 10.192.0.0/10

AutomapHostsOnResolve 1

TransPort 9051 
@amrza
amrza / private-access.java
Last active February 26, 2018 05:55
Objects of the same type will have access to each others private and protected members even though they are not the same instances! WTF!
// Person.class
//-------------------------
class Person {
private String name;
public Person(String name) {
this.name = name;
}
# using:
# for set proxy:
# $ setproxy 127.0.0.1 8118
# for unset:
# $ unsetproxy
function setproxy() {
export {http,https,ftp,HTTP,HTTPS}_proxy=http://$1:$2
export no_proxy="localhost,127.0.0.1,master.cafecluster"
echo "Proxy variable(http,https,ftp) set to $1:$2"
@xujiaao
xujiaao / android-set-ntp-server.md
Last active May 4, 2025 12:55
Set the NTP server of your android device
tags
Android
Android Things

Set the NTP server of your android device

@pkern
pkern / Makefile
Last active December 4, 2023 15:58
OpenWRT package for sniproxy
include $(TOPDIR)/rules.mk
PKG_NAME:=sniproxy
PKG_VERSION:=0.6.0
PKG_RELEASE:=1
PKG_SOURCE_URL:=https://github.com/dlundquist/sniproxy/archive/
PKG_SOURCE:=$(PKG_VERSION).tar.gz
PKG_MD5SUM:=bcfb5d1efe045b8b356a4229f2339f02
@gaquino
gaquino / gist:87bdf0e6e852e445c0489379d3e9732a
Last active April 21, 2025 20:35
MacOS (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools))
If you are facing an error like that on new MacOS version.
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
It means that you need to install XCode command line, open a Terminal and run this command:
$ xcode-select --install
Note:
If you want to download and install Command Line tools manually, it can be downloaded from: https://developer.apple.com/download/more/
/**
* Open https://app.snapp.ir
* Login with your credentials
* Copy and pasting this code in developer tools console
* Waiting... :)
*/
(async function () {
function sleep(ms = 0) {
return new Promise(r => setTimeout(r, ms));
}
// # Usage
//
// Save this file and replace username and password on the last line of the file with
// your Snapp username and password then run the following commands:
//
// yarn init && yarn add request
// node SnappTotalPriceCalculator.js
//
const request = require('request');