Skip to content

Instantly share code, notes, and snippets.

View Kr0n0's full-sized avatar
🐧
Working from home

Carlos Crisóstomo Vals Kr0n0

🐧
Working from home
View GitHub Profile
@Kr0n0
Kr0n0 / create_swapfile.sh
Created May 17, 2019 02:35
Example for swapfile creation
#!/bin/sh
# Example for swapfile creation
# Run as root/sudo
mkdir -p /data/swap
fallocate -l 8G /data/swap/swapfile.000
chmod 600 /data/swap/swapfile.000
mkswap /data/swap/swapfile.000
swapon /data/swap/swapfile.000
swapon --show
#!/bin/sh
# Date in standard UNIX format
# MMDDhhmmYYYY
# Mon Jun 3 13:31:00 UTC 2019
date 060313312019
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/sh
# Fix Nintendo Switch exFat external attributes for SX OS / Atmosphere in Mac OS X
find $1 ! -name 'Nintendo' ! -name 'Emutendo' -maxdepth 1 -type d -exec sudo chflags -R arch {} +
@Kr0n0
Kr0n0 / rename_batch_files_to_md5_hash.sh
Created January 28, 2020 11:42
Batch rename files to her MD5 hash (GNU/Linux Bash)
md5sum * | while read -r sum filename; do mv -v "$filename" "$sum"; done
#!/bin/bash
# Rename files with spaces on it's filename with underscores
for f in *\ *
do
mv "$f" "${f// /_}"
done