Skip to content

Instantly share code, notes, and snippets.

View LukeHuckman's full-sized avatar

Darkpelz LukeHuckman

  • Malaysia
View GitHub Profile
@LukeHuckman
LukeHuckman / start.sh
Last active April 27, 2022 12:29
Minecraft Paper server startup script using GNU Screen (compatible with Linux and WSL on dual boot systems)
#!/bin/bash
windowspath=#Windows-equivalent server path goes here
linuxpath=#Linux-equivalent server path goes here
winhost=#WSL hostname goes here
#Check if the server is already running
if $(screen -list | grep -q minecraft); then
exec screen -x minecraft
else
@LukeHuckman
LukeHuckman / start.sh
Last active February 25, 2023 21:07
Minecraft server startup script for Paper using Aikar's flags
#!/bin/bash
serverpath="" #Server directory goes here
#Check if the server is already running
if $(screen -list | grep -q minecraftserver); then
exec screen -x minecraftserver
else
#Start the server in a screen
if [ -z "$STY" ]; then
screen -mdS minecraftserver /bin/bash -c "
@LukeHuckman
LukeHuckman / .zshrc
Last active August 13, 2021 16:26
Custom .zshrc created from combining defaults from several distros
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/milo/.zshrc'
autoload -Uz compinit
compinit
@LukeHuckman
LukeHuckman / arch-install-uefi-systemd-boot.txt
Last active April 9, 2022 09:49
Step by step basic installation of Arch Linux with systemd-boot on a UEFI system
Step 1: Partition and format disks
List disks,
iso# fdisk -l
Select disk,
iso# fdisk /dev/X // Replace X with a storage device
// SATA drives: sda, sdb, sdc...
// NVMe drives: nvme0n1, nvme1n1, nvme2n1...
Create a GPT partiton table,
iso[fdisk]# g
Create partitions for ESP, root, and (optionally) swap, // For swapfile, see step 4.5
@LukeHuckman
LukeHuckman / update-server.sh
Last active June 23, 2021 21:30
Minecraft server update script for Paper using API v2
#!/bin/bash
serverpath="" #Server directory goes here
#Create update directory if it doesn't exist
if [ ! -d "$serverpath/update" ]; then
mkdir $serverpath/update
fi
#Check for server updates
cd $serverpath/update
@LukeHuckman
LukeHuckman / SameKey.c
Last active June 23, 2021 22:39
Computer Penetration Tutorial: Deciphering multiple plaintexts encryped with the same key and finding the key
#include <stdio.h>
#include <stdbool.h>
#define NO_OF_WORDS 24
#define LENGTH 6
int main() {
unsigned char ctxt[NO_OF_WORDS][LENGTH] = { // Ciphertext
{0xd1, 0x0d, 0x01, 0x90, 0xaa, 0x80},
{0xd9, 0x11, 0x11, 0x87, 0xb6, 0x9b},
@LukeHuckman
LukeHuckman / SimpleCrypto.txt
Created June 23, 2021 22:45
Process steps for Feistel Cipher and S-DES
Feistel Cipher
Step 1: Split the bits in half, L0 and R0
Step 2: R0 XOR K1 = X1
Step 3: L0 XOR X1 = X2 = R1
Step 4: R0 = L1
Step 5: Repeat for n rounds
S-DES
@LukeHuckman
LukeHuckman / PKGBUILD
Last active August 13, 2021 17:44
PKGBUILD for Marwaita Icons
_style=blue # Change to "yellow" if desired
pkgname=marwaita-icons-${_style}-git
_gitname=Marwaita-Icons
pkgver=r23.51850df
pkgrel=1
pkgdesc="A clean and simple icon pack"
arch=('any')
url="https://github.com/LukeHuckman/${_gitname}"
license=('CC0')
if [ $_style == "blue" ]; then
@LukeHuckman
LukeHuckman / kernelcheck.sh
Last active September 16, 2023 19:12
Linux kernel version checker script for Arch Linux using yay
#!/bin/sh
#
#Linux kernel version checker script for Arch Linux
#
kernelVariant=$(uname -r | rev | cut -d "-" -f 1 | rev)
versionDiff=$(diff <(uname -r | cut -d "-" -f 1 | cut -d "." -f 1,2,3) <(yay -Si linux$(if [ ! -z "$kernelVariant" ]; then echo "-$kernelVariant"; fi) | grep Version | cut -d ":" -f 2 | cut -d "-" -f 1 | cut -d "." -f 1,2,3 | awk '{print substr($0, 2)}') | tail -n +2)
if [ ! -z "$versionDiff" ]; then
echo -e "Variant:\n$(if [ -z "$kernelVariant" ]; then echo "stable"; else echo $kernelVariant; fi)\n$(sed '1i\Running:' <<<"$(sed -e 's/< //g;s/> //g;s/---/Latest:/g' <<<"$versionDiff")")"
else
echo -e "Variant:\n$(if [ -z "$kernelVariant" ]; then echo "stable"; else echo $kernelVariant; fi)\nVersion:\n$(uname -r | cut -d "-" -f 1 | cut -d "." -f 1,2,3) (Latest)"