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
################################################## | |
# Kill long queries # | |
# This shell script will kill queries that have # | |
# passed the $MAX execution time. # | |
# Julian Capilla-krumbak # | |
# lyhan_jr@hotmail.com # | |
# 21-05-2014 # | |
################################################## | |
#!/bin/bash |
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
###################################################### | |
# List certificates, find if a cert is expired. | |
# Requirements for sending emails: postfix, mailutils | |
# | |
# 15-12-2015 | |
# Julian Capilla | |
# lyhan_jr@hotmail.com | |
###################################################### | |
#!/bin/bash |
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
# Log fragmenting 'tool' | |
# Author: Julian Capilla-krumbak | |
# Date: 2016-05-04 | |
# | |
# Expected log format: yyyymmdd_xxxxxxxxxxxx | |
# It will put logs in folders per day like ./20160101/ ./20160102/ .. etc | |
import os,shutil | |
class FolderDist(object): |
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
# The purpose of this script is to help push monitoring information gathered using other scripts to all zabbix servers | |
# example of usage script | |
# ****** | |
# send="/etc/zabbix/zabbix_sender.sh" | |
# value=$(/script/to/fetch/value.py) | |
# if [ -z "$value" ];then value=Null;fi | |
# $send {zabbix.key} $value 2>&1 >/dev/null | |
# ******* | |
#!/bin/bash |
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
# 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@address.com' | |
# 1234567890;"email@address.com" | |
# 1234567890;email@address.com | |
#!/usr/bin/env sh |
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 | |
indices="$(curator show indices --all-indices)" | |
_type="activitylog-syslog" | |
opt=$1 | |
if [ ! "$1" ];then opt='False';fi | |
case $opt in |
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
#!/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 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 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 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}') | |
} |
OlderNewer