Skip to content

Instantly share code, notes, and snippets.

View mahmoudimus's full-sized avatar
💭
@_@

Mahmoud Rusty Abdelkader mahmoudimus

💭
@_@
View GitHub Profile
From self[at]sungpae.com Mon Nov 8 16:59:48 2021
Date: Mon, 8 Nov 2021 16:59:48 -0600
From: Sung Pae <self[at]sungpae.com>
To: security@docker.com
Subject: Permissive forwarding rule leads to unintentional exposure of
containers to external hosts
Message-ID: <YYmr4l1isfH9VQCn@SHANGRILA>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
protocol="application/pgp-signature"; boundary="QR1yLfEBO/zgxYVA"
@mahmoudimus
mahmoudimus / readme.md
Created June 20, 2022 21:30 — forked from thomasdarimont/readme.md
Keycloak Client Role Mapper / User Role Mapper multivalued roles rendering

AccessToken with client role mapper and realm role mapper set to multivalue: "false"

{
  "jti": "4320f052-138a-47da-a5bc-1be47cfc5060",
  "exp": 1487009587,
  "nbf": 0,
  "iat": 1487009287,
  "iss": "http://localhost:8081/auth/realms/token-mapper-test",
  "aud": "dummy",
@mahmoudimus
mahmoudimus / gf.sh
Created May 29, 2022 01:11 — forked from Sanix-Darker/gf.sh
[SHELL] git finder
#!/bin/bash
# by d4rk3r
# A smart way to search for a code
# inside your git history whatever the branch you're
# -- Setup :
# -- After getting the bash script
# chmod +x /path/to/gf.sh
@mahmoudimus
mahmoudimus / Node.java
Created May 28, 2022 20:06 — forked from norswap/Node.java
Fast Java Reflection
package demo;
public interface Node {}
@mahmoudimus
mahmoudimus / macos-ramdisk.md
Created March 15, 2022 17:04 — forked from htr3n/macos-ramdisk.md
Creating RAM disk in macOS

Built-in

diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://XXXXX`

where XXXXX is the size of the RAM disk in terms of memory blocks.

Notes:

@mahmoudimus
mahmoudimus / ibe.txt
Created March 13, 2022 15:42 — forked from Zenithar/ibe.txt
Sample Identity Based Encryption (IBE) in Go using NaCL (No Warranty)
A> Generate ephemeral encryption keypair
A> Bob Identity: harp:v1:identity:nH01kx0xukWDuji3hwNNslj_2YKvp0TdnAB6OPzR1B4:1605982091
A> mPk[Alice => Bob] => KEK: 1TyRX0Azt-w3bsy6bvSJ26StzFvp92PC8FFV_YEQSVY
A> Generate DEK
A> Encrypt [Msg] with DEK
A> Encrypt DEK with KEK
A> Send to bob [MasterPub || ts || EphPub || enc(DEK, KEK) || enc(Msg, DEK)]
B> Extract MasterPub, ts and Ephemeral Encryption Public key
B> Authenticate to PKG
@mahmoudimus
mahmoudimus / JavaScript Members Not Bound to Instances.md
Created January 17, 2022 21:54 — forked from dfoverdx/JavaScript Members Not Bound to Instances.md
Why JavaScript class members are not automatically bound to the instance of the class

It took a few years, but I finally understand why member functions of classes in JavaScript aren't automatically bound to their objects, in particular when used in callback arguments.

In most object-oriented languages, functions are members of a class--they exist in memory only once, and when they are called, this is simply a hidden argument of the function which is assigned to the object that's calling it. Python makes this explicit by requiring that the first argument of a class's member function be self (Python's equivalent of this--you can name self whatever you want, but self is the convention).

class MyClass:
@mahmoudimus
mahmoudimus / noargs_setters_builders.md
Created December 1, 2021 07:53 — forked from androidfred/noargs_setters_builders.md
Stop using noargsconstructors and setters (and builders)

Stop using noargsconstructors and setters (and builders)

TLDR summary

Noargsconstructors and setters are outdated, 90's style old school Java. They needlessly allow entire categories of defects that are easily avoided by using only allargsconstructors and no setters. Please stop writing code like that.

Longer version

How many times have you come across (or written) code like this

public class User {
@mahmoudimus
mahmoudimus / idea.properties
Created September 28, 2021 20:47 — forked from lmgeorge/idea.properties
Jetbrains IDE vmoptions template
# Use ${idea.home.path} macro to specify location relative to IDE installation home.
# Use ${xxx} where xxx is any Java property (including defined in previous lines of this file) to refer to its value.
# Note for Windows users: please make sure you're using forward slashes: C:/dir1/dir2.
ide.app.name=webstorm
ide.config.home=${user.home}/.jetbrains/${ide.app.name}
#---------------------------------------------------------------------
# Uncomment this option if you want to customize a path to the settings directory.
#---------------------------------------------------------------------
idea.config.path=${ide.config.home}/config
@mahmoudimus
mahmoudimus / split-pull-requests.md
Created September 12, 2021 19:13 — forked from loilo/split-pull-requests.md
Split a large pull request into two