See Amazon tutorial: Getting Started with Amazon EC2 Linux Instances
See Amazon tutorial: Installing a LAMP Web Server on Amazon Linux
| # Author : Niloy Chakraborty | |
| # AWS Schedule Expression cron expression validator | |
| import re | |
| from voluptuous import Invalid | |
| import datetime | |
| minute_regex = r"^([*]|([0]?[0-5]?[0-9]?)|(([0]?[0-5]?[0-9]?)(\/|\-)([0]?[0-5]?[0-9]?))|" \ | |
| "(([0]?[0-5]?[0-9]?)((\,)([0]?[0-5]?[0-9]?))*))$" |
| "use strict"; | |
| // Load plugins | |
| const autoprefixer = require("autoprefixer"); | |
| const browsersync = require("browser-sync").create(); | |
| const cp = require("child_process"); | |
| const cssnano = require("cssnano"); | |
| const del = require("del"); | |
| const eslint = require("gulp-eslint"); | |
| const gulp = require("gulp"); |
| import base64 | |
| import hashlib | |
| from Crypto import Random | |
| from Crypto.Cipher import AES | |
| class AESCipher(object): | |
| def __init__(self, key): | |
| self.key = hashlib.sha256(key.encode()).digest() |
| import smtplib | |
| import os | |
| def send_email(host, port, username, password, subject, body, mail_to, mail_from = None, reply_to = None): | |
| if mail_from is None: mail_from = username | |
| if reply_to is None: reply_to = mail_to | |
| message = """From: %s\nTo: %s\nReply-To: %s\nSubject: %s\n\n%s""" % (mail_from, mail_to, reply_to, subject, body) | |
| print (message) | |
| try: |
See Amazon tutorial: Getting Started with Amazon EC2 Linux Instances
See Amazon tutorial: Installing a LAMP Web Server on Amazon Linux
This is a guide for aligning images.
See the full Advanced Markdown doc for more tips and tricks
| """Google spreadsheet related. | |
| Packages required: gspread, cryptography, oauth2client, google-api-python-client | |
| For OSX see | |
| * http://stackoverflow.com/a/33508676/315168 | |
| """ | |
| import logging |
| // Comcast Cable Communications, LLC Proprietary. Copyright 2014. | |
| // Intended use is to display browser notifications for critical and time sensitive events. | |
| var _ComcastAlert = (function(){ | |
| return { | |
| SYS_URL: '/e8f6b078-0f35-11de-85c5-efc5ef23aa1f/aupm/notify.do' | |
| , dragObj: {zIndex: 999999} | |
| , browser: null | |
| , comcastCheck: 1 | |
| , comcastTimer: null | |
| , xmlhttp: null |
If you're not familiar: What is fail2ban? fail2ban is an awesome linux service/monitor that scans log files (e.g. auth.log for SSH) for potentially malicious behavior. Once fail2ban is tripped it will ban users for a specified duration by adding rules to Iptables. If you're unfamiliar with fail2ban Chris Fidao has a wonderful (& free!) series about security including setting up fail2ban here.
Recently Laravel released a new feature in 5.1 to throttle authentication attempts by simply adding a trait to your authentication controller. The Laravel throttle trait uses the inputted username, and IP address to throttle attempts. I love seeing this added to a framework out of the box, but what about some of our other apps not built on Laravel? Like a WordPress login? Or even an open API etc.? Ultimately,