Skip to content

Instantly share code, notes, and snippets.

View DrJume's full-sized avatar

Julian Meinking DrJume

View GitHub Profile
@DrJume
DrJume / cloudflare-zone-settings-overview.sh
Last active November 26, 2024 13:40
Cloudflare zone settings overview as table
#!/bin/bash
# parameters
CF_API_EMAIL=
CF_API_KEY=
# specify the id for a zone (domain)
# get it via the Cloudflare Dashboard
# of via flarectl: https://github.com/cloudflare/cloudflare-go/tree/master/cmd/flarectl
CF_ZONE=
@DrJume
DrJume / delete-traefik-acme-certificates.sh
Last active November 26, 2024 13:40
Select domains from traefik's acme.json to delete
#!/bin/bash
# tested with traefik v2.4.8
ACME_FILE="acme.json"
# get jq from https://stedolan.github.io/jq/
SELECTED_DOMAINS=$(jq -r '.letsencrypt.Certificates[].domain.main' "$ACME_FILE" | fzf -m --height '40%' --reverse --border)
if [[ -z "$SELECTED_DOMAINS" ]]; then
@DrJume
DrJume / Set_DNS_servers_for_active_network_interface.bat
Last active October 14, 2021 12:04
Windows set/reset DNS servers for active network interface
@echo off
FOR /F "tokens=* USEBACKQ" %%F IN (`powershell "Get-NetRoute -DestinationPrefix '0.0.0.0/0', '::/0' | Sort-Object -Property { $_.InterfaceMetric + $_.RouteMetric } | Select-Object -First 1 | %% {$_.ifIndex}"`) DO (
SET mainIfIndex=%%F
)
ECHO %mainIfIndex%
powershell "Set-DNSClientServerAddress -InterfaceIndex %mainIfIndex% -ServerAddresses ('1.1.1.1','1.0.0.1')"
powershell "Set-DNSClientServerAddress -InterfaceIndex %mainIfIndex% -ServerAddresses ('2606:4700:4700::1111','2606:4700:4700::1001')"
ipconfig /flushdns
@DrJume
DrJume / update.sh
Last active October 29, 2021 07:53
Interactive update script
#!/bin/bash
last_check=''
skip_next_confirm="false"
function skipNextConfirm {
skip_next_confirm="true"
return 0
}
@DrJume
DrJume / avit-lambda.zsh-theme.patch
Created October 29, 2021 23:31
OhMyZsh avit theme with git remote status & lambda
diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme
index 1e20d8f9..4bcd54a0 100644
--- a/themes/avit.zsh-theme
+++ b/themes/avit.zsh-theme
@@ -5,12 +5,19 @@ typeset +H _current_dir="%{$fg_bold[blue]%}%3~%{$reset_color%} "
typeset +H _return_status="%{$fg_bold[red]%}%(?..⍉)%{$reset_color%}"
typeset +H _hist_no="%{$fg[grey]%}%h%{$reset_color%}"
-PROMPT='
-$(_user_host)${_current_dir} $(git_prompt_info) $(ruby_prompt_info)
@DrJume
DrJume / karabiner_complex_mods_drjume.json
Last active February 10, 2022 14:18
DrJume Karabiner-Elements complex modifications
{
"title": "DrJume Karabiner-Elements complex modifications (v2.1)",
"rules": [
{
"description": "Spacebar: Hold and combine with HJKL for vi movement keys",
"manipulators": [
{
"conditions": [
{
"name": "spacebar pressed",
#!/bin/bash
pmset -g custom | sed -nE -e '/Battery Power/,/AC Power/p' | sed -e '1d' -e '$d' | sort > battery.pmset
pmset -g custom | sed -nE -e '/AC Power/,$p' | sed '1d' | sort > ac.pmset
sdiff <(echo "Battery Power:"; cat battery.pmset) <(echo "AC Power:"; cat ac.pmset)