server {
server_name example.com;
return 301 $scheme://www.example.com$request_uri;
}
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
var hmacSha1Base64 = function (message) { | |
return require("crypto").createHmac('sha1', process.env.AMAZON_SECRET_ACCESS_KEY) | |
.update(message) | |
.digest('base64') | |
} | |
var expires = Math.floor(Date.now() / 1000) + 60 * 60 * 24 * 365 | |
var put_request = "PUT\n" + md5Base64 + "\n"+contentType+"\n"+expires+"\n/"+ "xxxxxxx/" + bucketObjectKey |
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
<?php | |
// PHP script to allow periodic cPanel backups automatically, optionally to a remote FTP server. | |
// Cron Job Command: /usr/local/bin/php /home/<cpanel-username>/fullbackup.php | |
// This script contains passwords. It is important to keep access to this file secure (we would ask you to place it in your home directory, not public_html) | |
// You need create 'backups' folder in your home directory ( or any other folder that you would like to store your backups in ). | |
// ********* THE FOLLOWING ITEMS NEED TO BE CONFIGURED ********* |
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
var COLORS = [ | |
{iconColor: '#536D2F', bgColor: '#DDE2D5'}, | |
{iconColor: '#5093A1', bgColor: '#DBE9EC'}, | |
{iconColor: '#AF2F30', bgColor: '#EFD6D6'}, | |
{iconColor: '#BE8341', bgColor: '#F2E6D9'}, | |
{iconColor: '#784FA0', bgColor: '#E4DCEC'}, | |
{iconColor: '#FFFFFF', bgColor: '#58B6E1'} | |
] | |
var fs = require('fs'); |
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 | |
# | |
# Run this script once per minute | |
# | |
# * * * * * /path/to/whois-watch.sh google.com apple.com >> /var/log/whois-watch.log 2>&1 | |
# update username in mail command | |
# update sed command depending on server return text | |
# |
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
for (var links = document.links, i = 0, length = links.length; i < length; i++) { | |
var link = links[i]; | |
if (link.hostname != window.location.hostname) { | |
link.onclick = function(e) { | |
var url = e.target.href; | |
var openingInNewWindow = (e.target.target && !e.target.target.match(/^_(self|parent|top)$/i)) || e.ctrlKey || e.shiftKey || e.metaKey; | |
ga('send', 'event', 'outbound', 'click', url, { | |
'transport': 'beacon', | |
'hitCallback': openingInNewWindow ? null : function() { | |
document.location = 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
selectFirstOnEnter(input){ | |
const _addEventListener = input.addEventListener; | |
let hasHitDown = false; | |
// Simulate a 'down arrow' keypress on hitting 'return' when no pac suggestion is selected, and then trigger the original listener. | |
function addEventListenerWrapper(type, listener) { | |
if (type === "keydown") { | |
var orig_listener = listener; | |
listener = function (event) { | |
if (event.which === 13) { | |
if (!hasHitDown) { |
I hereby claim:
- I am wei on github.
- I am towei (https://keybase.io/towei) on keybase.
- I have a public key whose fingerprint is 01F3 7324 4CA2 866D 1E17 B054 D380 E53F 849A 5C7C
To claim this, I am signing this object: