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 | |
curl -fsSL https://get.docker.com | sh | |
docker run -d \ | |
--name=wg-easy \ | |
-e WG_HOST=$(curl -sL4 https://ifconfig.io) \ | |
-e WG_PERSISTENT_KEEPALIVE=25 \ | |
-e WG_DEFAULT_ADDRESS=192.168.210.x \ | |
-v /etc/wg-easy:/etc/wireguard \ |
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 | |
FOLDER_ID=<FOLDER_ID> | |
CLUSTER_ID=<CLUSTER_ID> | |
CLUSTER_NAME=<CLUSTER_NAME> | |
DIR=./$CLUSTER_NAME | |
set -xe |
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
db.NASA_MCDAODHD.aggregate([ | |
{ "$group": { | |
"_id": { "uid": "$loc", "sid": "$dt" }, | |
"dups": { "$push": "$_id" }, | |
"count": { "$sum": 1 } | |
}}, | |
{ "$match": { "count": { "$gt": 1 } }} | |
]).forEach(function(doc) { | |
doc.dups.shift(); | |
db.NASA_MCDAODHD.remove({ _id: { "$in": doc.dups } }); |
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
# Отключаем любые promt | |
ENV DEBIAN_FRONTEND noninteractive | |
# Удаляем мусор из имиджа | |
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | |
# Использование glibc для alpine | |
FROM alpine:3.2 | |
RUN apk --update add curl ca-certificates && \ | |
curl -Ls https://circle-artifacts.com/gh/andyshinn/alpine-pkg-glibc/6/artifacts/0/home/ubuntu/alpine-pkg-glibc/packages/x86_64/glibc-2.21-r2.apk > /tmp/glibc-2.21-r2.apk && \ |
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
func getTileHash(z, x, y int) int64 { | |
positions := make(map[int][2]int) | |
for currentZoom := 1; currentZoom <= z; currentZoom++ { | |
tileSize := int(math.Pow(2, float64(z-currentZoom))) | |
centerX, centerY := tileSize-1, tileSize-1 | |
if currentZoom > 1 { | |
n := int(math.Pow(2, float64(currentZoom-1))) | |
centerX += positions[currentZoom-1][0] * 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
defaults write com.apple.finder QLEnableTextSelection -bool true | |
killall Finder |
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
docker run --name=redis -d redis | |
docker run --name=postgres -e POSTGRES_PASSWORD=secret -d postgres | |
docker exec postgres createdb -U postgres -E utf-8 sentry | |
docker run --rm -it --link=postgres:postgres --link=redis:redis -v $(pwd):/home/user/.sentry sentry sentry upgrade | |
docker run --name=sentry --env="VIRTUAL_HOST=sentry.ndr.su" --link=postgres:postgres --link=redis:redis -v $(pwd):/home/user/.sentry -d sentry | |
docker run --name=sentry-celery --link=postgres:postgres --link=redis:redis -v $(pwd):/home/user/.sentry -d sentry sentry celery worker -B |
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
apt-get clean autoclean | |
apt-get autoremove --yes | |
rm -rf /var/lib/{apt,dpkg,cache,log}/ |
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 | |
set -x | |
pid=0 | |
# SIGUSR1-handler | |
my_handler() { | |
echo "my_handler" | |
} |
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 -f -N -L 9906:127.0.0.1:3306 [email protected] |
NewerOlder