Skip to content

Instantly share code, notes, and snippets.

View seanorama's full-sized avatar

Sean Roberts seanorama

  • Cloudera (formerly Hortonworks, Rackspace)
  • London, UK
  • X @seano
View GitHub Profile
@seanorama
seanorama / pyspark-on-yarn-self-contained.md
Last active November 4, 2024 19:45
PySpark on YARN in self-contained environments
@antonbabenko
antonbabenko / README.md
Created October 31, 2017 08:45
Example of using terraform-aws-modules/vpc/aws module with Terragrunt

This is an example of how to use Terraform AWS registry modules with Terragrunt.

Notes:

  1. source has to be full git URL and not Terraform Registry open issue #311
  2. File main_providers.tf is named so, because it will be copied to another local directory and merged with module's code. If such file exists in the module already then it will overwrite the one provided by the module.
@charlessolar
charlessolar / gist:515016139f0014cdfc029c7dd553d597
Last active January 13, 2020 11:54
ansible inventory files from terraform
### variables
variable "env" {}
variable "riak_count" {}
variable "elastic_count" {}
### hostname.tpl
${name}-${env}-${format("%02s",index)} ${extra}
### ansible.tpl
@abajwa-hw
abajwa-hw / deploy_hdp_demos.sh
Last active April 27, 2017 02:41
Deploy demos on HDP
# Script to install HDP 2.5, Nifi 1.0, Zeppein with Truckin demo and Nifi-Twitter demo. Run below command to kick off:
#curl -sSL https://gist.github.com/abajwa-hw/3f2e211d252bba6cad6a6735f78a4a93/raw | sudo -E sh
#To run on multinode: run below on non-ambariserver nodes first
#export ambari_server=<FQDN of host running ambari-server>; export ambari_version=2.4.1.0; curl -sSL https://raw.githubusercontent.com/seanorama/ambari-bootstrap/master/ambari-bootstrap.sh | sudo -E sh ;
bootstrap_home=/tmp
rm -rf ${bootstrap_home}/ambari-bootstrap
set -e -x
export hdp_ver=${hdp_ver:-2.5} #version of HDP
@schlomok
schlomok / check-git-branch-status.sh
Last active November 8, 2021 20:40
Checks if current git branch needs to pull, push, if it has diverged, or if it is up to date with the remote branch.
#!/bin/sh
# This script checks if the current branch needs to pull, push, if it has
# diverged, or if it is up-to-date with the remote branch.
# Credits to: http://stackoverflow.com/questions/3258243/check-if-pull-needed-in-git
# Check if git is installed.
hash git 2>/dev/null || { echo >&2 "This script requires git to be installed."; exit 1; }
# Update remote branch to fetch latest remote commit SHA.
@randerzander
randerzander / tickets.py
Last active August 18, 2020 16:48
SalesForce open cases list
# See https://pip.pypa.io/en/latest/installing.html for how to install pip, then:
# pip install simple-salesforce
from simple_salesforce import Salesforce
import string
# To get your SFDC token, see https://help.salesforce.com/apex/HTViewHelpDoc?id=user_security_token.htm
# salesforce_login.txt should contain the following, one per line:
# Your Name
# your_email@sfdc_account.com
# your_password
@jancorg
jancorg / Hubot-Dockerfile
Last active October 2, 2017 07:34
Hubot + slack + scripts Dockerfile
FROM dockerfile/nodejs
MAINTAINER Marvin
WORKDIR /root
RUN npm install -g yo generator-hubot
RUN useradd -ms /bin/bash marvin
ENV HOME /home/marvin
#Place here variables needed by hubot scripts
ADD env-vars.sh /home/marvin/.profile
@kevinelliott
kevinelliott / osx-10.10-setup.md
Last active August 12, 2024 10:45
Mac OS X 10.10 Yosemite Setup

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

@randerzander
randerzander / control.sh
Last active November 22, 2022 11:54
Ambari Service Start/Stop script
USER='admin'
PASS='admin'
CLUSTER='dev'
HOST=$(hostname -f):8080
function start(){
curl -u $USER:$PASS -i -H 'X-Requested-By: ambari' -X PUT -d \
'{"RequestInfo": {"context" :"Start '"$1"' via REST"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}' \
http://$HOST/api/v1/clusters/$CLUSTER/services/$1
}
@Kartones
Kartones / postgres-cheatsheet.md
Last active November 15, 2024 21:14
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)