Skip to content

Instantly share code, notes, and snippets.

View kristinn's full-sized avatar
🤡

Kristinn Örn Sigurðsson kristinn

🤡
  • Iceland
  • 13:56 (UTC)
View GitHub Profile
@velzie
velzie / manifest-v2-chrome.md
Last active April 26, 2025 20:33
How to keep using adblockers on chrome and chromium

How to keep using adblockers on chrome and chromium

  1. google's manifest v3 has no analouge to the webRequestBlocking API, which is neccesary for (effective) adblockers to work
  2. starting in chrome version 127, the transition to mv3 will start cutting off the use of mv2 extensions alltogether
  3. this will inevitably piss of enterprises when their extensions don't work, so the ExtensionManifestV2Availability key was added and will presumably stay forever after enterprises complain enough

You can use this as a regular user, which will let you keep your mv2 extensions even after they're supposed to stop working

Linux

In a terminal, run:

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@username1290
username1290 / Disable accents.txt
Created September 18, 2019 21:16
Disable accent long press key
https://apple.stackexchange.com/questions/332769/macos-disable-popup-showing-accented-characters-when-holding-down-a-key
# In macOS, when a key is held down while entering text, a popup is shown which lets one choose between various accented
# forms of the character. To disable this execute the following command-line in the Terminal.app:
defaults write -g ApplePressAndHoldEnabled -bool false
# Now, you'll need to log-out and log back in. This should disable the display of the popup and character typed should
# start repeating when the key is held down.
@lizthegrey
lizthegrey / attributes.rb
Last active March 27, 2025 02:16
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'

Docker swarm network running out of IPs

These are just some articles that i came across while researching the issues with the core network on staging swarm running out of IPs.

  • Article about how to build networking in docker swarm.

https://success.docker.com/article/networking

  • Docker network/ip analisys util
@jsamuel1
jsamuel1 / 012_ecs_long_ids.tf
Created February 13, 2019 03:05
Terraform to enable long ARN formats for aws ecs, so that we can use fargate on all our workload accounts.
// Ensure we enroll ecs with long resource IDs
// Delete after April 1st as all new accounts will be enrolled by default
resource "null_resource" "enable_long_ecs_resource_ids" {
provisioner "local-exec" {
command = <<EOF
# $1=account_id, $2=region
source ${path.root}/../scripts/assume_role.sh \
${var.workload_account_id} \
${var.workload_provider_region}
@pkazi
pkazi / cloudTrailEventNames.list
Last active February 8, 2025 07:28
List of values for parameter EventName in AWS Cloudtrail events
AbortDocumentVersionUpload
AbortEnvironmentUpdate
AbortMultipartUpload
AbortVaultLock
AcceptAccountMapping
AcceptCertificateTransfer
AcceptDelegate
AcceptDirectConnectGatewayAssociationProposal
AcceptFxPaymentCurrencyTermsAndConditions
AcceptHandshake
@tomasfejfar
tomasfejfar / docker-compose.yml
Created April 3, 2018 11:35
Using YAML to reuse parts of existing docker-compose configuration
version: "3"
services:
apache: &apacheConfig
build: .
volumes:
- ./:/var/www/html:cached
- ./docker/php-apache/php.ini:/usr/local/etc/php/php.ini
- ./docker/php-apache/ssl-local:/etc/httpd/ssl
working_dir: /var/www/html
ports:
@dlnilsson
dlnilsson / aws_retry.sh
Last active January 25, 2021 11:30
#bash #aws #retry awscli retry backoff for bash
#!/usr/bin/env bash
set -e
aws_retry() {
last_aws_call=""
local max_attempts=${ATTEMPTS-8}
local timeout=${TIMEOUT-2}
local attempt=0
local exitCode=0
@leowinterde
leowinterde / Gitlab Permissions Fix
Created January 11, 2018 10:21
gitlab-ce permissions fix
# Holds repositories directory
sudo chown -R -v git:root /var/opt/gitlab/git-data
sudo chmod -R -v 0700 /var/opt/gitlab/git-data
# Holds git repositories
sudo chown -R -v git:git /var/opt/gitlab/git-data/repositories
sudo chmod -R -v 2770 /var/opt/gitlab/git-data/repositories
# Holds large object directories
sudo chown -R -v git:gitlab-www /var/opt/gitlab/gitlab-rails/shared