Skip to content

Instantly share code, notes, and snippets.

View yeganemehr's full-sized avatar
👋
Let's Do It

Amir H. Yeganemehr yeganemehr

👋
Let's Do It
View GitHub Profile
@yeganemehr
yeganemehr / semanticVersioningConversion.js
Last active March 6, 2023 00:41 — forked from dislick/semanticVersioningConversion.js
Convert Semantic Versioning String to Integer in ES6
/**
* Convert a sematic versioning string into an 32-bit integer.
*
* Make sure the input string is compatible with the standard found
* at semver.org. Since this only uses 10-bit per major/minor/patch version,
* the highest possible SemVer string would be 1023.1023.1023.
* @param {string} version SemVer string
* @return {number} Numeric version
*/
const convertVersionToInt32 = function(version) {
@yeganemehr
yeganemehr / README.md
Created April 10, 2022 10:30
Block traffic to cpanel-nginx websites

HOWTO use

Put blocked-all-ips.conf file to /etc/nginx/conf.d/users/{user} directory and then reload nginx (nginx -s reload)

How to setup MTProxy using nginx stream proxy

There are two servers in this configuration: * 192.168.1.101 which used to server the clients directly. * 192.168.1.202 is backend server and clients doesn't aware of.

On 192.168.1.202

Install MTProxy:

@yeganemehr
yeganemehr / oscdimg.bat
Created August 13, 2019 18:41
create a bootable Windows ISO using WAIK
oscdimg -m -o -u2 -udfver102 -bootdata:2#p0,e,bboot\etfsboot.com#pEF,e,befi\microsoft\boot\efisys.bin C:\windows-server-2016 C:\windows-server-2016.iso
@yeganemehr
yeganemehr / iran-provinces-coordinates.json
Created August 30, 2016 22:01
Coordinates provinces of Iran
{
"@copyright" : "https://fa.wikipedia.org/wiki/%D9%85%D8%AE%D8%AA%D8%B5%D8%A7%D8%AA_%D9%85%D8%B1%DA%A9%D8%B2_%D8%A7%D8%B3%D8%AA%D8%A7%D9%86%E2%80%8C%D9%87%D8%A7%DB%8C_%D8%A7%DB%8C%D8%B1%D8%A7%D9%86",
"East Azerbaijan": {
"Lat": 38.052468,
"Lng": 46.284993
},
"West Azerbaijan": {
"Lat": 37.529607,
"Lng": 45.046549
},