nano /usr/local/bin/acme-wrapper.sh
chmod +x /usr/local/bin/acme-wrapper.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/opt/acme.sh/acme.sh --config-home /etc/acme.sh --revoke -d <domain_name> | |
/opt/acme.sh/acme.sh --config-home /etc/acme.sh --remove -d <domain_name> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
systemctl show --no-page my-service | jq --slurp --raw-input 'split("\n") | |
| map(select(. != "") | |
| split("=") | |
| {"key": .[0], "value": (.[1:] | join("="))}) | |
| from_entries' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"description": "Remap Alt+Tab to Command+Tab for Switching Between Apps", | |
"manipulators": [ | |
{ | |
"from": { | |
"key_code": "tab", | |
"modifiers": { | |
"mandatory": [ | |
"option" | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install | |
cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local -DGNUCASH_BUILD_ID=NIXKnight-GnuCash-5.7 -DLEAKS=ON -DREGEX_LIBRARY=/usr/lib/x86_64-linux-gnu/libboost_regex.so -DLIBINTL_LIBRARY=/usr/lib/x86_64-linux-gnu/preloadable_libintl.so -DWITH_PYTHON=ON | |
make | |
make install | |
# Uninstall | |
make uninstall |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
# Replace 'your_cloudflare_api_token_here' with your actual Cloudflare API token | |
api_token = "your_cloudflare_api_token_here" | |
# The URL for the Cloudflare API endpoint to check user details | |
url = "https://api.cloudflare.com/client/v4/user/tokens/verify" | |
# The headers including the API token for authentication | |
headers = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hvac | |
import os | |
from tabulate import tabulate | |
from hvac.exceptions import VaultError | |
# Initialize the HashiCorp Vault client using environment variables for address and token | |
client = hvac.Client( | |
url=os.environ['VAULT_ADDR'], # Vault server address | |
token=os.environ['VAULT_TOKEN'] # Authentication token | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import psutil | |
from tabulate import tabulate | |
def get_top_memory_processes(n=10): | |
# Fetch all processes | |
processes = [p.info for p in psutil.process_iter(attrs=['pid', 'name', 'memory_percent', 'memory_info'])] | |
# Sort the processes based on memory percentage used | |
processes.sort(key=lambda x: x['memory_percent'], reverse=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: default-test | |
namespace: argoproj | |
spec: | |
containers: | |
- name: default-test | |
image: debian:bullseye | |
command: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# +------------------------------------------------------------------------------------------+ | |
# + FILE: ansible-wrapper + | |
# + + | |
# + AUTHOR: Saad Ali (https://github.com/NIXKnight) + | |
# + To be used with https://github.com/NIXKnight/Docker-Kube-Utils.git + | |
# +------------------------------------------------------------------------------------------+ | |
export K8S_SERVICEACCOUNT_DIR="/var/run/secrets/kubernetes.io/serviceaccount" |
NewerOlder