Skip to content

Instantly share code, notes, and snippets.

View ridhuanhassan's full-sized avatar
:octocat:
free palestine

Ridhuan Hassan ridhuanhassan

:octocat:
free palestine
View GitHub Profile
@ridhuanhassan
ridhuanhassan / envoy_http_dynamic_forward_proxy.yaml
Created May 7, 2023 16:53 — forked from reetasingh/envoy_http_dynamic_forward_proxy.yaml
Envoy to operate as an HTTP dynamic forward proxy
admin:
access_log_path: /tmp/admin_access.log
address:
socket_address:
address: 127.0.0.1
protocol: TCP
port_value: 9901
static_resources:
listeners:
- name: listener_0

The netfilter hooks in the kernel and where they hook in the packet flow

The figure below calls out

  • The netfilter hooks
  • The order of table traversal
@ridhuanhassan
ridhuanhassan / ANSI.md
Created January 31, 2022 16:04 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@ridhuanhassan
ridhuanhassan / gist:b71232d9f7e19ea35dfb2bd82fd7ffdb
Created September 28, 2021 07:04 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@ridhuanhassan
ridhuanhassan / jwtRS256.sh
Created May 25, 2021 02:00 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@ridhuanhassan
ridhuanhassan / submit.md
Created May 5, 2021 18:09 — forked from tanaikech/submit.md
Multipart-POST Request Using Node.js

Multipart-POST Request Using Node.js

Here, I introduce 2 scripts for uploading files to Slack using Node.js as samples. These 2 sample scripts are for uploading files to Slack.

Sample script 1:

  • You can upload the zip file by converting byte array as follows.
    • At first, it builds form-data.
    • Adds the zip file converted to byte array and boundary using Buffer.concat().
    • This is used as body in request.