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 | |
#--------------------------------------------------------------------------------# | |
# # | |
# Fix WSL DNS resolution with Cisco AnyConnect # | |
# # | |
# ! Don't forget to set this configuration in /etc/wsl.conf: # | |
# [network] # | |
# generateResolvConf = false # | |
# # | |
# Based on: # |
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 | |
CREDENTIALS_FILE=~/.aws/credentials | |
remove_profile() { | |
PROFILE=${1} | |
echo "Paste profile data from SSO" | |
sed -i -e "/\[${PROFILE}\]/,+3d" ${CREDENTIALS_FILE} | |
} |
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
(defn sign-url [{:keys [s3-bucket s3-key http-method-str content-type] :as all}] | |
(let [s3-key (if (string? s3-key) | |
s3-key | |
(str "tmp-" (java.util.UUID/randomUUID) ".json")) | |
http-method-str (or http-method-str "GET") | |
content-type (or content-type "application/octet-stream") | |
expires (-> 3 t/hours t/from-now to-date) | |
s3-client (AmazonS3Client. (DefaultAWSCredentialsProviderChain.)) | |
s3-url (.getResourceUrl s3-client s3-bucket s3-key) | |
url (.generatePresignedUrl s3-client |
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 | |
HELP=false | |
LIST=false | |
DELETE=false | |
TAG=EMPTY | |
REPOSITORY=EMPTY | |
ACCEPT_HEADER="application/vnd.docker.distribution.manifest.v2+json" |
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
total 1608 | |
#!/bin/bash | |
host=$1 | |
ping $host | while read pong; do | |
echo $pong | grep --line-buffered -o 'time=\S*' | \ | |
sed -e 's/time=//' | \ | |
xargs -I {} aws cloudwatch put-metric-data --namespace wifi-ping --metric-name ping-latency --dimensions "host=$host" --timestamp "$(date)" --unit Milliseconds --value {} | |
done |
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 (com.amazonaws ClientConfiguration) | |
(com.amazonaws.auth BasicAWSCredentials) | |
(com.amazonaws.services.cloudwatch AmazonCloudWatchClient) | |
(com.amazonaws.services.cloudwatch.model PutMetricDataRequest MetricDatum StandardUnit Dimension)) | |
(defn get-aws-client [aws-config] | |
(info (str "aws-config: " aws-config)) | |
(let [port (:https-proxy-port aws-config) |
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
(defn update-in-dataset | |
"Takes a dataset and apply the func on the value of the given keys" | |
[dataset keys func] | |
(let [t (fn [k m] (reduce #(assoc %1 %2 (func (%2 %1))) m k))] | |
(map #(t keys %) dataset))) |
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_ENV="$HOME/.ssh/environment" | |
function start_agent { | |
echo "Initialising new SSH agent..." | |
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}" | |
echo succeeded | |
chmod 600 "${SSH_ENV}" | |
. "${SSH_ENV}" > /dev/null | |
/usr/bin/ssh-add; | |
} |
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 | |
if [ "$(id -u)" != "0" ]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
AMOUNT=5 | |
NAME="xymon" |
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
{:+ {:app {} | |
:editor {"alt-w" [:editor.watch.watch-selection] | |
"alt-shift-w" [:workspace.show] | |
"alt-shift-c" [:toggle-console] | |
"ctrl-left" [:paredit.shrink.right] | |
"ctrl-right" [:paredit.grow.right] | |
}}} |
NewerOlder