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 | |
DB_USER=root | |
DB_PASS="" | |
HOST=localhost | |
DBS_LIST=$(mysql -u $DB_USER $DB_PASS -Bse 'show databases') | |
BASE_BAK_FLDR=/www/backups/dump | |
RM_FLDR_DAYS="+7" | |
index=0 | |
PING=$(mysqladmin ping --host $HOST -u $DB_USER $DB_PASS 2>/dev/null) |
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 | |
# Database credentials | |
DB_USER=root | |
DB_PASS="-pvchangeme" | |
RDS_HOST=warp.cc7vd70wnd3ed.us-east-1.rds.amazonaws.com | |
# Get list of Database | |
DBS_LIST=$(mysql -u $DB_USER $DB_PASS -h $RDS_HOST -Bse 'show databases') | |
# Log file | |
BAKUP_LOG=/var/log/rds_backup.log | |
# Backup Base 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
#!/bin/bash | |
export EC2_PRIVATE_KEY=~/.ec2/pk.pem | |
export EC2_CERT=~/.ec2/cert.pem | |
ec2-create-snapshot vol-ab0921c0 -d "Intellinar Server ROOT - $(date +'%d-%m-%Y')" | |
ec2-create-snapshot vol-110d257a -d "Intellinar Data - $(date +'%d-%m-%Y')" | |
ec2-create-snapshot vol-8bbb93e0 -d "Database Server aka RDS - $(date +'%d-%m-%Y')" | |
Purge EBS Snapshots | |
------------------- | |
export EC2_PRIVATE_KEY=~/.ec2/pk.pem |
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 | |
from twython import Twython | |
CONSUMER_KEY = 'XXXXXXXXXXXXXXXXXXXX' | |
CONSUMER_SECRET = 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' | |
ACCESS_KEY = 'XXXXXXXXXXXX' | |
ACCESS_SECRET = 'XXXXXXXXXXXXX' | |
api = Twython(CONSUMER_KEY,CONSUMER_SECRET,ACCESS_KEY,ACCESS_SECRET) | |
trends = [ ] |
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
/* usbreset -- send a USB port reset to a USB device */ | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <errno.h> | |
#include <sys/ioctl.h> | |
#include <linux/usbdevice_fs.h> |
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
__author__ = 'mohsin' | |
import boto.ec2 | |
import optparse | |
from termcolor import colored | |
parser = optparse.OptionParser() | |
parser.add_option("-r", action="count", dest="regions", help='list all regions') | |
parser.add_option("-i", action="count", dest="instances", help='list all instances in region') | |
parser.add_option("-a", action="count", dest="all_instances", help='list all instances in all region') |
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
__author__ = 'mohsin' | |
import base64 | |
from Crypto.Cipher import DES3 | |
secret = base64.decodestring('nMfNBx9y1T7Xe+DvWmsFwTeGUevEw3WLQlD5pl74qvo=') | |
password = base64.decodestring('temWEHt1x/0=') | |
print DES3.new(secret[:24], DES3.MODE_CBC, secret[24:]).decrypt(password) |
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 requests | |
url = 'http://kitaabghar.com/bookbase/idara/KrishanChandKeBehtareenAfsanay.html' | |
def download_file(url,path,filename=''): | |
try: | |
if filename=='': |
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 | |
# GRC's Perfect Passwords Generator | |
WGET="/usr/bin/wget" | |
FILE=`tempfile` | |
$WGET -q --tries=10 --timeout=5 http://www.google.com -O $FILE &> /dev/null | |
[ -z "$1" ] && echo -e "\E[31mGRC's\E[37m Ultra High Security Password Generator v0.1\r\033[0m" && echo -e '--------------------------------------------------\n' && | |
echo -e '\E[37mUsage: ppassword [\E[31m-an alphanumeric\E[37m ] [\E[32m-as ascii\E[37m ] [ -hex hexadecimal ]' && exit 100 |
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
Patch for OpenSSH Portable to log passwords | |
Tested on: | |
OpenSSH 5.3p1 - OpenSSH 6.6p1 | |
May apply to older versions. | |
To apply: | |
patch --dry-run < sshlog.patch |
OlderNewer