Skip to content

Instantly share code, notes, and snippets.

View kappyprasad's full-sized avatar

Kappy Prasad kappyprasad

View GitHub Profile
@kappyprasad
kappyprasad / my.cnf
Created December 13, 2017 12:58 — forked from petemcw/my.cnf
Ubuntu MySQL 5.1 Configuration - 4GB RAM, Heavy InnoDB
# The MySQL database server configuration file.
#
# DESC: InnoDB mainly, heavy queries, fewer connections, 4GB RAM
#
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
@kappyprasad
kappyprasad / lambda-curl.py
Created October 19, 2017 03:58 — forked from thiagomgo/lambda-curl.py
A simple lambda function written in python to execute a curl command
def lambda_handler(event, context):
import subprocess
result = subprocess.call("curl -I http://foo.bar", shell=True)
return result
@kappyprasad
kappyprasad / shutdown.py
Created September 28, 2017 06:13 — forked from smiller171/shutdown.py
Nightly EC2 shutdown
import boto3
import logging
#setup simple logging for INFO
logger = logging.getLogger()
logger.setLevel(logging.INFO)
#define the connection
ec2 = boto3.resource('ec2')
@kappyprasad
kappyprasad / update_git_repos.sh
Created August 8, 2017 06:43 — forked from douglas/update_git_repos.sh
Update all git repositories under a base directory
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# Let the person running the script know what's going on.
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n"
# Find all git repositories and update it to the master latest revision
for i in $(find . -name ".git" | cut -c 3-); do
@kappyprasad
kappyprasad / git-pull-with-rebase-multi-repository-shell-script
Created August 8, 2017 05:52 — forked from sunitparekh/git-pull-with-rebase-multi-repository-shell-script
Shell script to pull latest code from remote git repository for multiple projects
#!/bin/bash
repos=(
"/c/projects/project-1"
"/c/projects/project-2"
"/c/projects/project-3"
)
echo ""
echo "Getting latest for" ${#repos[@]} "repositories using pull --rebase"