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/bash | |
# Define the resource and namespace to be monitored | |
RESOURCE_TYPE=$1 # Can be replaced with other resource types, such as deployments, services, etc. | |
NAMESPACE=$2 # Can be replaced with the actual namespace | |
RESOURCE_NAME=$3 # If a specific resource name is specified, only monitor that resource; leave empty to monitor all resources of that type | |
# Get the initial resource YAML | |
PREVIOUS_YAML=$(kubectl get $RESOURCE_TYPE $RESOURCE_NAME -n $NAMESPACE -o yaml)$'\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
#!/usr/bin/env python | |
"""Simple HTTP Server With Upload. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" |
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 | |
if [[ -n "$1" ]]; then | |
pid=$(ps rax | awk '{print $1, $5}' | grep -i "$1" | cut -d ' ' -f 1) | |
if [[ -n $pid ]]; then | |
caffeinate -s -w "$pid" & | |
echo "Systemp sleep prevented by $1" | |
else | |
echo "Sorry, the $1 could not be found." | |
fi | |
else |
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
# BetterTouchTool | |
127.0.0.1 bettertouchtool.net | |
127.0.0.1 updates.bettertouchtool.net | |
127.0.0.1 folivora.ai | |
127.0.0.1 updates.boastr.net | |
127.0.0.1 updates.folivora.ai |
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 os | |
import re | |
regex = r"\[(\d+)\]" | |
for f in os.listdir("./"): | |
if f.endswith(".mp4"): | |
matches = re.finditer(regex, f, re.MULTILINE) | |
for num, match in enumerate(matches, start=1): | |
ep = match.group(1) | |
print(r'TV.%s.mp4' % ep) |
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 | |
install_v2ray(){ | |
echo "Install v2ray..." | |
if [[ ! -f /usr/bin/v2ray/v2ray ]] | |
then | |
curl -Ls https://install.direct/go.sh | bash | |
fi | |
mkdir -p /etc/v2ray |
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
package main | |
import ( | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/x509" | |
"crypto/x509/pkix" | |
"encoding/pem" | |
"fmt" | |
"math/big" |
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
class Python < Formula | |
desc "Interpreted, interactive, object-oriented programming language" | |
homepage "https://www.python.org/" | |
url "https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tar.xz" | |
sha256 "35446241e995773b1bed7d196f4b624dadcadc8429f26282e756b2fb8a351193" | |
revision 1 | |
bottle do | |
sha256 "1bc5a2d3f0a8602bf2f46de7c43fcb6dde4f110c0f4518d4e802cb1f733a43de" => :high_sierra | |
sha256 "131d39120ac6ca2f21bf231de7414c08916cea472bc5219e0bcb49541f77cb9f" => :sierra |
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
dev MTIzNDU2Cg== |
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/bash | |
PODS=$(kubectl get pods -n alauda-system |grep Running|grep $1|awk '{print $1}') | |
ARGS=${@:2} | |
for POD in $PODS | |
do | |
echo "Exec $ARGS on pod $POD" | |
kubectl exec -it -n alauda-system $POD -c $1 -- ${ARGS[@]} | |
done |
NewerOlder