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 / abbreviated-unbound.conf
Created Jan 15, 2019 — forked from bryanjswift/abbreviated-unbound.conf
Unbound ( configuration for local network device testing.
View abbreviated-unbound.conf
# The server clause sets the main parameters.
# Allow network connections outside of localhost
# 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 ` allow`
access-control: allow
# TODO: Change this to your username, or whatever user you want to run/own the `unbound` process
username: "bryanjswift"
toddlers /
Created Jun 29, 2018 — forked from posener/
Story: Writing Scripts with Go

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.

toddlers /
Created Apr 10, 2018
aws instance ip and id
aws ec2 describe-instances –region=us-east-1 | jq ‘.”Reservations”[].”Instances”[] | .PrivateIpAddress + ” ” + .InstanceType’ | sed s/\”//g
toddlers / s3logs_analysis.sql
Created Mar 21, 2018
s3logs_analysis via Athena
View s3logs_analysis.sql
/* Create a database in Athena */
Create a table within the Athena database
Replace s3://MY_S3_BUCKET/ with your S3 bucket
which has the access logs you want to query
BucketOwner string,
openssl ocsp -noverify -no_nonce -issuer issuerName.pem -cert net.pem -url -respout net.pem.ocsp
toddlers /
Last active Jan 10, 2018
rotate elasticsearch indices for a given time window
# "Script to rotate Elasticsearch logs given the index pattern and number of days."
# Index names must contain date string in format YYYY.MM.DD
# We can use curator( too for this job
# curator --host localhost delete indices --older-than 30 --time-unit days --timestring '%Y.%m.%d'
abort() {


Generate the symmetric key (32 bytes gives us the 256 bit key):

$ openssl rand 32 -out secret.key

You should only use this key this one time, by the way. If you send something to the recipient at another time, don’t reuse it.

toddlers /
Last active Jan 17, 2019
docker hub with kubernetes in GKE
  • Step by step how to pull a private DockerHub hosted image in a Kubernetes YML.
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 / gist:de127f24ba917028dc2aaaf5104f8622
Created Dec 12, 2017 — forked from bergantine/gist:4487752
Concatenate files in a directory into a single file. #ruby #donnieclapp
View gist:de127f24ba917028dc2aaaf5104f8622
# Iterates over files and subdirectories in directorie[s] given as arguments
# and adds raw text of those files to merged.txt in the working directory
# where the script is called
# Call like this:
# ruby merge.rb {absolute path portion to delete} {directory to scan} [{directory to scan}]
# For example:
# ruby merge.rb /Users/donnieclapp/Projects/ ~/Projects/htl-website/myproject/static_media/stylesheets
# create or open the merged.txt file for writing (in working directory)
toddlers /
Last active Nov 22, 2017
list links in web pages
  • For listing the links inside a web page
    • Install lynx using brew install lynx on mac
    • Run following command for listing the links
      lynx -listonly -dump
    • Results
      git:master=⚡ lynx -listonly -dump
You can’t perform that action at this time.