Skip to content

Instantly share code, notes, and snippets.

View amitkrishna's full-sized avatar
🍁
Eye of the Tiger

Amit Krishna amitkrishna

🍁
Eye of the Tiger
View GitHub Profile
@rednafi
rednafi / staticmeta.py
Last active September 9, 2020 10:24
Metaclass to apply staticmethod decorator to all the methods of a class
from types import FunctionType
class StaticMeta(type):
def __new__(cls, name, bases, attrs):
"""Metaclass to apply staticmethod decorator to all the methods."""
new_cls = super().__new__(cls, name, bases, attrs)
# key is attribute name and val is attribute value in the attrs dict
for key, val in attrs.items():
@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active April 30, 2024 13:19
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@sangam14
sangam14 / docker-compose.yml
Last active January 9, 2022 23:55
PDC_Treafik.md
version: "3.3"
services:
################################################
#### Traefik Proxy Setup #####
###############################################
traefik:
image: traefik:v2.3
restart: always
# For macOS users (copy & paste all or one commands at a time)
# Last tested Slack version: 4.0.2
$ git clone https://github.com/LanikSJ/slack-dark-mode && \
cd slack-dark-mode && \
chmod +x slack-dark-mode.sh && \
./slack-dark-mode.sh && \
osascript -e 'tell application "Slack" to quit' && \
killall Slack && \
sleep 20 && \
open -a "/Applications/Slack.app"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
@sundowndev
sundowndev / GoogleDorking.md
Last active April 30, 2024 07:19
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"
kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml
kubectl get pods --namespace kube-system
kubectl port-forward kubernetes-dashboard-5569448c6d-jxbhv 8443:8443 --namespace=kube-system
git clone https://github.com/dockersamples/k8s-wordsmith-demo
cd k8s-wordsmith-demo
docker-compose build
kubectl apply -f kube-deployment.yml
kubectl get services # List all services
kubectl get pods # List all pods
kubectl get nodes -w # Watch nodes continuously
kubectl version # Get version information
kubectl cluster-info # Get cluster information
kubectl config view # Get the configuration
kubectl describe node <node> # Output information about a node
kubectl get pods # List the current pods
kubectl describe pod <name> # Describe pod <name>
kubectl get rc # List the replication controllers
@gmlp
gmlp / 03-pod.sh
Created December 28, 2017 21:26 — forked from vfarcic/03-pod.sh
minikube start --vm-driver=virtualbox
kubectl get nodes
git clone https://github.com/vfarcic/k8s-specs.git
cd k8s-specs
kubectl run db --image mongo
# Source: https://gist.github.com/d860631d0dd3158c32740e9260c7add0
minikube start --vm-driver=virtualbox
kubectl get nodes
git clone https://github.com/vfarcic/k8s-specs.git
cd k8s-specs