Skip to content

Instantly share code, notes, and snippets.

View shakibamoshiri's full-sized avatar

Shakiba Moshiri shakibamoshiri

View GitHub Profile
@TechNickAI
TechNickAI / limit_bandwidth.bash
Created May 31, 2023 18:51
Limit Bandwidth by port
#!/bin/bash
# A script to limit the outgoing bandwidth of the consensus and execution layers by port
# We do this because the highest cost for running a node in AWS is the outgoing bandwidth
# Define your ports and their corresponding rate limits
declare -A ports=([30303]="500kbit" [9000]="1mbit")
# Define arbitrary class IDs for each port
declare -A class_ids=([30303]=1 [9000]=2)
@leandronsp
leandronsp / 001-server.bash
Last active July 18, 2024 08:54
A complete yet simple Web server (with login & logout system) written in Shell Script
#!/bin/bash
## Create the response FIFO
rm -f response
mkfifo response
function handle_GET_home() {
RESPONSE=$(cat home.html | \
sed "s/{{$COOKIE_NAME}}/$COOKIE_VALUE/")
}
@andytryn
andytryn / static_ip.txt
Created November 7, 2021 03:50
Manjaro set static IP Address
# install netctl
sudo pacman -S netctl --noconfirm
# check network card name
ip link
### Config Static IP Address ###
# Card Name : eth0
sudo cp /etc/netctl/examples/ethernet-static /etc/netctl/eth0
@PhilipSchmid
PhilipSchmid / minio-upload.sh
Created November 19, 2020 13:38
Upload data to Minio using CURL
#!/bin/bash
# Usage: ./minio-upload my-bucket my-file.zip
bucket=$1
file=$2
host=minio.example.com
s3_key=svc_example_user
s3_secret=svc_example_user_password
$ pkg update
$ pkg install nmap
@qdm12
qdm12 / README.md
Last active October 29, 2024 23:50
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.

Assumptions

This should fit most setups (not mine though 😉)

@blurayne
blurayne / ui-widget-select.sh
Last active November 2, 2024 19:45
Pure BASH interactive CLI/TUI menu (single and multi-select/checkboxes)
#!/bin/bash
##
# Pure BASH interactive CLI/TUI menu (single and multi-select/checkboxes)
#
# Author: Markus Geiger <[email protected]>
# Last revised 2019-09-11
#
# ATTENTION! TO BE REFACTORED! FIRST DRAFT!
#
@fnky
fnky / ANSI.md
Last active November 16, 2024 01:32
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@lokimeyburg
lokimeyburg / pm-interview-questions.md
Last active October 10, 2024 06:42
Product Manager Interview Questions

Product Manager Interview Questions

General Questions:

  • Tell me about yourself.
  • Tell me about the most boring job you have ever had.
  • What changes would you make if you came on board?
  • What would you say to your boss if he is crazy about an idea, but you think it stinks?
  • Assuming that you are selected, what will be your strategy for next 60 days?
  • why are not you earning more money at this stage of your career?
@akpoff
akpoff / curl_imap_query_commands.md
Created January 2, 2018 17:29
curl commands to query imap servers

curl commands to query imap servers

Based on https://busylog.net/telnet-imap-commands-note/

curl options

  • -k -- don't verify certificate (optional)
  • -n -- use .netrc for username and password (optional)
  • -X -- request to send to server