Skip to content

Instantly share code, notes, and snippets.

@ajorpheus
ajorpheus / generateAwsCredsFile.js
Created January 11, 2023 22:47 — forked from bennyrw/generateAwsCredsFile.js
Generate AWS credentials file content from SSO
//
// Intended to be used as a bookmarklet that is executed when on the AWS Single Sign-On landing page,
// this script scans the named SSO application and its accounts (specified below) and generates the
// ~/.aws/credentials content and copies it to the clipboard ready to be used.
//
// the SSO application to use
const APPLICATION_TITLE = "AWS Account";
// specify the names of the accounts to include (case sensitive). Any that are not found will be ignored.
@ajorpheus
ajorpheus / ip-check.sh
Created December 22, 2022 17:25 — forked from FullStackIndie/ip-check.sh
Updated Ip-Check
#!/bin/bash
#Variable Declaration - Change These
HOSTED_ZONE_ID="Z0244******"
#test/dummy subdomain to see if my IP has changed
NAME="dynamic-dns.*********.net."
#My websites that need there IP address updated
CRITTER="development.*********.net."
IDENTITY="development.*********.net."
GATEWAY="development.*********.net."
// Following grants are needed for some of the functions below to function
// @grant GM_openInTab
// @grant GM_xmlhttpRequest
// @grant GM_notification
function log_noti_simple(text, timeout = 2000) {
console.log(`Running "${GM_info.script.name}"`)
// Timeout should be at least 1 second (1000ms) for it to be useful
timeout = timeout < 1000 ? 1000 : timeout;
// ==UserScript==
// @name Remove Promoted Reddit Posts
// @namespace /
// @version 2.0
// @description try to take over the world!
// @author You
// @match /\*
// @grant none
// ==/UserScript==
(function() {
@ajorpheus
ajorpheus / JQuery.ShortcutKeys-1.0.0.js
Created July 10, 2022 17:05
jquery keyboard shortcuts
/**
* ------------------------------------------------------------------------------------------------
* Rogel Delgado Mesa, 2019
* ------------------------------------------------------------------------------------------------
*/
// KEYCODES //
var BACK_SPACE = 8; // BACKSPACE
var TAB = 9; // TAB
var RETURN = 13; // ENTER
@ajorpheus
ajorpheus / waitForKeyElements.js
Created May 17, 2022 08:12 — forked from BrockA/waitForKeyElements.js
A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);
@ajorpheus
ajorpheus / disable.sh
Created February 2, 2022 21:37 — forked from b0gdanw/disable.sh
Disable bunch of #$!@ in Catalina
# Credit: pwnsdx https://gist.github.com/pwnsdx/1217727ca57de2dd2a372afdd7a0fc21; nebular https://gist.github.com/pwnsdx/d87b034c4c0210b988040ad2f85a68d3#gistcomment-3019082
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it!
# IMPORTANT: You will need to disable SIP: Reboot to Recovery, in Terminal csrutil disable
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
# List disabled services: launchctl print-disabled user/501 |grep true & launchctl print-disabled system |grep true
@ajorpheus
ajorpheus / passgitgpg.md
Created February 2, 2022 15:12 — forked from flbuddymooreiv/passgitgpg.md
Setting up pass on git with a gpg key

The following shell transcript shows how to:

  • Create a GPG key
  • Create a pass database
  • Add git support to the pass database
  • Create a remote git repository
  • Push the pass database to the remote git repository
  • Fetch and display your passwords from another host

It is assumed that the pass package has been installed on both the first and second computers.

@ajorpheus
ajorpheus / aws_log_cleanup.sh
Created January 27, 2022 13:36
Delete log groups matching a specific pattern and other filter criteria
#!/bin/bash
## Log groups must match ALL these criteria to be processed
log_name_include="$1" #Only logs containing this string in their name will be included
region="${2:-"eu-west-1"}"
retention_period_filter="400" #Logs with this retention period will be excluded
log() { printf "\n%b" "$*"; }
define_colors_for_logging() {
err="\e[48;5;1m"
@ajorpheus
ajorpheus / create-dockerhub-repo.sh
Created August 24, 2021 09:41
Create a repository on Docker Hub from CLI
#!/usr/bin/env bash
export USER="johndoe"
export PASS="personal-access-token"
## Get the JWT token
TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${USER}'", "password": "'${PASS}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
## API call to create repo
curl -s -H "Authorization: JWT ${TOKEN}" "https://hub.docker.com/v2/repositories/" --data 'description=test' --data 'full_description=full-description' --data 'is_private=true' --data 'name=test' --data "namespace=${USER}"