Skip to content

Instantly share code, notes, and snippets.

View KondaReddyR's full-sized avatar

Konda Reddy KondaReddyR

View GitHub Profile
@KondaReddyR
KondaReddyR / jq to filter by value.md
Created August 1, 2019 19:24 — forked from ipbastola/jq to filter by value.md
JQ to filter JSON by value

JQ to filter JSON by value

Syntax: cat <filename> | jq -c '.[] | select( .<key> | contains("<value>"))'

Example: To get json record having _id equal 611

cat my.json | jq -c '.[] | select( ._id | contains(611))'

Remember: if JSON value has no double quotes (eg. for numeric) to do not supply in filter i.e. in contains(611)

@KondaReddyR
KondaReddyR / create-certs.sh
Created June 7, 2018 13:11 — forked from sethvargo/create-certs.sh
Use openssl to create an x509 self-signed certificate authority (CA), certificate signing request (CSR), and resulting private key with IP SAN and DNS SAN
# Define where to store the generated certs and metadata.
DIR="$(pwd)/tls"
# Optional: Ensure the target directory exists and is empty.
rm -rf "${DIR}"
mkdir -p "${DIR}"
# Create the openssl configuration file. This is used for both generating
# the certificate as well as for specifying the extensions. It aims in favor
# of automation, so the DN is encoding and not prompted.
@KondaReddyR
KondaReddyR / build.gradle
Created February 3, 2016 01:10 — forked from quidryan/build.gradle
Gradle file to enforce Semantic Versioning.
apply plugin: "java"
repositories {
mavenCentral()
}
dependencies {
compile "org.spockframework:spock-core:0.7-groovy-2.0"
compile "org.codehaus.groovy:groovy-all:1.8.6"
}
@KondaReddyR
KondaReddyR / README.md
Created January 20, 2016 13:01 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@KondaReddyR
KondaReddyR / gitcheats.txt
Created October 3, 2015 17:22 — forked from chrismccoy/gitcheats.txt
git cheats
# shortform git commands
alias g='git'
# diff the last 2 commits
git diff $(git log --pretty=format:%h -2 --reverse | tr "\n" " ")
# reset the last modified time for each file in a git repo to its last commit time
git ls-files | while read file; do echo $file; touch -d $(git log --date=local -1 --format="@%ct" "$file") "$file"; done
# get author and email of a commit
@KondaReddyR
KondaReddyR / curl.md
Created September 25, 2015 16:22 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@KondaReddyR
KondaReddyR / backup-github.sh
Last active August 29, 2015 14:27 — forked from rodw/backup-github.sh
A simple script to backup an organization's GitHub repositories, wikis and issues.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up
# (if you're backing up a user's repos instead, this should be your GitHub username)
GHBU_UNAME=${GHBU_UNAME-"<CHANGE-ME>"} # the username of a GitHub account (to use with the GitHub API)
GHBU_PASSWD=${GHBU_PASSWD-"<CHANGE-ME>"} # the password for that account
GHBU_GITHOST=${GHBU_GITHOST-"github.com"} # the GitHub hostname (see comments)
GHBU_PRUNE_OLD=${GHBU_PRUNE_OLD-true} # when `true`, old backups will be deleted
# defaults for jenkins continuous integration server
JENKINS_ARGS="-jnlpUrl http://test.lnc.jp:8080/computer/wock/slave-agent.jnlp"
# jenkins home location
JENKINS_HOME=/opt/jenkins-slave
# location of the jenkins war file
JENKINS_WAR=$JENKINS_HOME/slave.jar
# pulled in from the init script; makes things easier.
NAME=jenkins