Skip to content

Instantly share code, notes, and snippets.

@meganlkm
meganlkm / catp
Last active Jan 25, 2018
catp: The cat command with syntax highlighting.
View catp
#!/usr/bin/env bash
## Install #######################################
# pip install Pygments pygments-markdown-lexer
# cp catp ~/.catp
# echo "source .catp" >> .bash_profile
## Usage #########################################
# > catp filename.foo
##################################################
@meganlkm
meganlkm / mezzanine.Dockerfile
Last active Dec 15, 2017
simple django/mezzanine example
View mezzanine.Dockerfile
# Build it:
# docker build -t mezzanine-dev .
# Run it:
# docker run -it --rm -p '8000:8000' mezzanine-dev
# then go to http://localhost:8000/admin/
# username: admin
# password: default
FROM python
@meganlkm
meganlkm / pypi.sh
Created Nov 10, 2017
upload packages to pypi
View pypi.sh
#!/usr/bin/env bash
## =======================================================================
## ~/.pypirc
## -----------------------------------------------------------------------
# [distutils] # this tells distutils what package indexes you can push to
# index-servers =
# pypi
# pypitest
@meganlkm
meganlkm / boto3-client.py
Created Oct 9, 2017
function and decorator that returns a boto3 client or resource
View boto3-client.py
import os
from functools import wraps
from inspect import getargspec
import boto3
AWS_REGION = os.getenv('AWS_REGION', 'us-east-1')
def get_client(name, client_type='client', region=None, *args, **kwargs):
@meganlkm
meganlkm / release
Created Jul 15, 2016
bump VERSION and tag
View release
#!/bin/bash
VERSION=$(<VERSION)
echo "Current VERSION: ${VERSION}"
V_LIST=(`echo $VERSION | tr '.' ' '`)
V_MAJOR=${V_LIST[0]}
V_MINOR=${V_LIST[1]}
V_PATCH=${V_LIST[2]}
@meganlkm
meganlkm / sqlplus
Created Oct 14, 2015
This is how I got the sublime text SQLExec plugin to connect to oracle
View sqlplus
#!/bin/bash
# this file should be in your path before
# instantclient/sqlplus is picked up.
# make sure to chmod +x
source /path/to/your/env/settings/.bash_profile
/path/to/instantclient/sqlplus $@
View mkpy-project.sh
#!/bin/bash
#
# Source this from .bash_profile
#
# TODO py-ify and ansible-fy this
# append source .mypystuff to .bash_profile
#
# Usage: mkpy projectname
function get_st3_prj_file() {
View mk-node-venv.sh
#!/bin/bash
#
# installs node into a python virtualenv
# dependencies: pip, virtualenv, virtualenvwrapper
#
# install dependencies:
# sudo easy_install pip
# sudo pip install virtualenv virtualenvwrapper
#
# Usage: mknodeenv myproject
@meganlkm
meganlkm / laravel5_shared_hosting_project.sh
Last active Jan 3, 2019
setup a laravel5 project to deploy to a shared hosting provider
View laravel5_shared_hosting_project.sh
#!/bin/bash
myproject='myproject'
mywww='public_html'
# initialize project
composer create-project laravel/laravel $myproject --prefer-dist
cd $myproject
# fix paths to public
@meganlkm
meganlkm / laravel_deploy_shared_host.sh
Last active Apr 17, 2016
deploy laravel project to a shared hosting provider
View laravel_deploy_shared_host.sh
#!/bin/bash
PRJ_HOME=$(pwd)
REPO_URL='git@github.com:username/repo.git'
BUILD_DIR=${PRJ_HOME}/project-build
APP_DIR=${BUILD_DIR}/my-app
RSYNC_CMD='rsync -avz -e ssh --exclude-from ./.build-exclude'
COMPOSER_CMD='composer install'
You can’t perform that action at this time.