This file contains hidden or 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
# This config allows backwards compatibility for insecure TLS 1.0 protocols for Microsoft Browsers | |
# see https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html | |
# General SSL settings | |
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH'; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_prefer_server_ciphers on; | |
This file contains hidden or 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 the one IP address and localhost connections, disallow all else | |
iptables -A INPUT -i lo -p tcp --dport mysql -j ACCEPT | |
iptables -A INPUT -i eth0 -p tcp --dport mysql -s 123.123.123.123 -j ACCEPT | |
iptables -A INPUT -p tcp --dport mysql -j DROP | |
# Use this on Debian to help persist over boot | |
# apt-get install iptables-persistent |
This file contains hidden or 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
<div> | |
Click <a href="/upload" class="modal-link" title="Upload your file">here</a> to upload an document. | |
</div> | |
<div id="dialog"></div> |
This file contains hidden or 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 | |
# outputs all databases in the live database to gzipped sql dumps | |
# removes all the dumps that are older than 8 hours | |
# restore the dump with gunzip < outputfile.sql.gz | mysql < mysql options> | |
USER="myuser" | |
PASSWORD="password" | |
HOST="database.server" | |
OUTPUT="/home/ubuntu/database_backups/backups" |
This file contains hidden or 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
<?php namespace App\Lib\Purlgurl; | |
/** | |
* Class Purlgurl | |
* | |
* This class provides the purlgurl functionality - tracking visitors, and obtaining the responder from the request | |
* | |
*/ | |
use App; |
This file contains hidden or 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
# Fail2Ban configuration file | |
# | |
# Regexp to catch known spambots and software alike. Please verify | |
# that it is your intent to block IPs which were driven by | |
# above mentioned bots. | |
[Definition] | |
badbotscustom = EmailCollector|WebEMailExtrac|TrackBack/1\.02|sogou music spider|Baiduspider |
This file contains hidden or 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
fizz = fn | |
{0, 0, _} -> "FizzBuzz" | |
{0, _, _} -> "Fizz" | |
{_, 0, _} -> "Buzz" | |
{_, _, a} -> "#{a}" | |
end | |
foo = fn (n) -> "#{IO.puts(fizz.({rem(n,3), rem(n,5), n}))}" end | |
for i <- 1..100 do |
This file contains hidden or 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
// laravel 5.1 kernel (http and console) to bootstrap using the custom ConfigureLogging class | |
public function __construct(Application $app, Router $router) | |
{ | |
parent::__construct($app, $router); | |
array_walk($this->bootstrappers, function(&$bootstrapper) | |
{ | |
if($bootstrapper === 'Illuminate\Foundation\Bootstrap\ConfigureLogging') | |
{ |
This file contains hidden or 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
# Read | |
# http://wiki.nginx.org/Pitfalls | |
# http://wiki.nginx.org/QuickStart# | |
# http://tautt.com/best-nginx-configuration-for-security/ | |
# | |
# Generate your key with: openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 | |
# Generate certificate: sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt | |
## redirects http traffic to https ## | |
server { |