- Download and make it executable
wget https://github.com/mailhog/MailHog/releases/download/v1.0.0/MailHog_linux_amd64
sudo cp MailHog_linux_amd64 /usr/local/bin/mailhog
sudo chmod +x /usr/local/bin/mailhog
- Make MailHog as a service
''' | |
This is an example of the server-side logic to handle slash commands in | |
Python with Flask. | |
Detailed documentation of Slack slash commands: | |
https://api.slack.com/slash-commands | |
Slash commands style guide: | |
https://medium.com/slack-developer-blog/slash-commands-style-guide-4e91272aa43a#.6zmti394c | |
''' |
function password_encode(password) | |
local bcrypt = require 'bcrypt' | |
return bcrypt.digest(password, 12) | |
end | |
function check_password(password, encoded_password) | |
local bcrypt = require 'bcrypt' | |
return bcrypt.verify(password, encoded_password) | |
end |
server { | |
listen *:80; | |
server_name repository.votre-serveur.com; | |
server_tokens off; | |
root /srv/reprepro; | |
autoindex on; # Permet de voir les fichiers. Commentez la ligne pour l'interdire. | |
access_log /var/log/nginx/repository.votre-serveur.com_access.log; | |
error_log /var/log/nginx/repository.votre-serveur.com_error.log; | |
} |
RewriteEngine On | |
# special mod_rewrite variables | |
RewriteRule .* - [E=MR_SPECIALS_API_VERSION:%{API_VERSION},NE] | |
RewriteRule .* - [E=MR_SPECIALS_THE_REQUEST:%{THE_REQUEST},NE] | |
RewriteRule .* - [E=MR_SPECIALS_REQUEST_URI:%{REQUEST_URI},NE] | |
RewriteRule .* - [E=MR_SPECIALS_REQUEST_FILENAME:%{REQUEST_FILENAME},NE] | |
RewriteRule .* - [E=MR_SPECIALS_IS_SUBREQ:%{IS_SUBREQ},NE] | |
RewriteRule .* - [E=MR_SPECIALS_HTTPS:%{HTTPS},NE] | |
#!/usr/bin/awk -f | |
# | |
# Take a PEM format file as input and split out certs and keys into separate files | |
# | |
BEGIN { n=0; cert=0; key=0; if ( ARGC < 2 ) { print "Usage: pem-split FILENAME"; exit 1 } } | |
/-----BEGIN PRIVATE KEY-----/ { key=1; cert=0 } | |
/-----BEGIN CERTIFICATE-----/ { cert=1; key=0 } | |
split_after == 1 { n++; split_after=0 } | |
/-----END CERTIFICATE-----/ { split_after=1 } |
Enable memberOf attribute on an openldap server.
Source: https://www.brianshowalter.com/blog/installing-configuring-openldap
# -*- coding:utf-8 -*- | |
''' | |
Simplistic script to parse the detailed AWS billing CSV file. | |
Script displays cost of S3 operations broken down per region, bucket and usage | |
type (either storage or network). It also sums up the amount of storage used per bucket. | |
Output is filtered wrt to costs < 1$. | |
See http://docs.aws.amazon.com/awsaccountbilling/latest/about/programaccess.html for | |
how to set up programmatic access to your billing. |
I've been having an issue with the following error appear in the prompt after upgrading to Yosemite. The solution was to source the git bash completion and prompt files from a local copy.
curl -o ~/.git-completion.bash https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
curl -o ~/.git-prompt.sh https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh
Then in:
vi ~/bash_profile
Add:
curl 'http://<rancher_server_ip>/v2-beta/apikey' -H 'content-type: application/json' --data-binary '{"type":"apiKey","accountId":"1a1","name":"kubectl","description":"Provides workstation access to kubectl"}' --compressed | jq -r '.publicValue + ":" + .secretValue' | base64 | tr /+ _- | tr -d = |