Skip to content

Instantly share code, notes, and snippets.

@steelcowboy
steelcowboy / binomial_calculator.py
Last active January 16, 2016 23:01
Calculator for binomial distributions
# By Jim Heald
import math
while True:
answer = 0
n = float(input('n: '))
p = float(input('p: '))
st = int(input('start: '))
end = int(input('end: '))
@steelcowboy
steelcowboy / chocolateyinstall.ps1
Last active June 23, 2017 17:34
Vivado chocolateyinstall.ps1
$ErrorActionPreference = 'Stop';
$packageName= $env:ChocolateyPackageName
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$fileLocation = '\\129.65.138.9\Software$\Xilinx\Xilinx Vivado\Xilinx_Vivado_SDK_2016.2\Xilinx_Vivado_SDK_2016.2_0605_1\Xilinx_Vivado_SDK_2016.2_0605_1\xsetup.exe'
$configFile = Join-Path $toolsDir 'install_config.txt'
$installOptions = "--agree XilinxEULA,3rdPartyEULA,WebTalkTerms --batch Install --config $configFile"
$packageArgs = @{
@steelcowboy
steelcowboy / keybindings.json
Created October 7, 2017 01:03
VS Code -- Caps Lock to Backspace
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "capslock",
"command": "replacePreviousChar",
"args": {
"text": "",
"replaceCharCnt": 1},
"when": "editorTextFocus"
}
@steelcowboy
steelcowboy / get_lib_deps
Created June 12, 2018 00:34
Get an executable's Arch Linux dependencies
#!/usr/bin/env python3
import sys
import os
import subprocess
def main():
sop = subprocess.PIPE
pkgs = []
@steelcowboy
steelcowboy / mv_screenshot.sh
Created September 23, 2018 04:19
Manage screenshots made using GNOME Screenshot
#!/bin/bash
for sc in Screenshot*; do
echo Opening $sc with Eye of GNOME
eog "$sc"
echo -n "Enter a new filename for $sc, or type 'q' to quit or 'd' to delete: "
read dest
if [[ "$dest" == "q" ]]; then
exit 0
postfix/smtpd[205]: connect from mailu-front.web_default[docker.ip]
postfix/smtpd[205]: F0C951D82: client=web_webmail_1.web_default[docker.ip], sasl_method=XCLIENT, [email protected]
postfix/cleanup[221]: F0C951D82: replace: header Received: from mail.mysite.com (web_webmail_1.web_default [docker.ip])??by mail.mysite.com (Postfix) with ESMTPA id F0C951D82??for <[email protected]>; Mon, 28 Jan 2019 03:10:59 + from web_webmail_1.web_default[docker.ip]; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mail.mysite.com>: Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP])??by mail.mysite.com (Postfix) with ESMTPA id F0C951D82??for <[email protected]>; Mon, 28 Jan 2019 03:10:59 +0000 (UTC)
postfix/cleanup[221]: F0C951D82: message-id=<[email protected]>
postfix/qmgr[122]: F0C951D82: from=<[email protected]>, size=1147, nrcpt=1 (queue active)
postfix/smtpd[205]: disconnect from web_webmail_1.web_default[docker.ip] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
postf
relayhost = [email-smtp.us-west-2.amazonaws.com]:587
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3
smtp_tls_note_starttls_offer = yes
smtp_tls_protocols = !SSLv2,!SSLv3
smtp_tls_security_level = encrypt
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
alias_maps =
lmtp_host_lookup = native
message_size_limit = 50000000
milter_default_action = tempfail
milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen}
milter_protocol = 6
mydestination =
mydomain = mysite.com
myhostname = mail.mysite.com
mynetworks = 127.0.0.1/32 [::1]/128 192.168.203.0/24
smtp inet n - n - - smtpd
10025 inet n - n - - smtpd
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=reject_unlisted_sender,reject_authenticated_sender_login_mismatch,permit
-o smtpd_reject_unlisted_recipient=no
-o cleanup_service_name=outclean
outclean unix n - n - 0 cleanup
-o header_checks=pcre:/etc/postfix/outclean_header_filter.cf
pickup unix n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
@steelcowboy
steelcowboy / Postfix Dockerfile
Created January 28, 2019 17:13
Dockerfile to set up Postfix
FROM mailu/postfix:1.6
ARG SASLFILE=/etc/postfix/sasl_passwd
ADD postfix.cf /overrides/postfix.cf
ADD sasl_passwd $SASLFILE
RUN postmap hash:$SASLFILE
RUN chown root:root $SASLFILE $SASLFILE.db && chmod 0600 $SASLFILE $SASLFILE.db