Skip to content

Instantly share code, notes, and snippets.

@sc68cal
sc68cal / install_venv.sh
Created February 23, 2014 01:11
Python 3 venv bootstrap script
#!/bin/sh
# Create the virtual environment
python3 -m venv .venv
# Activate the virtual environment
source .venv/bin/activate
# Install setuptools and pip
curl -O https://pypi.python.org/packages/source/s/setuptools/setuptools-1.1.6.tar.gz
Jul 16 05:50:20 masakari spamd[93624]: prefork: child states: II
Jul 16 05:54:24 masakari sm-mta[42779]: STARTTLS=server, relay=host-190-95-227-2.powernet [190.95.227.2] (may be forge
d), version=TLSv1/SSLv3, verify=NO, cipher=DHE-RSA-AES256-SHA, bits=256/256
Jul 16 05:54:25 masakari sm-mta[42779]: s6G9sNIc042779: from=<gonza@gmail.com>, size=1830, class=0, nrcpts=1, msgid=<4
9401.197.228.254.107.1405502428.squirrel@190.95.227.2>, proto=ESMTP, daemon=IPv4, relay=host-190-95-227-2.powernet [19
0.95.227.2] (may be forged)
Jul 16 05:54:25 masakari spamd[93625]: spamd: connection from masakari.coreitpro.com [76.72.172.123] at port 49297
Jul 16 05:54:25 masakari spamd[93625]: spamd: processing message <49401.197.228.254.107.1405502428.squirrel@190.95.227
.2> for root:58
Jul 16 05:54:25 masakari spamd[93625]: spamd: identified spam (23.2/4.5) for root:58 in 0.2 seconds, 2187 bytes.
mysql> SELECT id, `binary`, agent_type, host from agents;
+--------------------------------------+---------------------------+--------------------+-----------------+
| id | binary | agent_type | host |
+--------------------------------------+---------------------------+--------------------+-----------------+
| 3eb0a51c-4f68-4189-bce0-0a4595ea7780 | neutron-openvswitch-agent | Open vSwitch agent | osctrl-cc38-b01 |
| 428e01c5-d13f-4f2b-8e05-28d6de0b46b8 | neutron-openvswitch-agent | Open vSwitch agent | oscomp-cc38-b01 |
| 99770ffd-d082-4883-ad03-6973d6c0ea93 | neutron-openvswitch-agent | Open vSwitch agent | oscomp-cc38-b02 |
| fbade3ae-7560-424b-ac42-ce48799297e0 | neutron-dhcp-agent | DHCP agent | osctrl-cc38-b01 |
| fd6f68eb-7299-45c5-ae00-6cb63dc77bb8 | neutron-metadata-agent | Metadata agent | osctrl-cc38-b01 |
/var/log/maillog.0.bz2-Jul 30 19:37:43 masakari sm-mta[33412]: s6UNbfIX033412: Milter add: heade
r: X-Spam-Status: Yes, score=82.3 required=4.5 tests=ADVANCE_FEE_2_NEW_MONEY,\n\tADVANCE_FEE_3_N
EW,ADVANCE_FEE_3_NEW_MONEY,ADVANCE_FEE_4_NEW,\n\tADVANCE_FEE_4_NEW_MONEY,ADVANCE_FEE_5_NEW,ADVAN
CE_FEE_5_NEW_MONEY,\n\tAXB_XMAILER_MIMEOLE_OL_024C2,BAYES_95,DEAR_BENEFICIARY,\n\tFILL_THIS_FORM
_FRAUD_PHISH,FORGED_MUA_OUTLOOK,FORGED_OUTLOOK_HTML,\n\tFORGED_OUTLOOK_TAGS,FORM_FRAUD_3,FORM_FR
AUD_5,FREEMAIL_ENVFROM_END_DIGIT,\n\tFREEMAIL_FROM,FREEMAIL_REPLYTO,FROM_MISSPACED,FROM_MISSP_FR
EEMAIL,\n\tFROM_MISSP_MSFT,FROM_MISSP_REPLYTO,FROM_MISSP_TO_UNDISC,FROM_MISSP_USER,\n\tFSL_CTYPE
_WIN1251,FSL_NEW_HELO_USER,HTML_MESSAGE,LOTS_OF_MONEY,LOTTO_DEPT,\n\tMIME_HTML_ONLY,MONEY_FORM_S
HORT,MONEY_FRAUD_3,MONEY_FRAUD_5,MONEY_FROM_MISSP,\n\tMSOE_MID_WRONG_CASE,NSL_RCVD_FROM_USER,
T_FILL_THIS_FORM_SHORT,US_DOLLARS_3\n\tautolearn=spam
@sc68cal
sc68cal / gist:3089573cd1daa831c48d
Created September 20, 2014 23:02
Kimsufi generated rc.conf fix
# IPv6 configuration
ipv6_enable="YES"
ipv6_network_interfaces="em0"
ifconfig_em0_ipv6="inet6 2607:5300:60:13a2::1 prefixlen 128"
# The folowing is commented out, because it ends up overriding ipv6_defaultrouter
#ipv6_static_routes="ovhgw"
#ipv6_route_ovhgw="2607:5300:60:13ff:ff:ff:ff:ff -prefixlen 128 -interface em0"
ipv6_defaultrouter="2607:5300:60:13ff:ff:ff:ff:ff"
hostname="atlas.coreitpro.com"
scolli208@HQSML-1081034 ~ » ndp -p
fd28:5bda:2ad1:18cb::/64 if=vboxnet1
flags=LOS vltime=infinity, pltime=infinity, expire=Never, ref=0
No advertising router
scolli208@HQSML-1081034 ~ » ifconfig vboxnet1
vboxnet1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 0a:00:27:00:00:01
inet 192.168.27.1 netmask 0xffffff00 broadcast 192.168.27.255
inet6 fe80::800:27ff:fe00:1%vboxnet1 prefixlen 64 scopeid 0xa
inet6 fd28:5bda:2ad1:18cb::1 prefixlen 64
Buzzwords in OpenStack by year:
2013 - Platform as a Service
2014 - "Containers"
2015 - "NFV"
Python 2.7.6 (default, Sep 9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import netaddr
>>> netaddr.valid_ipv4("192.168")
True
>>> netaddr.valid_ipv4("192.168.")
False
docs runtests: PYTHONHASHSEED='2794469160'
docs runtests: commands[0] | python setup.py build_sphinx
running build_sphinx
Running Sphinx v1.1.3
loading pickled environment... done
building [html]: all source files
updating environment: 0 added, 1 changed, 0 removed
reading sources... [100%] section1
looking for now-outdated files... none found
pickling environment... done
>>> API_ENDPOINT
'https://api.phila.gov/bike-share-stations/v1'
>>> r = requests.get(url=API_ENDPOINT)
>>> r.ok
False
>>> r.content
'<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body bgcolor="white">\r\n<center><h1>403 Forbidden</h1></center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n'
>>> r = requests.get(API_ENDPOINT, headers={'User-Agent': 'curl/7.37.1'})
>>> r.ok
True