Skip to content

Instantly share code, notes, and snippets.

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

Mahmoud Rusty Abdelkader mahmoudimus

💭
@_@
View GitHub Profile
@mahmoudimus
mahmoudimus / 0: jvm-options-java8.conf
Created June 14, 2021 17:16 — forked from elifarley/0: jvm-options-java8.conf
JVM options to maximize performance
# See https://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html
# See https://docs.oracle.com/javase/8/docs/technotes/guides/vm/performance-enhancements-7.html
# See https://docs.oracle.com/javase/8/embedded/develop-apps-platforms/codecache.htm
# See http://normanmaurer.me/blog_in_progress/2013/11/07/Inline-all-the-Things/
# See http://stas-blogspot.blogspot.com.br/2011/07/most-complete-list-of-xx-options-for.html
# -XX:+LogCompilation
# -XX:+PrintInlining
-Dfile.encoding=UTF-8
#!/usr/bin/env awk -f
# Based on the idea from https://blogs.oracle.com/taylor22/entry/using_r_to_analyze_g1gc, the
# script is updated to use the format of the gc logs as received with the parameters:
# -XX:+UseThreadPriorities
# -XX:ThreadPriorityPolicy=42
# -Xms1995M -Xmx1995M
# -Xss256k -XX:StringTableSize=1000003
# -XX:SurvivorRatio=8
# -XX:MaxTenuringThreshold=1
@mahmoudimus
mahmoudimus / all.txt
Created May 17, 2021 02:44 — forked from jhaddix/all.txt
all wordlists from every dns enumeration tool... ever. Please excuse the lewd entries =/
This file has been truncated, but you can view the full file.
.
..
........
@
*
*.*
*.*.*
🐎
@mahmoudimus
mahmoudimus / convert to pkcs 8.md
Created April 8, 2021 18:31 — forked from markscottwright/convert to pkcs 8.md
How to convert a java private key from PKCS#1 encoding to PKCS#8

I had some historical key material data in pkcs#1 format that needed to be in pkcs#8 for input into another system. Here's how to do it, using BouncyCastle:

import org.bouncycastle.asn1.ASN1InputStream;
import org.bouncycastle.asn1.DERObject;
import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers;
import org.bouncycastle.asn1.pkcs.PrivateKeyInfo;
import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
import java.security.PrivateKey;
@mahmoudimus
mahmoudimus / Linux_StartScript.sh
Created April 6, 2021 00:44 — forked from Permanently/Linux_StartScript.sh
Linux_StartScript.sh (deletes worlds if toggled)
#!/bin/bash
#By Kristjan Krusic aka. krusic22
#Don't forget to adjust the variables according your own needs!
#This is an Java 11+ optimised script! Get the most recent AdoptJDK or ZuluJDK for ARM.
#This script is speed-optimized and won't reduce ram use!
#Less time spent on GC, the better the performance, but possibly higher ram usage.
#Note: 1G = 1024M
STARTRAM=128 #USE VALUES IN M! Sometimes setting this to the same value as MAXRAM can help performance.
MAXRAM=1024 #USE VALUES IN M!
JARNAME=paper.jar #Jar name, quite self-explanatory.
import java.util.*;
/**
* A demo Java application to see how GC works.
*
* @author Thanh Nguyen
*/
public class GcMemDemo {
static Map<Long, byte[]> buffer = new HashMap<>();
@mahmoudimus
mahmoudimus / idea.vmoptions
Last active April 6, 2021 00:35
Better performance vmoptions for 2020.1 intellij
-Xms1024m
-Xmx3072m
-Xss64m
-Dfile.encoding=UTF-8
-Djava.net.preferIPv4Stack=true
-Dsun.io.useCanonCaches=false
-XX:+AggressiveOpts
-XX:+AlwaysPreTouch
-XX:+CMSClassUnloadingEnabled
-XX:+CMSIncrementalMode
@mahmoudimus
mahmoudimus / clip_magic.py
Last active April 5, 2021 19:34 — forked from bwagner/clip_magic.py
copy to clipboard ipython magic
"""
Add copy to clipboard from IPython!
To install, just copy it to your profile/startup directory, typically:
~/.ipython/profile_default/startup/
i.e. ~/.ipython/profile_default/startup/clip_magic.py
Example usage:
@mahmoudimus
mahmoudimus / create_chrootjail.sh
Created February 20, 2021 16:39 — forked from schnell18/create_chrootjail.sh
Script to automate the creation of chroot jail w/ minimal executables to run git.
#!/bin/sh
# script to automate the creation of chroot jail
# w/ minimal executables to run git
export CHROOT=/var/chroot
function copy_binary() {
for i in $(ldd $*|grep -v dynamic|cut -d " " -f 3|sed 's/://'|sort|uniq)
do
cp --parents $i $CHROOT
@mahmoudimus
mahmoudimus / InstallDebian-HOWTO.md
Created February 19, 2021 20:46 — forked from varqox/install_debian_with_debootstrap_howto.md
Instruction how to install Debian using debootstrap

Warning

This is a tutorial from 2016, originally for installing debian jessie, it may work for newer versions of debian, but I haven't check it (however, it should mostly work because not that much changed since then). You may want to change every occurrence of buster to a name of a new version of debian.

Install debootstrap

Make work directory:

mkdir work
cd work