This file contains hidden or 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
# Instructions | |
# Run: python WiiKeyMerger.py file1.txt file2.txt | |
import os | |
import sys | |
OUTPUT_FILE = "merged_keys.txt" | |
def parse_and_remove_duplicates(file1, file2): | |
if os.path.exists(OUTPUT_FILE): |
This file contains hidden or 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
# The standard way to add automatic mount is using /etc/fstab. The problem i found is that when remote shares are offline | |
# the computer is slow to boot because it waits for each entry in /etc/fstab to time out. | |
# Here i am automating the mounting of remote shares so i can run it after computer has finished boot via cronjob or manually. | |
# This script creates local directories if they do not exists and mounts the remote shares using cifs. | |
#!/usr/bin/env bash | |
IFS=, | |
MOUNT_ROOT=/mnt | |
REMOTE_FOLDERS="ubuntu,proxmox,TV Shows,Steam,Music,Mix,Learning,Movies,Emulators,Music Videos" | |
REMOTE_SERVER_IP=192.168.50.253 |
This file contains hidden or 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
#!/usr/bin/env bash | |
if [ ! $1 ]; then | |
echo -e "Usage\n" | |
echo -e "$0 { FOLDER | ENCRYPTED FILE }\n" | |
exit | |
fi | |
if [ -d $1 ]; then | |
tar cz $1 | openssl enc -aes-256-cbc -pbkdf2 -e > $1.encrypted |
This file contains hidden or 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
#!/usr/bin/env bash | |
EXECUTABLE_NAME="transmission-daemon" | |
USER="debian-transmission" | |
WORKDIR="/var/lib/transmission-daemon/.config/transmission-daemon" | |
function start { | |
sudo -u $USER $EXECUTABLE -f --log-error -g $WORKDIR & | |
} |
This file contains hidden or 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
#!/usr/bin/env bash | |
function start { | |
$exe -d --webui-port=4713 --configuration=/etc/default/qbittorrent-nox --save-path=/etc/default/qbittorrent-nox/torrents | |
} | |
function status { | |
PROCESS=$(ps aux | grep qbittorrent-nox | grep -v 'grep') | |
PROCESS_ID=$(echo $PROCESS | awk -F" " '{print $2}') | |
} |
This file contains hidden or 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
#!/usr/bin/env bash | |
export USER="user" | |
export AUTHORIZED_KEYS="/home/$USER/.ssh/authorized_keys" | |
export KEY="public key" | |
if [ "$1" == "-c" ];then | |
echo "Creating user $USER" | |
useradd -m -s /bin/bash $USER | |
fi |
This file contains hidden or 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
Aliases (.bashrc ) | |
alias ll='ls -lah' | |
alias l='ll' | |
alias updateme="sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y" | |
screen (.screenrc) | |
# Set the window caption. | |
# I use caption instead of hardstatus, so it is available per split window too | |
# (hardstatus is only per complete screen). | |
caption always "%{= KW}%-Lw%{= wb}%n %t %{= KW}%+Lw %-=| ${USER}@%H | %M%d %c%{-}" |
This file contains hidden or 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
#!/usr/bin/env python | |
BUCKET = 'your_bucket_name' | |
import boto3 | |
s3 = boto3.resource('s3') | |
for obj in s3.Bucket(BUCKET).object_versions.all(): | |
print(obj.delete()) |
This file contains hidden or 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 | |
indices="$(curator show indices --all-indices)" | |
_type="activitylog-syslog" | |
opt=$1 | |
if [ ! "$1" ];then opt='False';fi | |
case $opt in |
This file contains hidden or 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
# The purpose of this script is to validate CSV file containing two columns, | |
# ID and email. ID is an integer, email can be quoted. | |
# It will catch inconsistent quotation marks, invalid emails and ID that is not numberic. | |
# Valid line examples: | |
# 1234567890;'[email protected]' | |
# 1234567890;"[email protected]" | |
# 1234567890;[email protected] | |
#!/usr/bin/env sh |
NewerOlder