Just some tips I gathered over time. All in one easily reachable place so I can share it wherever I want.
Please note that unless you see a shebang (#!/...)
these code blocks are meant to be copy & pasted.
Some of the steps will not work if you run part of them in a script and copy paste other ones.
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
version: "3" | |
networks: | |
loki: | |
services: | |
loki: | |
image: grafana/loki:2.4.0 | |
volumes: | |
- ./loki:/etc/loki |
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
#GET A LIST OF INSTANCES | |
#/usr/sap/hostctrl/exe/saphostctrl -function Listinstances -format Script | |
#GET A LIST of databases | |
saphostctrl -nr 99 -function Listdatabases | |
# manage a db with the host agent | |
# /usr/sap/hostctrl/exe/saphostctrl -nr 99 -function StopDatabase -dbname NPL -dbtype ada -user sapadm passwd | |
#query a db with the host agent |
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/zsh | |
# exit when any command fails | |
set -e | |
# keep track of the last executed command | |
trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG | |
# echo an error message before exiting | |
trap 'echo "\"${last_command}\" command filed with exit code $?."' EXIT |
# Forked from https://gist.github.com/gguerini
# Syntax edits by Sick Codes (GPLv3+)
# Disable menu bar transparency
defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false
# Show remaining battery time; hide percentage
defaults write com.apple.menuextra.battery ShowPercent -string "NO"
defaults write com.apple.menuextra.battery ShowTime -string "YES"
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
# syntax=docker/dockerfile:1 | |
FROM public.ecr.aws/amazonlinux/amazonlinux:2023 as build | |
RUN \ | |
set -ex ; \ | |
sed -i '/tsflags=nodocs/d' /etc/dnf/dnf.conf ; \ | |
dnf --releasever=$(rpm -q system-release --qf '%{VERSION}') \ | |
-y \ | |
--allowerasing \ | |
--setopt=install_weak_deps=False \ |
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
[project] | |
name = "tool_testing" | |
version = "0.1.0" | |
description = "Ruff Tested Project" | |
authors = [{ name = "", email = "" }] | |
dependencies = [] | |
requires-python = "==3.11.*" | |
readme = "README.md" | |
license = { text = "MIT" } |
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
[Distribution] | |
Distribution=arch | |
[Content] | |
Autologin=true | |
Bootloader=none | |
KernelCommandLine=rw | |
Keymap=us | |
Locale=en_US.UTF-8 | |
MakeInitrd=no |
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 | |
set -euo pipefail | |
# ./get_docker_run.sh c56975e847b4 | |
# docker run -d -e "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" -v /root:/data public.ecr.aws/docker/library/amazonlinux:2023 /bin/bash | |
if [[ "$#" -ne 1 ]]; then | |
echo "Usage: $0 <container_name_or_id>" | |
exit 1 | |
fi |
NewerOlder