Skip to content

Instantly share code, notes, and snippets.

@kconner
kconner / macOS Internals.md
Last active November 13, 2024 07:51
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@quinncomendant
quinncomendant / cpu-threshold-alert-microsoft-edge
Last active September 18, 2022 14:40
Detect if Microsoft Edge has been using more than 90% CPU continuously.
#!/usr/bin/env bash
# Microsoft Edge on macOS sometimes will get stuck using 100% CPU endlessly, requiring a relaunch to stop.
# See issue at https://techcommunity.microsoft.com/t5/discussions/edge-browser-100-cpu-requires-force-quit-macos-mojave-and-v91-0/m-p/2441462/highlight/true#M48074
#
# This script will display a macOS notification if Microsoft Edge has been using more
# than 90% CPU continuously for more than 10 minutes. It only checks the main
# Microsoft Edge process, not the Microsoft Edge Helper processes.
#
# Save it to ~/bin/cpu-threshold-alert-microsoft-edge
Aspect or Feature kubernetes/ingress-nginx nginxinc/kubernetes-ingress with NGINX nginxinc/kubernetes-ingress with NGINX Plus
Fundamental
Authors Kubernetes community NGINX Inc and community NGINX Inc and community
NGINX version Custom NGINX build that includes several third-party modules NGINX official mainline build NGINX Plus
Commercial support N/A N/A Included
Implemented in Go/Lua (while Nginx is written in C) Go/Python Go/Python
Load balancing configuration via the Ingress resource
@CHSuworatrai
CHSuworatrai / VMware vSphere 6.x Licence Keys
Created April 8, 2021 09:20 — forked from DVSB/VMware vSphere 6.x Licence Keys
VMware vSphere 6 and 7 Licence Keys
VMware vSphere 6 Enterprise Plus
1C20K-4Z214-H84U1-T92EP-92838
1A2JU-DEH12-48460-CT956-AC84D
MC28R-4L006-484D1-VV8NK-C7R58
5C6TK-4C39J-48E00-PH0XH-828Q4
4A4X0-69HE3-M8548-6L1QK-1Y240
VMware vSphere with Operations Management 6 Enterprise
4Y2NU-4Z301-085C8-M18EP-2K8M8
1Y48R-0EJEK-084R0-GK9XM-23R52
@DSdatsme
DSdatsme / stopJob.groovy
Last active May 25, 2021 12:58
Stop a Jenkins job forcefully
Jenkins.instance.getItemByFullName("FULL_JOB_PATH").getBuildByNumber(BUILD_NUMBER).finish(
hudson.model.Result.ABORTED,
new java.io.IOException("Aborting build"));
/*
To run the above line, navigate to:
Jenkins homepage -> Manage Jenkins -> Script Console
OR
open https://<jenkins domain>/script
@MartinBrugnara
MartinBrugnara / doc.txt
Last active September 25, 2024 07:07
DigitalOcean, assign public ipv6 to wireguard clients
# /etc/sysctl.d/wireguard.conf
net.ipv4.ip_forward=1
net.ipv6.conf.all.forwarding=1
net.ipv6.conf.default.forwarding=1
net.ipv6.conf.eth0.proxy_ndp=1
#/etc/wireguard/wg0.conf (DO virtual machine)
[Interface]
# The server interface does not actually need an ipv6.
# The 2 following must be repeated for each used addres [0, 1]
# Enriched VPC Flow Log fields
${version} ${vpc-id} ${subnet-id} ${instance-id} ${interface-id} ${account-id} ${type} ${srcaddr} ${dstaddr} ${srcport} ${dstport} ${pkt-srcaddr} ${pkt-dstaddr} ${protocol} ${bytes} ${packets} ${start} ${end} ${action} ${tcp-flags} ${log-status}
# https://aws.amazon.com/about-aws/whats-new/2020/05/add-enriched-metadata-to-amazon-vpc-flow-logs-published-to-cloudwatch-logs-and-s3/
#GROK Pattern
%{NUMBER:version:int} %{NOTSPACE:vpc-id} %{NOTSPACE:subnet-id} - %{NOTSPACE:interface-id} %{NUMBER:account-id} %{NOTSPACE:type} %{NOTSPACE:srcaddr} %{NOTSPACE:dstaddr} %{NUMBER:srcport:int} %{NUMBER:dstport:int} %{NOTSPACE:srcpktaddr} %{NOTSPACE:dstpktaddr} %{NOTSPACE:protocol} %{NUMBER:bytes:int} %{NUMBER:packets:int} %{NUMBER:start:int} %{NUMBER:end:int} %{NOTSPACE:action} %{NOTSPACE:tcpflags} %{NOTSPACE:logstatus}
@m1keil
m1keil / README.md
Last active February 16, 2024 17:00
Configure Kibana to use SAML with Google Workspace (Google Apps, G Suite)

The following worked with Elastic Cloud, Elasticsearch & Kibana v7.6.0. It should be pretty close for other kinds of deployments. Before starting, make sure you have the right license level that allows SAML.

Create SAML App in Google Workspace:

  • Navigate to the SAML apps section of the admin console
  • Click the Add button and choose to "Add custom SAML app"
  • Write down the Entity ID and download the Idp metadata file
  • Choose application name, description and add logo
  • In the "Service Provider Details" screen add the following:
@suneshgovind
suneshgovind / playbook-to-migrate-to-imdsv2.yml
Created December 31, 2019 07:24
Ansible playbook to automate migration of AWS EC2 instances to Instance Metadata Service version 2 (IMDSv2)
---
- name: To enable IMDSv2 in AWS EC2 instances
hosts: localhost
vars:
regions: ["eu-north-1", "ap-south-1", "eu-west-3", "eu-west-2", "eu-west-1", "ap-northeast-2", "ap-northeast-1", "sa-east-1", "ca-central-1", "ap-southeast-1", "ap-southeast-2", "eu-central-1", "us-east-1", "us-east-2", "us-west-1", "us-west-2"]
shell_file: "modify_instance_metadata_options.sh"
tasks:
- name: get instance info
local_action:
@lizthegrey
lizthegrey / attributes.rb
Last active September 24, 2024 14:33
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'