View set-drag.ps1
param ( | |
[int]$drag = 4 | |
) | |
# https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-systemparametersinfoa | |
$importDefinition= @' | |
[DllImport("user32.dll", EntryPoint = "SystemParametersInfo")] | |
public static extern bool SystemParametersInfo(uint uiAction, uint uiParam, uint pvParam, uint fWinIni); | |
'@ | |
$importType = Add-Type -MemberDefinition $importDefinition -Name WinAPICall -Namespace SetDragSystemParametersInfo –PassThru |
View docker-content-tag.sh
#!/bin/bash | |
cat <<'EOF' >.dockerfile.content-tag | |
FROM busybox:1 | |
WORKDIR /src/ | |
ENTRYPOINT ["/bin/sh", "-c", "find . -type f \\! -path ./.dockerfile.content-tag -exec sha256sum -b {} +"] | |
COPY . /src/ | |
EOF | |
iid=$( docker image build -q -f .dockerfile.content-tag . ) |
View kubectl-evict
#!/bin/bash | |
print_usage () { | |
printf 'Usage: kubectl evict -n <namespace> <pod>\n' >&2 | |
} | |
main () { | |
if [ "-n" != "$1" ] && [ "--namespace" != "$1" ] | |
then | |
print_usage |
View install.sh
apt-get install -y \ | |
apt-transport-https \ | |
binutils \ | |
build-essential \ | |
python-pip \ | |
socat \ | |
sysstat \ | |
traceroute \ | |
unzip \ | |
zip |
View find-long-commit-messages.sh
#!/bin/bash | |
while read -r commit_hash | |
do | |
message=$( | |
git cat-file commit "${commit_hash}" | | |
sed '1,/^$/d' | |
) | |
if [ "${message:0:5}" = 'Merge' ] || [ "${message:0:6}" = 'Revert' ] |
View collect_usage_in_bytes.sh
#!/bin/bash | |
printf '%s,%s,%s,%s,%s,%s,%s,%s\n' \ | |
'dir' 'usage_in_bytes' \ | |
'cache' 'total_cache' \ | |
'rss' 'total_rss' \ | |
'rss_huge' 'total_rss_huge' | |
cd /sys/fs/cgroup/memory/ |
View collect_usage_in_bytes.sh
#!/bin/bash | |
printf '%s,%s,%s,%s,%s,%s,%s,%s\n' \ | |
'dir' 'usage_in_bytes' \ | |
'cache' 'total_cache' \ | |
'rss' 'total_rss' \ | |
'rss_huge' 'total_rss_huge' | |
cd /sys/fs/cgroup/memory/ |
View script.sh
#!/bin/bash | |
win_profile_dir=$(wslpath "$(cmd.exe /c "echo %USERPROFILE%" | tr -d '\r')") | |
win_dot_kube_dir="${win_profile_dir}/.kube" | |
win_kube_config="${win_dot_kube_dir}/config" | |
wsl_dot_kube_dir="${HOME}/.kube" |
View minikube-docker-env-wsl.bash
#!/bin/bash | |
if [ "$_" = "${BASH_SOURCE}" ] | |
then | |
printf 'source this script, do not execute.\n' >&2 | |
exit 1 | |
fi | |
eval $(minikube docker-env --shell bash) | |
if [ -n "${DOCKER_CERT_PATH}" ] && [ "${DOCKER_CERT_PATH:0:1}" != '/' ] |
View pod.yaml
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: example | |
spec: | |
initContainers: | |
- name: file-copy | |
image: busybox:latest | |
command: | |
- cp |
NewerOlder