Skip to content

Instantly share code, notes, and snippets.

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

Mahmoud Rusty Abdelkader mahmoudimus

💭
@_@
View GitHub Profile
@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
@mahmoudimus
mahmoudimus / ChangeAnnotationAtRuntime.java
Created November 6, 2020 17:46 — forked from henrrich/ChangeAnnotationAtRuntime.java
Modify annotation at runtime, java 8 support
public final class RuntimeAnnotations {
private static final Constructor<?> AnnotationInvocationHandler_constructor;
private static final Constructor<?> AnnotationData_constructor;
private static final Method Class_annotationData;
private static final Field Class_classRedefinedCount;
private static final Field AnnotationData_annotations;
private static final Field AnnotationData_declaredAnotations;
private static final Method Atomic_casAnnotationData;
private static final Class<?> Atomic_class;
@mahmoudimus
mahmoudimus / wget.sh
Created October 16, 2020 19:13 — forked from crittermike/wget.sh
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
@mahmoudimus
mahmoudimus / Mortal-Kombat-II-moves_SNES.md
Created October 16, 2020 00:21 — forked from pjetr/Mortal-Kombat-II-moves_SNES.md
Moves for Mortal Kombat 2 on Super Nintendo (SNES), found the list at https://www.gamefaqs.com/snes/588500-mortal-kombat-ii/faqs/5570 and converted it to markdown.

CONTROLS AND MOVES

SNES STANDARD CONTROLLER CONFIGURATION

  • Low Punch: B
  • High Punch: Y
  • Low Kick: A
  • High Kick: X
  • Block: L, R
  • Down: D
  • Up: U
@mahmoudimus
mahmoudimus / link-icloud-drive.sh
Created October 7, 2020 23:22 — forked from ecridge/link-icloud-drive.sh
Add a symbolic link to iCloud Drive in Bash on macOS.