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
#!/bin/sh | |
CURL="curl -s --cacert ${HOME}/.local/etc/pki/ca/ca.crt" | |
REGISTRY='https://docker-registry.svc.internal.readonly.xyz/v2' | |
listImages() | |
{ | |
repo="$1" | |
tags=$(${CURL} "${REGISTRY}/${repo}/tags/list" | jq -r '.tags[]') |
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
_ssh_known_hosts() | |
{ | |
local cur prev | |
_get_comp_words_by_ref cur prev | |
COMPREPLY=($(compgen -W 'find forget list' -- "${cur}")) | |
} | |
complete -F _ssh_known_hosts ssh-known-hosts |
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 python3 | |
import argparse | |
import crypt | |
from crypt import METHOD_SHA256, METHOD_SHA512, METHOD_BLOWFISH, crypt, mksalt | |
from getpass import getpass | |
parser = argparse.ArgumentParser(description='Hash passwords') | |
parser.add_argument('-5', | |
action='store_const', |
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
#!/bin/sh | |
ls_file() { | |
file_path="${1%%/}" | |
file_basename=$(basename "${file_path}") | |
ls_tree_opt= | |
if [ -d "${file_path}" ]; then | |
file_basename="${file_basename}/" | |
ls_tree_opt='-d' | |
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
venv() | |
{ | |
local venv_dir | |
if [[ -n $VENV_ROOT ]]; then | |
venv_dir="${VENV_ROOT}/${2:-$(basename ${PWD})}" | |
else | |
venv_dir=.venv | |
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
#!/bin/sh | |
for bg in '' $(seq 40 47 | sed 's/^/;/'); do | |
for bold in '' 1; do | |
for fg in '' $(seq 30 37 | sed 's/^/;/'); do | |
code="${bold}${fg}${bg}" | |
code="${code#;}" | |
printf '\033[%sm %7s\033[0m' "${code}" "${code}" | |
done | |
printf '\n' |
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
#!/bin/sh | |
# Copyright (c) 2020 ryot4 | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
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 ruby | |
require 'octokit' | |
client = Octokit::Client.new(:access_token => '<personal_access_token>') | |
client.releases('<user>/<repo>').each do |rel| | |
puts rel.name | |
client.release_assets(rel.url).each do |asset| | |
puts "#{asset.name} #{asset.download_count}" |
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
#!/bin/sh | |
# dependency: xdotool and wmctrl | |
eval $(xdotool getactivewindow getwindowgeometry --shell) | |
DESKTOP=$(wmctrl -d | awk '{ print $4 }' | tr x ' ') | |
DWIDTH=$(echo $DESKTOP | cut -d ' ' -f 1) | |
DHEIGHT=$(echo $DESKTOP | cut -d ' ' -f 2) | |
case $1 in | |
left) |
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
#!/bin/sh | |
xephyr_options="-ac -screen ${1:-800x600}" | |
xephyr=$(which Xephyr) | |
if [ -z "$xephyr" ]; then | |
echo 'Xephyr not found' | |
exit 1 | |
fi | |
startx "$HOME/.xephyr_session" -- "$xephyr" $xephyr_options |
NewerOlder