This file contains 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 | |
DEFAULT_BRANCH="master" | |
CURRENT_BRANCH=$(git branch --show-current) | |
if git checkout "$DEFAULT_BRANCH" | |
then | |
git pull | |
if ! git branch -d "$CURRENT_BRANCH" | |
then |
This file contains 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 | |
DEFAULT_BRANCH="master" | |
CURRENT_BRANCH=$(git branch --show-current) | |
git stash | |
git checkout "$DEFAULT_BRANCH" | |
git pull | |
git checkout "$CURRENT_BRANCH" | |
git merge "$DEFAULT_BRANCH" |
This file contains 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 json | |
import os | |
import re | |
import tempfile | |
COMMENT_RE = r'(route\:allow|allow)\s(tcp|udp)\s([0-9]{1,4})\s((?:(?:25[0-5]|(?:2[0-4]|1\d|[1-9]|)\d)\.?\b){4}/[0-9]{1,2})[\sa-zA-Z]+((?:(?:25[0-5]|(?:2[0-4]|1\d|[1-9]|)\d)\.?\b){4})' # noqa: E501 | |
def get_diff(data): | |
diff_object = data['results'][2]['diff'][0] |
This file contains 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 | |
read -p "Set scaling governor to: " GOVERNOR | |
if [ "$GOVERNOR" == "performance" ] || [ "$GOVERNOR" == "powersave" ] | |
then | |
for i in {0..11}; do echo "$GOVERNOR" | sudo tee /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor; done | |
else | |
echo "Value $GOVERNOR is not a valid scaling governor" | |
fi |
This file contains 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 re | |
COMMENT_RE = r'(route\:allow|allow)\s(tcp|udp)\s([0-9]{1,4})\s((?:(?:25[0-5]|(?:2[0-4]|1\d|[1-9]|)\d)\.?\b){4}/[0-9]{1,2})[\sa-zA-Z]+((?:(?:25[0-5]|(?:2[0-4]|1\d|[1-9]|)\d)\.?\b){4})' # noqa: E501 | |
def main(): | |
with open('diff.txt', 'r') as f: | |
data = [line.strip() for line in f.readlines()] | |
for line in data: |
This file contains 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
# Release default `window-screenshot` keybinding (Ubuntu 19.10) | |
gsettings set org.gnome.settings-daemon.plugins.media-keys window-screenshot '[]' | |
# Replace default `screenshot` binding with the default from `window-screenshot` | |
gsettings set org.gnome.settings-daemon.plugins.media-keys screenshot '<Alt>Print' | |
# Create a new custom keybinding (taking for granted that this would be the first created) | |
gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/']" | |
# Give it a name |
This file contains 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" # specify compose spec version | |
services: | |
db: # define a service name (docker-compose restart db) | |
image: postgres:13 # specify an image tag | |
container_name: db # define a container name (docker logs -f db) | |
restart: unless-stopped # specify an appropiate restart policy | |
volumes: | |
- psql_data:/var/lib/postgresql # use named volumes | |
healthcheck: |
This file contains 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
root = true | |
[*] | |
end_of_line = lf | |
insert_final_newline = true | |
trim_trailing_whitespace = true | |
charset = utf-8 | |
indent_style = space | |
[*.{json,py,tf}] |
This file contains 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
ARG DEBIAN_FRONTEND=noninteractive | |
# Tags should be as specific as possible | |
FROM ubuntu:jammy-20220815 | |
# Set default locale in UTF-8 enabled mode | |
ENV LANG=C.UTF-8 | |
# Add metadata to the image | |
LABEL maintainer="[email protected]" |
This file contains 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
[build-system] | |
requires = [ | |
"setuptools", | |
"wheel", | |
] | |
build-backend = "setuptools.build_meta" | |
[tool.black] | |
line-length = 120 | |
skip-string-normalization = true |
NewerOlder