Create a folder to store the databases :
mkdir -p /usr/share/GeoIP
Download Country IP database
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
gunzip GeoIP.dat.gz
| # from http://flask.pocoo.org/docs/1.0/cli/ | |
| # Setting Command Options | |
| # Click is configured to load default values for command options from environment variables. The variables use the pattern FLASK_COMMAND_OPTION. For example, to set the port for the run command, instead of flask run --port 8000: | |
| export FLASK_RUN_PORT=8000 | |
| flask run | |
| * Running on http://127.0.0.1:8000/ |
| public with sharing class SlackOpportunityPublisher { | |
| // Production business channel | |
| // private static final String slackURL = 'https://hooks.slack.com/services/######'; | |
| // Private channel for testing | |
| // private static final String slackURL = 'https://hooks.slack.com/services/#####'; | |
| public class Oppty { |
Create a folder to store the databases :
mkdir -p /usr/share/GeoIP
Download Country IP database
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
gunzip GeoIP.dat.gz
| { | |
| "AWSEBDockerrunVersion": "1", | |
| "Image": { | |
| "Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>", | |
| "Update": "true" | |
| }, | |
| "Ports": [ | |
| { | |
| "ContainerPort": "443" | |
| } |
| ''' | |
| This is an example of the server-side logic to handle slash commands in | |
| Python with Flask. | |
| Detailed documentation of Slack slash commands: | |
| https://api.slack.com/slash-commands | |
| Slash commands style guide: | |
| https://medium.com/slack-developer-blog/slash-commands-style-guide-4e91272aa43a#.6zmti394c | |
| ''' |
This is a sequel to "Postfix: relay to authenticated SMTP".
I would like to send mail from two different Gmail accounts using Postfix. Here is the relevant section in the Postfix documentation: Configuring Sender-Dependent SASL authentication.
As a concrete example, here's how to set up two Gmail accounts (only relevant sections of the config files are listed below):
/etc/postfix/main.cf:
# sender-dependent sasl authentication
smtp_sender_dependent_authentication = yes
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay
| #!/usr/bin/env python2 | |
| """ | |
| Author: takeshix <[email protected]> | |
| PoC code for CVE-2014-0160. Original PoC by Jared Stafford ([email protected]). | |
| Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP. | |
| """ | |
| import sys,struct,socket | |
| from argparse import ArgumentParser |
| import sqlalchemy | |
| from sqlalchemy.ext.declarative import declarative_base | |
| from sqlalchemy import Column, Integer, String, ForeignKey | |
| from sqlalchemy.orm import sessionmaker, relationship | |
| engine = sqlalchemy.create_engine('sqlite:///:memory:') | |
| Base = declarative_base() |
| #!/bin/bash | |
| DAT_DIR=/usr/share/GeoIP | |
| DAT_URLS="http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz" | |
| for FILE in $DAT_DIR/*.dat; do | |
| cp $FILE $FILE.bak | |
| done; | |
| for URL in $DAT_URLS; do |