Skip to content

Instantly share code, notes, and snippets.


Shakiba Moshiri shakibamoshiri

View GitHub Profile
shakibamoshiri / 001-server.bash
Created Aug 30, 2022 — forked from leandronsp/001-server.bash
A complete yet simple Web server (with login & logout system) written in Shell Script
View 001-server.bash
## Create the response FIFO
rm -f response
mkfifo response
function handle_GET_home() {
RESPONSE=$(cat home.html | \
shakibamoshiri /
Created Jul 18, 2022 — forked from fnky/
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
shakibamoshiri /
Created Apr 15, 2022 — forked from qdm12/
Wireguard and iptables restrictions for multiple users

Wireguard and iptables restrictions for multiple users

If you don't know what Wireguard is, well, you should. It's fast, easy to setup and highly configurable. We will configure Wireguard for multiple users with various restrictions using iptables.


This should fit most setups (not mine though 😉)

View install and test poshtiban CLI
# On linux servers
# cd into a temp dir
cd `mktemp -d`
# install it
npm install poshtiban
# test it
./node_modules/poshtiban/bin/run login --token=YOUR_TOKEN
shakibamoshiri /
Created Jul 31, 2020 — forked from htp/
Test a WebSocket using curl.
curl --include \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host:" \
--header "Origin:" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
shakibamoshiri /
Created Jul 23, 2020 — forked from noelboss/
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like or and pull or export it to a production server. Or you use a service like to act upon a Web-Hook that's triggered that service.

shakibamoshiri / chat-frontend.js
Created Jul 3, 2018 — forked from martinsik/chat-frontend.js
Node.js chat frontend and server
View chat-frontend.js
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;