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 ( | |
"log" | |
"net/http" | |
"os" | |
"strings" | |
"k8s.io/client-go/informers" | |
"k8s.io/client-go/kubernetes" |
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
# Install latest su-exec | |
RUN set -ex; \ | |
\ | |
curl -o /usr/local/bin/su-exec.c https://raw.githubusercontent.com/ncopa/su-exec/master/su-exec.c; \ | |
\ | |
fetch_deps='gcc libc-dev'; \ | |
apt-get update; \ | |
apt-get install -y --no-install-recommends $fetch_deps; \ | |
rm -rf /var/lib/apt/lists/*; \ | |
gcc -Wall \ |
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 bash | |
mongodump --host HOST:PORT --db SOURCE_DB --username USERNAME --password PASSWORD --archive \ | |
| mongorestore --host HOST:PORT --nsFrom 'SOURCE_DB.*' --nsTo 'TARGET_DB.*' --username USERNAME --password PASSWORD --archive --drop |
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
from django.db import connection, connections | |
if connection.connection and not connection.is_usable(): | |
del connections._connections.default |
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 bash | |
for container in $(docker ps -q --all); | |
do | |
log_file=$(docker inspect --format='{{.LogPath}}' ${container}) | |
echo "Truncate file ${log_file}" | |
echo "" > "${log_file}" | |
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
<?xml version="1.0" encoding="utf-8"?> | |
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd"> | |
<Header> | |
<DocumentVersion>1.01</DocumentVersion> | |
<MerchantIdentifier>AXXXXXXXXXX</MerchantIdentifier> | |
</Header> | |
<MessageType>ProductImage</MessageType> | |
<Message> | |
<MessageID>1</MessageID> | |
<OperationType>Update</OperationType> |
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 | |
''' | |
Send an multipart email with HTML and plain text alternatives. The message | |
should be constructed as a plain-text file of the following format: | |
From: Your Name <your@email.com> | |
To: Recipient One <recipient@to.com> | |
Subject: Your subject line | |
--- |
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
curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rrubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}' |
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
SELECT | |
relname as "Table", | |
pg_size_pretty(pg_total_relation_size(relid)) As "Size", | |
pg_size_pretty(pg_total_relation_size(relid) - pg_relation_size(relid)) as "External Size" | |
FROM pg_catalog.pg_statio_user_tables ORDER BY pg_total_relation_size(relid) DESC; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder