There are now official docs, so follow those as they'll be up-to-date and easier to follow.
#!/usr/bin/python3 | |
#pingscanner.py | |
import sys | |
from scapy.all import * | |
ip = sys.argv[1] # command line argument | |
icmp = IP(dst=ip)/ICMP() | |
#icmp = IP(dst=ip)/TCP() | |
#IP defines the protocol for IP addresses | |
#dst is the destination IP address | |
#TCP defines the protocol for the ports |
import os | |
import re | |
import yaml | |
def parse_config(path=None, data=None, tag='!ENV'): | |
""" | |
Load a yaml configuration file and resolve any environment variables | |
The environment variables must have !ENV before them and be in this format | |
to be parsed: ${VAR_NAME}. |
#!/usr/bin/env bash | |
# install docker | |
# https://docs.docker.com/engine/installation/linux/ubuntulinux/ | |
# install docker-compose | |
# https://docs.docker.com/compose/install/ | |
# install letsencrypt | |
# https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04 |
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: |
Proposal for a lightning talk at the Reactive 2016.
Keep calm and like/retweet it on Twitter and star this Gist to vote on this talk.
I work at Grammarly. We like React and happily use it in our applications. However, sometimes something goes wrong and bugs creep into the code. Here comes testing. It helps make us confident about the quality of our code.
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
IE9, IE10, and IE11 don't properly scale SVG files added with img
tags when viewBox
, width
and height
attributes are specified. View this codepen on the different browsers.
Image heights will not scale when the images are inside containers narrower than image widths. This can be resolved in 2 ways.
As per this answer on Stackoverflow, the issue can be resolved by removing just the width
and height
attributes.
using System.Collections.Generic; | |
using System.Drawing; | |
using MonoTouch.CoreAnimation; | |
using MonoTouch.CoreGraphics; | |
using MonoTouch.Foundation; | |
using MonoTouch.ImageIO; | |
using MonoTouch.UIKit; | |
namespace PuppyKittyOverflow.Touch | |
{ |
select.form-control + .chosen-container.chosen-container-single .chosen-single { | |
display: block; | |
width: 100%; | |
height: 34px; | |
padding: 6px 12px; | |
font-size: 14px; | |
line-height: 1.428571429; | |
color: #555; | |
vertical-align: middle; | |
background-color: #fff; |