src: https://www.stationx.net/nmap-cheat-sheet
| Switch | Example | Description |
src: https://www.stationx.net/nmap-cheat-sheet
| Switch | Example | Description |
When applications are running in production, they become black boxes that need to be traced and monitored. One of the simplest, yet main, ways to do so is logging. Logging allows us - at the time we develop our software - to instruct the program to emit information while the system is running that will be useful for us and our sysadmins.
| AWSTemplateFormatVersion: '2010-09-09' | |
| Description: Cognito Stack | |
| Parameters: | |
| AuthName: | |
| Type: String | |
| Description: Unique Auth Name for Cognito Resources | |
| Resources: | |
| # Creates a role that allows Cognito to send SNS messages | |
| SNSRole: |
| import re | |
| def replace(string, substitutions): | |
| substrings = sorted(substitutions, key=len, reverse=True) | |
| regex = re.compile('|'.join(map(re.escape, substrings))) | |
| return regex.sub(lambda match: substitutions[match.group(0)], string) |
| def get_attachment(msg, content_type): | |
| """ | |
| Moves through a tree of email Messages to find an attachment. | |
| :param msg: An email Message object containing an attachment in its Message tree | |
| :param content_type: The type of attachment that is being searched for | |
| :return: An email Message object containing base64 encoded contents (i.e. the attachment) | |
| """ | |
| attachment = None | |
| msg_content_type = msg.get_content_type() |
| --- | |
| - hosts: localhost | |
| gather_facts: no | |
| vars: | |
| postgresql_users: | |
| prod: | |
| - group: ca | |
| users: | |
| - user1 | |
| - user2 |
| #!/bin/bash | |
| USERNAME="your username here" | |
| SFTPHOST="your sftp host" | |
| SFTPPORT=22 # or other port, if non-standard | |
| # Create SSH key-pair for SFTP access | |
| # (creates pair with no passphrase) | |
| ssh-keygen -b 2048 -t rsa -C "$SFTPHOST" -N "" -f ~/.ssh/id_rsa.sftp |
| # A simple cheat sheet of Spark Dataframe syntax | |
| # Current for Spark 1.6.1 | |
| # import statements | |
| from pyspark.sql import SQLContext | |
| from pyspark.sql.types import * | |
| from pyspark.sql.functions import * | |
| #creating dataframes | |
| df = sqlContext.createDataFrame([(1, 4), (2, 5), (3, 6)], ["A", "B"]) # from manual data |
A curated list of AWS resources to prepare for the AWS Certifications
A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.