This file contains hidden or 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
$ envchain -s minio AWS_ACCESS_KEY_ID | |
minio.AWS_ACCESS_KEY_ID: XXX | |
$ envchain -s minio AWS_SECRET_ACCESS_KEY | |
minio.AWS_SECRET_ACCESS_KEY: XXX | |
$ envchain minio docker run --rm -it -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY amazon/aws-cli --endpoint-url https://[MinIO Endpoint] s3 ls |
This file contains hidden or 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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
labels: | |
app: wordpress | |
name: blog | |
namespace: default | |
spec: | |
replicas: 1 | |
selector: |
This file contains hidden or 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
# not used, copied function body into _delegate | |
function _executables { | |
local exclude=$(compgen -abkA function | sort) | |
local executables=$( | |
comm -23 <(compgen -c) <(echo $exclude) | |
type -tP $( comm -12 <(compgen -c) <(echo $exclude) ) | |
) | |
COMPREPLY=( $(compgen -W "$executables" -- ${COMP_WORDS[COMP_CWORD]}) ) | |
} |
This file contains hidden or 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 | |
tmpfile=$(mktemp) | |
while true; do | |
curl --silent http://10.5.5.9/gp/gpMediaList > $tmpfile | |
grep "busy" $tmpfile > /dev/null | |
if [ $? -eq 1 ]; then break; fi | |
sleep 1 | |
done |
This file contains hidden or 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 "net/http" | |
require 'net/https' | |
require "uri" | |
require "json" | |
require "fileutils" | |
require "date" | |
def fetch(url, sessid) |
This file contains hidden or 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
#include <linux/bpf.h> | |
int pass(struct __sk_buff *skb) { | |
return BPF_OK; // packet continues | |
// return BPF_DROP; // packet drops | |
} |
This file contains hidden or 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 | |
class String | |
def to_i_first | |
self.match(/\d+/)[0].to_i | |
end | |
def unquote_str | |
self.match(/"(.*)"/)[1] | |
end |
This file contains hidden or 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 LazyProduct | |
include Enumerable | |
def initialize(array) | |
@array = array | |
end | |
def self.from(array) | |
new(array) | |
end |
This file contains hidden or 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
-- HOWTO: | |
-- after saving it, open with Script Editor (default) and run it | |
-- PREREQUISITES: | |
-- make sure your Keynote presentation is open in the background | |
set presenterNotes to "" | |
set slideNumber to 1 | |
tell application "Keynote" |
This file contains hidden or 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
MERGE {destination} T | |
USING ( | |
SELECT * EXCEPT(rn) | |
FROM ( | |
SELECT | |
*, | |
row_number() over (PARTITION BY {primary_keys} ORDER BY updated_at DESC) AS rn | |
FROM {source}) | |
WHERE rn = 1 | |
) S |