Skip to content

Instantly share code, notes, and snippets.

View kjhosein's full-sized avatar

Khalid J Hosein kjhosein

View GitHub Profile
@haizaar
haizaar / google_auth_utils.py
Last active September 21, 2024 10:33
Google Auth Utils for Directory API
import subprocess
import warnings
from typing import List, Optional
import google.auth
import google.auth.iam
import google.oauth2.credentials
import structlog
from google.auth.credentials import Credentials
from google.auth.transport import requests
@woutervh
woutervh / git-multi-hook-template
Last active October 28, 2021 21:03 — forked from damienrg/git-multi-hook-template
Script to allow multi hooks per hook type for git
#!/usr/bin/env bash
# Allow multiple hooks.
#
# To use it copy this script with executable permission in ".git/hooks/hook-name"
# where hook-name is the name of the hook (see man githooks to know available hooks).
# Then place your scripts with executable permission in ".git/hooks/hook-name.d/".
#
# Changes:
# - add support for symlinked commithooks
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 22, 2025 22:57
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@jkodroff
jkodroff / refresh_creds.sh
Last active March 29, 2023 15:58
Bash script to port temporary STS creds to environment variables when MFA is required.
#!/usr/bin/env bash
# Usage: source ./refresh_creds.sh
# NOTE: You *must* source this file because it modifies environment variables.
# Executing the script directly will not change the calling shell's environment.
if [ -z ${AWS_MFA_DEVICE_ARN+x} ]
then
echo "Environment variable AWS_MFA_DEVICE_ARN must be set to the ARN of your MFA device."
return 1
fi
@conorgil
conorgil / module_publish_to_aws_cloudwatch_logs.tf
Created January 13, 2016 21:36
Sharing IAM Role Policies between multiple IAM Roles
# AWS Cloudwatch Logs install documentation:
# https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/QuickStartEC2Instance.html
# By defining this IAM Role Policy in a module, it can be referenced anywhere it is required
# for an IAM Role. This is preferrable to copy/pasting the IAM Policy statement because changes
# made to this role will automatically apply to all IAM Roles referencing this module.
###
# Variables
###
@joepie91
joepie91 / vpn.md
Last active June 2, 2025 02:33
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@kwilczynski
kwilczynski / route53
Last active September 14, 2024 09:20
EC2 automatic DNS entry in route53 for Auto Scaling Group
TTL=300
HOSTED_ZONE_ID=
REVERSE_HOSTED_ZONE_ID=
INSTANCE_ID=
REGION=
@labnol
labnol / google-apps-script.md
Last active May 18, 2025 02:42 — forked from junaidk/resources.md
How to Learn Google Apps Script

Learning Google Apps Script

Find the best resources for learning Google Apps Script, the glue that connects all Google Workspace services including Gmail, Google Drive, Calendar, Google Sheets, Forms, Maps, and more.

A good place to learn more about Google Apps Script is the official documentation available at developers.google.com. Here are other Apps Script resources that will help you get up to speed.

  1. Google Apps Script Code Samples by Amit Agarwal
  2. Google Apps Script Development - Create Google Apps Script projects locally inside VS Code - video tutorial
  3. Awesome Google Scripts by Amit Agarwal
  4. Google Developer Experts - Follow Apps Scr