Skip to content

Instantly share code, notes, and snippets.

View pcmehrdad's full-sized avatar
🏠
Working from home

Mehrdad Amini pcmehrdad

🏠
Working from home
View GitHub Profile
@pcmehrdad
pcmehrdad / cloudflare_update.script
Created May 19, 2022 09:46 — forked from kiler129/cloudflare_update.script
Automatic script for Mikrotik RouterOS updating record on CloudFlare.
#########################################################################
# ================================================== #
# $ Mikrotik RouterOS update script for CloudFlare $ #
# ================================================== #
# #
# - You need a CloudFlare account & api key (look under settings), #
# a zone and A record in it #
# - All variables in first section are obvious, except CFid, #
# To obtain CFid use following command in any unix shell: #
# curl https://www.cloudflare.com/api_json.html -d 'a=rec_load_all' -d 'tkn=YOUR_API_KEY' -d 'email=email@example.com' -d 'z=domain.com'|python -mjson.tool
#!/bin/bash
# Run one of these following commands as root:
# bash <(curl -Ls https://git.io/J9OER)
# bash <(curl -Ls https://gist.github.com/pcmehrdad/2fbc9651a6cff249f0576b784fdadef0/raw)
#RED="\e[31m"
#GREEN="\e[32m"
CLR_RED="\033[1;31m"
CLR_GREEN="\033[1;32m"
@pcmehrdad
pcmehrdad / nginx.conf
Created November 27, 2021 19:16 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@pcmehrdad
pcmehrdad / regular-expression-iranian-mobile.md
Created November 27, 2021 19:15 — forked from AliMD/regular-expression-iranian-mobile.md
Best Regular Expression for Detect Iranian Mobile Phone Numbers

Best Regular Expression for Detect Iranian Mobile Phone Numbers

I'm sure its best regular expression for detect iranian mobile number.

(0|\+98)?([ ]|,|-|[()]){0,2}9[1|2|3|4]([ ]|,|-|[()]){0,2}(?:[0-9]([ ]|,|-|[()]){0,2}){8}


use in javascript

@pcmehrdad
pcmehrdad / cloud-init.sh
Created January 19, 2021 08:22 — forked from ebal/cloud-init.sh
Cloud-init example using a Generic Cloud CentOS-7 on a libvirtd qmu/kvm lab
#!/bin/sh
if [ "$EUID" -ne 0 ]; then
echo -e "\nPlease run as root\neg. sudo $0 \n"
exit
fi
GITHUB_USERNAME="ebal"
cd `mktemp -d`
@pcmehrdad
pcmehrdad / pipeline.sh
Created January 12, 2021 20:00 — forked from ssbostan/pipeline.sh
Write CI/CD Pipeline with Bash
#!/bin/bash
# Copyright (c) 2020, Saeid Bostandoust
# ssbostan@linuxmail.org
# https://b9t.ir
# All rights reserved.
PIPELINE_PROJECT_NAME="YOUR-PROJECT-NAME"
if [[ ! -d "./$PIPELINE_PROJECT_NAME" ]]; then
git clone YOUR-GIT-ADDRESS
fi
http://feedburner.google.com/fb/a/pingsubmit?bloglink=https://your-site-with-slash/
http://rpc.weblogs.com/pingsiteform?name=yourwebsite&url=https://your-site-no-slash
http://bing.com/webmaster/ping.aspx
http://ping.blo.gs/
http://blog.goo.ne.jp/xmlrpc
http://blog.with2.net/ping.php
http://blogping.unidatum.com/rpc2
http://blogpingr.de/ping/rpc2
https://ping.blogs.yandex.ru/rpc2
http://blogsearch.google.co.cr/ping/rpc2