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
#!/bin/bash
# Rename files with spaces on it's filename with underscores
for f in *\ *
do
mv "$f" "${f// /_}"
done
@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/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 {} +
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/sh
# Date in standard UNIX format
# MMDDhhmmYYYY
# Mon Jun 3 13:31:00 UTC 2019
date 060313312019
@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
@Kr0n0
Kr0n0 / frida_magist_selinux.sh
Created May 16, 2019 05:31
Magisk SELinux Policy for FRIDA without Permissive Mode
#!/system/xbin/busybox sh
# Enabling Magisk SELinux Policy for using FRIDA without permissive mode
# https://serializethoughts.com/2018/07/23/frida-magisk-and-selinux/
magiskpolicy --live "allow zygote magisk process *"
magiskpolicy --live "allow system_server magisk process *"
magiskpolicy --live "allow radio magisk process *"
#!/bin/sh
ffmpeg -i $1 -vf "select=gt(scene\,0.5), scale=640:360" -vsync vfr $1-%03d.png
@Kr0n0
Kr0n0 / init.gcloud-init
Created March 12, 2019 03:38
Basic cloud-init for installing Google Cloud SDK, Tensorflow GPU Docker Image and KubeCTL
#cloud-config
write_files:
- path: /etc/apt/sources.list.d/google-cloud-sdk.list
content : deb http://packages.cloud.google.com/apt cloud-sdk-bionic main
runcmd:
- 'docker pull tensorflow/tensorflow:latest-gpu-py3 '
- 'curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -'
- 'apt-get update && apt-get install -y google-cloud-sdk kubectl'
- 'gcloud --quiet components update'
final_message: "Cloud-init finished."
#Descargamos el repo principal
git clone ${URL_REPO_PRINCIPAL}
#Añadimos el primer fork
git remote add ${REMOTE_NAME} ${URL_REPO_FORK}
#Descargamos los cambios del fork
git fetch ${REMOTE_NAME}
#Vemos los cambios