This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |