https://docs.docker.com/docker-for-mac/osxfs/#ssh-agent-forwarding
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
# NOTE: registry keys for IE 8, may vary for other versions | |
$regPath = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' | |
function Clear-Proxy | |
{ | |
Set-ItemProperty -Path $regPath -Name ProxyEnable -Value 0 | |
Set-ItemProperty -Path $regPath -Name ProxyServer -Value '' | |
Set-ItemProperty -Path $regPath -Name ProxyOverride -Value '' | |
[Environment]::SetEnvironmentVariable('http_proxy', $null, 'User') |
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
<source> | |
type http | |
port 8888 | |
bind 127.0.0.1 | |
</source> | |
<match test.**> | |
type copy | |
<store> |
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
ffmpeg -i "in.avi" -bsf:v mpeg4_unpack_bframes -vcodec copy "out.avi" |
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
<!doctype html> | |
<html> | |
<body> | |
<script src="https://www.youtube.com/iframe_api"></script> | |
<script> | |
function onYouTubeIframeAPIReady() { | |
console.log('API ready') | |
var player = new YT.Player('ytplayer', { | |
events: { | |
onReady: function() { |
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
# https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/filter/core.py | |
# https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/kms.html | |
import boto3 | |
import base64 | |
kms = boto3.client('kms', region_name='eu-central-1') | |
def aws_kms_decrypt(ciphertext): | |
''' |
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
set -ex | |
# https://kubernetes.io/docs/tasks/run-application/run-stateless-application-deployment/ | |
# create | |
kubectl apply -f https://k8s.io/examples/application/deployment.yaml | |
kubectl describe deployment nginx-deployment | |
kubectl get pods -l app=nginx | |
sleep 20s |
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 sh | |
# https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-snapshots.html | |
snapshots=$( \ | |
aws ec2 describe-snapshots \ | |
--region eu-central-1 \ | |
--owner-id $OWNER_ID \ | |
--filters 'Name=description,Values="Created by CreateImage*",Name=status,Values=completed' | |
) |
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
grep -q docker /proc/1/cgroup |
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 | |
def test_user_input(monkeypatch): | |
inputs = [10, 'y'] | |
input_generator = (i for i in inputs) | |
monkeypatch.setattr('__builtin__.raw_input', lambda prompt: next(input_generator)) | |
assert raw_input('how many?') == 10 | |
assert raw_input('you sure?') == 'y' |
NewerOlder