Skip to content

Instantly share code, notes, and snippets.

View bhavanki's full-sized avatar
💭
Flossing

Bill Havanki bhavanki

💭
Flossing
View GitHub Profile
@m-radzikowski
m-radzikowski / script-template.sh
Last active May 4, 2024 04:13
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@mnadel
mnadel / kcdo
Last active February 14, 2023 07:36
Exec Across (Some, All) Pods in Kubernetes
#!/usr/bin/env bash
PROGNAME=$(basename $0)
function usage {
echo "usage: $PROGNAME [-n NAMESPACE] [-m MAX-PODS] -s SERVICE -- COMMAND"
echo " -s SERVICE K8s service, i.e. a pod selector (required)"
echo " COMMAND Command to execute on the pods"
echo " -n NAMESPACE K8s namespace (optional)"
echo " -m MAX-PODS Max number of pods to run on (optional; default=all)"
@nogweii
nogweii / Test.java
Created October 1, 2013 23:39
A quick test to see if you have the JCE Unlimited Strength Jurisdiction Policy files installed. If you don't, in Java 6 you'll see 128. If you do, you'll see 2147483647. Thanks to http://stackoverflow.com/questions/11538746/check-for-jce-unlimited-strength-jurisdiction-policy-files
import javax.crypto.Cipher;
class Test {
public static void main(String[] args) {
try {
System.out.println("Hello World!");
int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES");
System.out.println(maxKeyLen);
} catch (Exception e){
System.out.println("Sad world :(");
@dentearl
dentearl / gstatus.py
Created December 22, 2012 02:16
script to programmatically change your gchat status. Can take input via positional arguments and standard in.
#!/usr/bin/env python
"""
gstatus.py,
21 December 2012
dent earl, dent.earl (a) gmail com
a script to programmatically change your gchat status.
based in large part on a script from CyberShadow:
http://blog.thecybershadow.net/2010/05/08/setting-shared-google-talk-gmail-status-programmatically/
"""
from argparse import ArgumentParser
@jbjornson
jbjornson / open_recently_closed_file.py
Last active July 27, 2017 20:35
Plugin that keeps track of which files have been recently closed, as well as files that have been recently accessed. The plugin can be used to simply open the last file you closed or can be used to display a quick panel with a list of recently accessed f
'''
@author Josh Bjornson
This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/
or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
'''
# Plugin to provide access to the history of accessed files:
# https://gist.github.com/1133602
#