Skip to content

Instantly share code, notes, and snippets.

Suresh Prajapati toddlers

Block or report user

Report or block toddlers

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@toddlers
toddlers / Dockerfile
Created Jul 27, 2016
using envsubst in Dockerfile
View Dockerfile
FROM ubuntu:trusty
RUN \
apt-get update \
&& apt-get -y install gettext-base \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENV VALUE=foo
ENV VALUE1=boo
COPY config.txt source_config.txt
View awscli-jq.sh
wget http://stedolan.github.io/jq/download/linux64/jq
aws ec2 describe-instances --filters "Name=tag:Name,Values=$NAME" \
"Name=instance-state-name,Values=running" \
| jq -r \
".Reservations[] | .Instances[] | .InstanceId" \
aws ec2 describe-volumes --filters \
"Name=status,Values=available" \
| jq -r ".Volumes[] | .VolumeId" \
@toddlers
toddlers / sec_groups_aws.py
Created Oct 20, 2015
Listing AWS Security groups with Python boto
View sec_groups_aws.py
#!/usr/bin/python
# Script will list all instances, all security groups and their rules for desired profile
# Before using script, you need to create "profile" file, which is ~/.aws/credentials where you put your AWS keys like this:
#
# [dev]
# aws_access_key_id = *****
# aws_secret_access_key = *****
#
# .. and then use it in this script
@toddlers
toddlers / jenkins_backup.sh
Created Jan 14, 2015
Jenkins_Bacup via jenkins
View jenkins_backup.sh
# Delete all files in the workspace
rm -rf *
# Create a directory for the job definitions
mkdir -p $BUILD_ID/jobs
# Copy global configuration files into the workspace
cp $JENKINS_HOME/*.xml $BUILD_ID/
# Copy keys and secrets into the workspace
cp $JENKINS_HOME/identity.key.enc $BUILD_ID/
@toddlers
toddlers / dockerhubk8s.md
Last active Jan 17, 2019
docker hub with kubernetes in GKE
View dockerhubk8s.md
  • Step by step how to pull a private DockerHub hosted image in a Kubernetes YML.
export DOCKER_REGISTRY_SERVER=https://index.docker.io/v1/
export DOCKER_USER=Type your dockerhub username, same as when you `docker login`
export DOCKER_EMAIL=Type your dockerhub email, same as when you `docker login`
export DOCKER_PASSWORD=Type your dockerhub pw, same as when you `docker login`
export SECRETNAME=acmeorg
@toddlers
toddlers / abbreviated-unbound.conf
Created Jan 15, 2019 — forked from bryanjswift/abbreviated-unbound.conf
Unbound (http://unbound.net/) configuration for local network device testing.
View abbreviated-unbound.conf
# The server clause sets the main parameters.
server:
# Allow network connections outside of localhost
interface: 0.0.0.0
# Don't automatically run in the background because I want to be able to kill it without hunting a pid
do-daemonize: no
# TODO: Change this to your network range, like `192.168.0.0/16 allow`
access-control: 10.0.0.0/16 allow
# TODO: Change this to your username, or whatever user you want to run/own the `unbound` process
username: "bryanjswift"
@toddlers
toddlers / centos_daemontools.txt
Last active Jan 10, 2019
Installing daemontools in centos
View centos_daemontools.txt
1. Install wget gcc and wget
yum install gcc wget
2. Create a folder setup and wget the source
mkdir -p /package
chmod 1755 /package
cd /package
wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz
tar -xzvf daemontools-0.76.tar.gz
rm daemontools-0.76.tar.gz
@toddlers
toddlers / haproxy.conf
Last active Dec 12, 2018
haproxy config with directives explained
View haproxy.conf
global
log 127.0.0.1 local1 info info
user haproxy
group haproxy
daemon
#quiet
#debug
stats socket /var/run/haproxy/haproxy.sock mode 0600 level admin
defaults
@toddlers
toddlers / go-shebang-story.md
Created Jun 29, 2018 — forked from posener/go-shebang-story.md
Story: Writing Scripts with Go
View go-shebang-story.md

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

You can’t perform that action at this time.