Skip to content

Instantly share code, notes, and snippets.

View mort3za's full-sized avatar
🕸️

Morteza Ziyaeimehr mort3za

🕸️
View GitHub Profile
@mort3za
mort3za / iran-states-cities.json
Created July 3, 2017 16:41
Iran cities and states in json format
{
"result": {
"states": [
"آذربایجان شرقی",
"آذربایجان غربی",
"اردبیل",
"اصفهان",
"البرز",
"ایلام",
"بوشهر",
@mort3za
mort3za / to-mp4.sh
Last active December 2, 2023 01:45
Convert video to mp4 acc with ffmpeg, https://bit.ly/m3ffmpeg
# install ffmpeg on windows machines: http://www.wikihow.com/Install-FFmpeg-on-Windows
ffmpeg -i inputfile.mp4 -r 24 -crf 18 -vcodec h264 -acodec aac outputfile.mp4
@mort3za
mort3za / sorinethotels-maryam-features.txt
Created October 8, 2017 15:57
ویژگی‌های اصلی هتل سورینت مریم
<div class="row">
<div class="large-4 column">
<h2 class="sec-title">ویژگی‌های اصلی هتل</h2>
</div>
<div class="large-20 column">
<dl class="row large-up-4">
<dd class="column"><i class="fa fa-wifi"></i>اینترنت وای‌فای</dd>
<dd class="column"><i class="fa fa-plane"></i>انتقال از فرودگاه</dd>
<dd class="column"><i class="fa fa-bell"></i>روم سرویس</dd>
@mort3za
mort3za / git-auto-sign-commits.sh
Last active May 28, 2024 20:51
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
@mort3za
mort3za / debugging.md
Created February 15, 2018 08:20
How to debug nodejs applications?

Nodejs debugging:

node inspect app.js
type in console: c (continue to end), n (next expression), repl (go into repl mode and do modifications or log), list(10) to see 10 lines of code.
type debugger; inside code (similar to breakpoint)


Nodejs debug with chrome-dev-tools:

nodemon inspect-brk app.js
go to chrome://inspect
click to open dedicated devtools for Nodejs

@mort3za
mort3za / torrc
Last active March 14, 2024 14:44
Using tor with bridges, torrc example config (bit.ly/m3torrc)
# sudo apt-get install obfs4proxy obfsproxy tor
# sudo vi /etc/tor/torrc
UseBridges 1
ClientTransportPlugin obfs3 exec /usr/bin/obfsproxy managed
ClientTransportPlugin obfs4 exec /usr/bin/obfs4proxy managed
# send email to bridges@torproject.org with body `get transport obfs4` you can get new bridges.
bridge obfs4 195.154.49.15:44705 BACD07DACE996093DC7635F33A98C49... cert=xc/wtKNWADfJQf232xSXT0WpzsaINw6fgPvZBy5Rkw4.../ypaZPDug9L... iat-mode=0
@mort3za
mort3za / regex.md
Created June 1, 2018 15:55
Brief notes of regex (regular expression)

Regular expression brief notes

Greedy vs lazy evaluation

/<div>.+</div>/
This will not match <div>text</div> because .+ consumes </div> characters. .+ uses greedy evaluation.
/<div>.+?</div> This will match text because .+? uses lazy evaluation and returns control to next expression as it finds first match.

@mort3za
mort3za / setup docker leader
Created June 20, 2018 09:53 — forked from alirezabonab/setup jenkins, portainer and registry on docker
docker service with portainer jenkins and registry
#!/usr/bin/env bash
DOCKER_PATH=$(which docker)
# PORT Number Definition
# ----------------------------------------------
# system ports
PORT_JENKINS="9110"
PORT_PORTAINER="9120"
@mort3za
mort3za / install-php5.6-ubuntu.sh
Last active February 15, 2024 14:16
Install php 5.6 and composer in ubuntu 18.04
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php5.6
php --version
sudo apt-get install php5.6-curl php5.6-xml
sudo apt-get install composer