Skip to content

Instantly share code, notes, and snippets.

View krobus00's full-sized avatar
🦉

Michael Putera Wardana krobus00

🦉
View GitHub Profile
@hscstudio
hscstudio / adonis-rbac.md
Last active March 2, 2025 01:49
Implementasi Role Base Access Control (RBAC) di AdonisJS

Implementasi Role Base Access Control (RBAC) di AdonisJS

Buat field role (String) pada tabel user

Untuk menentukan role dari user, misalnya apakah di administrator, staff, member, dll

Buat middelware: app/Middleware/Rbac.js

class Rbac {
@geordyjames
geordyjames / eslint_prettier_airbnb.md
Last active October 27, 2025 08:29
VSCode - ESLint, Prettier & Airbnb Setup for Node.js Projects

VSCode - ESLint, Prettier & Airbnb Setup for Node.js Projects

1. Install ESLint & Prettier extensions for VSCode

Optional - Set format on save and any global prettier options

2. Install Packages

npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-config-airbnb-base eslint-plugin-node eslint-config-node
@giuliano-macedo
giuliano-macedo / simpleroutertopo.py
Last active July 21, 2022 02:55
simple mininet custom topology with static routing
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.node import Node
from mininet.log import setLogLevel, info
from mininet.cli import CLI
class LinuxRouter( Node ):
"""A Node with IP forwarding enabled.
Means that every packet that is in this node, comunicate freely with its interfaces."""
@yangl1996
yangl1996 / mininet.py
Last active May 7, 2021 03:42
Parking Lot Topology for Mininet
#!/usr/bin/python
"""
hl hr
7.100 8.100
| |
7.1 8.1
r1--9--r2--10-r3--11-r4--12-r5--13-r6
1.1 2.1 3.1 4.1 5.1 6.1
| | | | | |
@tovask
tovask / mininet_mptcp_setup.sh
Last active June 23, 2023 12:34
Setup an MPTCP test in mininet
# creating a virtual Ubuntu (14.04) on AWS EC2 (t2.micro)
# install MPTCP
sudo apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys 379CE192D401AB61
sudo echo -e "\n\n# for MPTCP\ndeb https://dl.bintray.com/cpaasch/deb jessie main\n" >> /etc/apt/sources.list
sudo apt-get update
sudo apt-get install linux-mptcp
# reboot
sudo reboot
# verify
@leommoore
leommoore / file_magic_numbers.md
Last active March 19, 2026 17:24
File Magic Numbers

File Magic Numbers

Magic numbers are the first bits of a file which uniquely identify the type of file. This makes programming easier because complicated file structures need not be searched in order to identify the file type.

For example, a jpeg file starts with ffd8 ffe0 0010 4a46 4946 0001 0101 0047 ......JFIF.....G ffd8 shows that it's a JPEG file, and ffe0 identify a JFIF type structure. There is an ascii encoding of "JFIF" which comes after a length code, but that is not necessary in order to identify the file. The first 4 bytes do that uniquely.

This gives an ongoing list of file-type magic numbers.

Image Files