Skip to content

Instantly share code, notes, and snippets.

View ysh7's full-sized avatar

Yagnesh Mistry ysh7

  • Flipkart
  • Mumbai, India
View GitHub Profile
@ysh7
ysh7 / Terminal_Shortcuts_2.0.md
Created December 28, 2023 10:21 — forked from l3ct3r/Terminal_Shortcuts_2.0.md
Linux Terminal Shortcut (V2)

sh

Useful bash / zsh shortcuts

Move cursor

Ctrl + a
@ysh7
ysh7 / Readonly user for Kubernetes Dashboard.md
Created November 14, 2020 09:25 — forked from karthik101/Readonly user for Kubernetes Dashboard.md
Read only user for Kubernetes Dashboard

The view ClusterRole doesn’t actually have permissions for the Cluster level objects like Nodes and Persistent Volume Claims. So we’ll have to create a new RBAC config.

First, we’ll create a new dashboard-viewonly ClusterRole:

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: dashboard-viewonly
@ysh7
ysh7 / awagentuninstaller.sh
Created November 21, 2018 05:51 — forked from nuna-alan/awagentuninstaller.sh
Bash script to remove VMWare Airwatch Agent for macOS
#!/bin/sh
[[ $EUID == 0 ]] || { echo "Must be run as root."; exit; }
PKGNAME=AgentUninstaller
LOG=/tmp/$PKGNAME.log
touch $LOG
chmod a+rw $LOG
DAEMON_PLIST="/Library/LaunchDaemons/com.airwatch.airwatchd.plist"
@ysh7
ysh7 / haproxy-shell
Last active June 9, 2022 00:27
Simple bash script for HAProxy socket interaction
#!/bin/bash
while IFS= read -e -p "haproxy> " cmd;
do
if [ -z "$cmd" ]; then
continue
fi
history -s "$cmd"
case "$cmd" in
@ysh7
ysh7 / dhcp-event
Created June 16, 2016 15:09 — forked from tomoconnor/dhcp-event
Thingy for updating powerdns backend when stuff changes
#!/usr/bin/env python
import MySQLdb
import os, sys
import pprint
pp = pprint.PrettyPrinter()
mysql_host = "localhost"
mysql_user = "dbusername"
mysql_pass = "dbpassword"
@ysh7
ysh7 / dhcpd.conf
Created June 16, 2016 15:09 — forked from tomoconnor/dhcpd.conf
snippet to show usage of dhcp-event (don't forget to set apparmor to allowing (complain) mode)
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.100 192.168.0.200;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;
on commit {
set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
log(concat("Commit: IP: ", ClientIP, " Mac: ", ClientMac, "Hostname: ", host-decl-name));
execute("/usr/local/bin/dhcp-event", "commit", ClientIP, ClientMac, host-decl-name);
}
global
ssl-default-bind-options no-sslv3 no-tls-tickets
frontend https
# Bind SSL port with PFS-enabling cipher suite
bind :443 ssl crt path_to_certificate no-tls-tickets ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES-256-SHA256:DHE-RSA-AES-256-CBC-SHA:DHE-RSA-AES-128-CBC-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA
reqadd X-Forwarded-Proto:\ https
# Add the HSTS header with a 1 year max-age
@ysh7
ysh7 / gist:e0644a1277d9749b6a6f
Created October 27, 2015 09:15 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt