Skip to content

Instantly share code, notes, and snippets.

View itsprdp's full-sized avatar

Pradeep Gangadharaiah itsprdp

View GitHub Profile
@itsprdp
itsprdp / postgres-cheatsheet.md
Created December 18, 2023 18:35 — forked from Kartones/postgres-cheatsheet.md
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)
@itsprdp
itsprdp / .env
Last active December 23, 2022 07:19
Golang MySQL ORM Example
MYSQL_USER="root"
MYSQL_PASSWORD=""
MYSQL_DBNAME="gorm_test"
MYSQL_PROTOCOL="tcp"
MYSQL_HOST="127.0.0.1"
MYSQL_PORT="3306"
@itsprdp
itsprdp / disable_jenkins.groovy
Last active October 31, 2022 08:48
Groovy script to disable all jenkins jobs in a view
jenkins = Hudson.instance
jenkins.instance.getView("PS_Portal").items.each { job ->
println "\nJob: $job.name"
job.disabled = true
}
@itsprdp
itsprdp / squid_proxy_tutorial.md
Created August 11, 2022 19:56 — forked from jackblk/squid_proxy_tutorial.md
Tutorial on how to setup a squid proxy with authentication.

Note

This tutorial is for Ubuntu & Squid3. Use AWS, Google cloud, Digital Ocean or any services with Ubuntu to follow this tutorial.

Install squid & update

sudo apt-get update
sudo apt-get install squid3
sudo apt-get install apache2-utils
@itsprdp
itsprdp / dual-y-axes-line-chart-d3.html
Created February 18, 2015 07:36
Dual y axes line chart using d3.js
<!DOCTYPE html>
<meta charset="utf-8">
<head>
<style>
path {
fill: none;
}
.axis {
@itsprdp
itsprdp / devops_best_practices.md
Created January 7, 2020 08:22 — forked from jpswade/devops_best_practices.md
Devops Best Practices Checklist

Find the original here article here: Devops Best Practices

DevOps started out as "Agile Systems Administration". In 2008, Andrew Shafer did a talk called "Agile Infrastucture" addressing issues around involving more of the company in the same disciplines as programmers.

In 2009, Patrick Debois created "DevOpsDays" conference to help to bring it to light. However, it wouldn't begin to trend until about 2010, when people would begin to describe it as a standalone discipline.

Today, DevOps goes beyond just developers, systems administration and infrastructure, its about [dev, ops, agile, cloud

Keybase proof

I hereby claim:

  • I am itsprdp on github.
  • I am itsprdp (https://keybase.io/itsprdp) on keybase.
  • I have a public key ASC2hQopTOjPq4pC2JgwuSQcxGXN-rHU8UfyVsMh83lQ4Ao

To claim this, I am signing this object:

@itsprdp
itsprdp / ffmpeg.md
Created August 13, 2019 07:46 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@itsprdp
itsprdp / delete-evicted-pods-all-namespaces.sh
Created December 17, 2018 18:48 — forked from psxvoid/delete-evicted-pods-all-namespaces.sh
Delete evicted pods from all namespaces (also ImagePullBackOff and ErrImagePull)
#!/bin/sh
# based on https://gist.github.com/ipedrazas/9c622404fb41f2343a0db85b3821275d
# delete all evicted pods from all namespaces
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all containers in ImagePullBackOff state from all namespaces
kubectl get pods --all-namespaces | grep 'ImagePullBackOff' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all containers in ImagePullBackOff or ErrImagePull or Evicted state from all namespaces
@itsprdp
itsprdp / README.md
Last active August 15, 2018 08:57
OSX BookMyShow Notifier