Skip to content

Instantly share code, notes, and snippets.

View junaidk's full-sized avatar

Junaid Khalid junaidk

  • Mirantis
  • Berlin
View GitHub Profile
@junaidk
junaidk / KubectlCommands.md
Created November 7, 2019 09:25
Kubectl Commands

get pods

kubectl get pods -n cloudplex-system | grep $1- | awk '{print $1}'

delete pod

kubectl delete po $( getpo $1 )
for ROLEIN in $(cat remaining-roles-2 | jq -r ".Roles[] | .RoleName"); do
## filter role on pattern
ROLE=$(echo $ROLEIN | grep -E "\-SR|\-MR|M-CP-X|M-CP-Y")
if [ -z "$ROLE" ]
then
echo ""
else
echo role ${ROLE}
@junaidk
junaidk / go-remote.md
Last active August 31, 2019 13:29
go application remote debug
  • install dlv debugger inside build image

    RUN go get github.com/go-delve/delve/cmd/dlv

  • copy dlv to final docker image

    COPY --from=build-env /go/bin/dlv /app/dlv

  • build go binary with these flags

Developer Cheat Sheets

This are my cheat sheets that I have compiled over the years. Tired of searching Google for the same things, I started adding the information here. As time went on, this list has grown. I use this almost everyday and this Gist is the first bookmark on my list for quick and easy access.

I recommend that you compile your own list of cheat sheets as typing out the commands has been super helpful in allowing me to retain the information longer.

@junaidk
junaidk / show_wifi_clients.sh
Created October 28, 2016 09:48
Show Clients connected to Hotspot
#!/bin/bash
# show_wifi_clients.sh
# Shows MAC, IP address and any hostname info for all connected wifi devices
# written for openwrt 12.09 Attitude Adjustment
# modified by romano@rgtti.com from http://wiki.openwrt.org/doc/faq/faq.wireless#how.to.get.a.list.of.connected.clients
echo "# All connected wifi devices, with IP address,"
echo "# hostname (if available), and MAC address."
printf "# %-20s %-30s %-20s\n" "IP address" "lease name" "MAC address"
@junaidk
junaidk / signedUrl.go
Last active January 4, 2019 11:19
get signed url for S3 object
package main
import (
"cluster-manager/constants"
"crypto/tls"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/urfave/cli"
@junaidk
junaidk / settings_default.json
Created August 14, 2014 15:14
Sublime Alignment Plugin Settings file
{
// If the indent level of a multi-line selection should be aligned
"align_indent": true,
// If indentation is done via tabs, set this to true to also align
// mid-line characters via tabs. This may cause alignment issues when
// viewing the file in an editor with different tab width settings. This
// will also cause multi-character operators to be left-aligned to the
// first character in the operator instead of the character from the
// "alignment_chars" setting.
@junaidk
junaidk / server.txt
Created October 14, 2017 14:24
ssh helper utility
srv1 = ssh -i key-file-path ubuntu@10.10.10.10
srv2 = ssh -i key-file-path ubuntu@10.10.10.11
srv3 = ssh -i key-file-path ubuntu@10.10.10.12
@junaidk
junaidk / gist:8827646
Last active June 1, 2017 11:06
Ubuntu Proxy

Proxy Setting for Apt is needed for us who work behind proxy. It is needed for ubuntu update, package installation, and ubuntu upgrade. This proxy setting used by apt can be configured with apt.conf and if it’s not configured ubuntu will use or read proxy configuration environtmen. read this post setting proxy bactrack or ubuntu to set proxy environtmen. On ubuntu 10.04 we can find apt.conf in /etc/apt, but on ubuntu 11.04 i can’t find this file. Reading from some articles i found out that ubuntu 11.04 will still read apt.conf configuration if this file is exist. so i just create file apt.conf in /etc/apt/

  1. Create apt.conf nano /etc/apt/apt.conf

  2. Insert folowing line in this file

Acquire::http::proxy "http://proxyserver:port/";

Keybase proof

I hereby claim:

  • I am junaidk on github.
  • I am junaidk (https://keybase.io/junaidk) on keybase.
  • I have a public key whose fingerprint is A8C1 F384 12DE CDE6 A761 F837 279E 502A 669B DD2C

To claim this, I am signing this object: