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 | |
if swapon -s | grep -q /mnt/swapfile | |
then | |
echo "Swapfile already mounted" | |
else | |
if [ -e /mnt/swapfile ] | |
then | |
echo "Mounting swapfile" | |
swapon /mnt/swapfile |
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/perl | |
use strict; | |
use XML::Simple; | |
use WWW::Curl::Easy; | |
my $WOEID = 12215; # Yahoo! "Where On Earth Identifier" for Bedford, UK | |
my $ZABBIX_SENDER = "/usr/bin/zabbix_sender"; | |
my $ZABBIX_SERVER = "172.24.1.36"; |
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
{ | |
"title": "Apache Overview", | |
"services": { | |
"query": { | |
"list": { | |
"2": { | |
"id": 2, | |
"type": "topN", | |
"query": "", | |
"alias": "", |
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 boto3 | |
import gzip | |
from StringIO import StringIO | |
def get_contents_as_string(bucket, key_prefix, | |
aws_access_key_id=None, aws_secret_access_key=None): | |
"""Gets the contents as string from a gzipped file on s3 | |
Yeah, it's all in memory, so not a good solution for large objects. |
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 | |
#Author: Travis Gibson | |
#This script requires an argument for the resolution width | |
#Thanks go out to eCharles for a patch in the comments of this link here: http://blog.echarles.net/2013/10/01/Ubuntu-13.04-On-MacbookPro-Retina | |
if [ -z "$1" ]; then | |
echo "Usage: Res.sh <resolution_width>"; | |
exit 1; | |
fi | |
erg=$( echo "$1") | |
check=$(xrandr -q | grep DP-2 | cut -d " " -f 4 | cut -d "x" -f 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
#!/bin/bash | |
# Set Variables | |
EXIMLOG=/var/log/exim4/mainlog | |
MYLOG=/tmp/exim_status.log | |
OFFSETFILE=/tmp/eximstatusoffset.dat | |
EXIMSTATS=/usr/sbin/eximstats | |
LOGTAIL=/usr/sbin/logtail | |
ZABBIX_SENDER=/usr/bin/zabbix_sender | |
ZABBIX_CONF=/etc/zabbix/zabbix_agentd.conf |
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 datetime as dt | |
import time | |
import unittest | |
def aws_age_seconds(ec2_launch_time): | |
""" | |
Parse the ec2 launch time string and return how old it is in seconds. | |
""" | |
# Strip trailing subsecond part |
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 | |
# -*- coding: utf-8 -*- | |
__author__ = "Adrien Pujol - http://www.crashdump.fr/" | |
__copyright__ = "Copyright 2013, Adrien Pujol" | |
__license__ = "Mozilla Public License" | |
__version__ = "0.3" | |
__email__ = "adrien.pujol@crashdump.fr" | |
__status__ = "Development" | |
__doc__ = "Check a TLS certificate validity." |
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/python | |
import boto, json | |
from boto.s3.connection import S3Connection | |
from boto.gs.connection import GSConnection | |
def compare_buckets(bucket_one_bucket_name, | |
bucket_two_bucket_name, | |
bucket_one_access_key_id, |
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
#To Decrypt Jenkins Password from credentials.xml | |
#<username>jenkins</username> | |
#<passphrase>your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J</passphrase> | |
#go to the jenkins url | |
http://jenkins-host/script | |
#In the console paste the script | |
hashed_pw='your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J' |
OlderNewer