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
# Elasticsearch Upstart Script | |
description "Elasticsearch upstart script" | |
start on (net-device-up | |
and local-filesystems | |
and runlevel [2345] | |
and startup) | |
stop on runlevel [016] |
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 | |
docker run -d --name gitlab-runner --restart always \ | |
-v /data/gitlab-runner/config:/etc/gitlab-runner \ | |
-v /var/run/docker.sock:/var/run/docker.sock \ | |
gitlab/gitlab-runner:lates |
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 | |
# Replace hostname | |
HOSTNAME=[HOSTNAME HERE] | |
docker run --detach \ | |
--hostname $HOSTNAME \ | |
--publish 443:443 --publish 80:80 --publish 22:22 --publish 9418:9418 \ | |
--name gitlab \ | |
--restart always \ |
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
openssl dhparam -out dhparam.pem 4096 |
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
#Allow access to all User-agents: | |
location /robots.txt {return 200 "User-agent: *\nDisallow:\n";} | |
#Disallow access to every User-agent: | |
location /robots.txt {return 200 "User-agent: *\nDisallow: /\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
... | |
app.use(function(req, res, next){ | |
if (app.get('graceful_shutdown') === true) { | |
res.set('Connection', 'close'); | |
} | |
next(); | |
}); | |
app.set('graceful_shutdown_start', 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
# grab 10 lines before & after the pattern | |
# make sure escape sequences are reained so it looks pretty (that's what the -r flag is for in less) | |
grep -B 10 -A 10 "error" file.log | less -r |
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
security find-generic-password -ga "SSID" |
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
const http = require("http"); | |
const express = require("express"); | |
const app = express(); | |
const HOST = "localhost"; | |
const PORT = 4000; | |
const PROXY_PORT = 8080; | |
setupProxy(); |
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
const source = { a: 1, b: 2, c: 3 } | |
const toRemove = "c" | |
const { [toRemove]: toRemove, ...rest } = source | |
// rest will be { a: 1, b: 2 } | |
// source remains { a: 1, b: 2, c: 3} |