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 | |
#https://bugs.launchpad.net/ubuntu/+source/network-manager-openvpn/+bug/606365 | |
#http://howto.praqma.net/ubuntu/vpn/openvpn-access-server-client-on-ubuntu | |
#!/bin/bashset -e | |
function usage(){ | |
echo -e "\nThe script can be used to split or merge ovpn file." |
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 | |
#!/bin/bashset -e | |
# Script to cleanup cache files in file system. | |
# This script is used to make sure the cache folder does not exceed the set threshold limit in the server. | |
# The script can be configured as cron job in the server to monitor and delete older files in specified directory. | |
# The script sends out email if the script cannot bring the directory size below the threshold even after deleting | |
# files based on min and max access time and created time set in the script. | |
# | |
# Usage |
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 | |
#!/bin/bashset -e | |
PROGNAME=${0##*/} | |
SHORTOPTS="mbs:d:p:" | |
LONGOPTS="merge,split,source:,destination:,prefix:" | |
set -o errexit -o noclobber -o pipefail | |
OPTS=$(getopt -s bash --options $SHORTOPTS --longoptions $LONGOPTS --name $PROGNAME -- "$@" ) | |
eval set -- "$OPTS" |
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 | |
#!/bin/bashset -e | |
VERBOSE=true | |
FILE="$1" | |
function log() { | |
error="$2" | |
if [[ "$VERBOSE" = true ]] || [[ "$error" = true ]] ; then | |
echo -e "${1}" |
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
#lists contents of current directory with file permisions | |
alias ll='ls --color -l -sort' | |
#list all directories in current directories | |
alias ldir='ls -l | grep ^d' | |
# List directory and pipe output to less. Makes viewing of large directory easy | |
alias lsl="ls -lhFA --color | less -r" | |
#Find files in current directory |
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 | |
txtund=$(tput sgr 0 1) # Underline | |
txtbld=$(tput bold) # Bold | |
bldred=${txtbld}$(tput setaf 9) # red | |
bldblu=${txtbld}$(tput setaf 14) # blue | |
bldwht=${txtbld}$(tput setaf 10) # white | |
txtrst=$(tput sgr0) # Reset | |
info=${bldwht}*${txtrst} # Feedback | |
pass=${bldblu}*${txtrst} |
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 | |
FILE=$(basename $1) | |
FILENAME="${FILE%.*}" | |
EXTENSION="${FILE##*.}" | |
echo "$FILE" | |
echo "$FILENAME" | |
echo "$EXTENSION" |
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 | |
source=${1} | |
destination=${2} | |
user=${3:-root} | |
pass=${4} | |
# Help menu | |
print_help() { | |
echo -e " |
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 | |
# Check if ran with root permissions | |
if [ `id -u` -ne 0 ]; then | |
printf "The script must be run as root! (you can use sudo)\n" | |
exit 1 | |
fi | |
function arrayContains { | |
local e match="$1" |
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
[user] | |
name = you name | |
email = you_email_address | |
[alias] | |
# nice log output | |
lg = log --graph --pretty=oneline --abbrev-commit --decorate | |
# start git-sh | |
sh = !git-sh | |
[color] | |
# turn on color |
OlderNewer