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 | |
# | |
# USAGE: ./checkNFSMount.sh /san | |
# | |
for i in `cat /proc/mounts | cut -d' ' -f2`; do | |
if [ "x$1" = "x$i" ]; then | |
exit |
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 | |
# TAR # | |
alias tar-view="tar -tvf" | |
# FILES # | |
alias ll='ls -lah' | |
alias ls='ls --color=auto' | |
# NAVIGATION # |
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
import json, requests | |
url = 'http://api.icndb.com/jokes/random' | |
params = dict( | |
category='nerdy' | |
) | |
resp = requests.get(url=url, params=params) | |
data = json.loads(resp.content) |
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
<?php | |
// Rewrites the entire htaccess file. When a line starts with '# Allow from brett.getmyip.com' the | |
// very next line will be replaced with the actual ip associated with brett.getmyip.com | |
// | |
// Usage in cron: 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/bin/php /root/scripts/dynamic_htaccess_update.php /var/www/html/.htaccess dynamic.ip.com | |
// | |
// Hat tip: http://brett.batie.com/software-development/update-htaccess-with-dynamic-dns-ip-address-to-prevent-password-protection/ | |
$htaccessFile = $argv[1]; | |
$target_dns_name = $argv[2]; |
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 | |
LOCK=/root/scripts/replicationLock | |
LOGFILE=/tmp/replication_script_log | |
if [ -f $LOCK ] | |
then | |
echo "$$ | $(date +'%D %T') | Replication currently locked. Exiting." >> $LOGFILE | |
exit 1 | |
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
Const ForAppending = 8 | |
Set objWMIService = GetObject("winmgmts:") | |
Set objLogicalDisk = objWMIService.Get("Win32_LogicalDisk.DeviceID='s:'") | |
set objFSO = CreateObject("Scripting.FileSystemObject") | |
set objFile = objFSO.OpenTextFile("c:\DAS_free_space.txt", ForAppending, True) | |
objFile.WriteLine(FormatNumber((CDbl(objLogicalDisk.FreeSpace)/1024/1024/1024)) & ",") | |
objFile.Close |
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 | |
# | |
# TO UNTAR: tar -xvzf stash_2014-07-24.tar.gz --strip-components=2 | |
# | |
LOG_FILE=/tmp/stash_backup_log | |
TIMESTAMP="$$ | $(date +'%D %T') |" | |
TODAY=`date +'%Y-%m-%d'` | |
STASH_DB="stash" | |
TMP_DIR=/root/scripts |
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 | |
MNT_PATH=$1 | |
if [ -z "$MNT_PATH" ] | |
then | |
echo "MNT_PATH is not set" | |
exit | |
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
#!/bin/bash | |
# works with a file called VERSION in the current directory, | |
# the contents of which should be a semantic version number | |
# such as "1.2.3" | |
# this script will display the current version, automatically | |
# suggest a "minor" version update, and ask for input to use | |
# the suggestion, or a newly entered value. |
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 | |
# | |
# PostgreSQL Backup Script Ver 1.0 | |
# http://autopgsqlbackup.frozenpc.net | |
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com> | |
# | |
# This script is based of the AutoMySQLBackup Script Ver 2.2 | |
# It can be found at http://sourceforge.net/projects/automysqlbackup/ | |
# | |
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9 |
OlderNewer