Skip to content

Instantly share code, notes, and snippets.

@thorr18
thorr18 / new-notebook()
Created May 8, 2021 23:23
Tired of manually creating ipynb files
# jupyter notebook creation convenience for ~/.zshrc:
new-notebook() {
if [ ! -f "$(pwd)/$1.ipynb" ]; then
echo "{
\"cells\": [],
\"metadata\": {},
\"nbformat\": 4,
\"nbformat_minor\": 2
}" > "$(pwd)/$1.ipynb"
echo "***Created New Notebook at: "
#!/usr/bin/env bash
mainInt="en4"
netstat -nr -f inet
for i in {0..3}; do
echo flushing,...
sudo route -n flush
done
@thorr18
thorr18 / ACTUNNEL_ASA.cfg
Created August 13, 2019 19:15
ACL for internet access
ASA Version 9.3(2)
!
hostname ACTUNNEL_ASA
ip local pool ACTUNNEL_POOL 10.10.11.1-10.10.11.20 mask 255.255.255.0
!
interface GigabitEthernet0/0
nameif outside
security-level 0
ip address 172.16.21.1 255.255.255.0
!
@thorr18
thorr18 / scpCopy.txt
Last active June 11, 2019 01:06
Copy with scp can be weird
SCP is kinda weird.
To copy all files in 3 levels of nested directories ending in foo.bar, such as 123foo.bar & 456foo.bar:
scp USER@SERVER:'/path/to/some\ directory/*/*/*foo.bar' ./
Notice the directory name has a space in it so we escape with a backslash.
An alternative to the escape character would be double quotes within the single quotes, around the non wild part of the source path:
scp USER@SERVER:'"/path/to/some directory"/*/*/*foo.bar' ./
The destination of ./ means local directory.
@thorr18
thorr18 / 11MySQL_errors.dbg
Created June 20, 2017 02:46
MySQL user create failures during terraform apply .
packet_device.virl (remote-exec): ----------
packet_device.virl (remote-exec): ID: root-hostname-wildcard
packet_device.virl (remote-exec): Function: mysql_user.present
packet_device.virl (remote-exec): Name: root
packet_device.virl (remote-exec): Result: False
packet_device.virl (remote-exec): Comment: Failed to create user root@F257DABA
packet_device.virl (remote-exec): Started: 02:01:07.319391
packet_device.virl (remote-exec): Duration: 4.864 ms
packet_device.virl (remote-exec): Changes:
packet_device.virl (remote-exec): ----------
@thorr18
thorr18 / plugin_install_virtualbox.dbg
Created June 15, 2017 05:36
Vagrant plugin install after downgrade to 1.8.7
BsMBP:virl_boxcutter bem$ vagrant plugin install virtualbox --debug
INFO global: Vagrant version: 1.8.7
INFO global: Ruby version: 2.2.5
INFO global: RubyGems version: 2.4.5.1
INFO global: VAGRANT_OLD_ENV_EDITOR="subl"
INFO global: VAGRANT_OLD_ENV_SHLVL="1"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded"
INFO global: VAGRANT_OLD_ENV_TERM_SESSION_ID="3BF81929-C0DF-4B68-B104-C2D52F980E3B"
INFO global: VAGRANT_OLD_ENV_USER="bem"
@thorr18
thorr18 / vagrant174_plugin_install.dbg
Created June 15, 2017 05:29
Vagrant 1.7.4 Plugin Install after downgrading
BsMBP:virl_boxcutter bem$ vagrant plugin install virtualbox --debug
INFO global: Vagrant version: 1.7.4
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO global: VAGRANT_OLD_ENV_PWD="/Users/bem/factory/virl_boxcutter"
INFO global: VAGRANT_OLD_ENV_HOME="/Users/bem"
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/gems/vagrant-1.7.4/bin/vagrant"
INFO global: VAGRANT_OLD_ENV_TERM_PROGRAM="Apple_Terminal"
INFO global: VAGRANT_OLD_ENV_LOGNAME="bem"
INFO global: VAGRANT_OLD_ENV_TMPDIR="/var/folders/8m/6dsl12z52g7b_9f4kh1yb0s40000gn/T/"
@thorr18
thorr18 / failed_to_bring_up_eth0.snip
Created June 13, 2017 17:46
Errors with vagrant@vagrant:~/virl_packet$ terraform apply .
packet_device.virl (remote-exec): Name: ifdown --force eth0 - Function: cmd.run - Result: Clean Started: - 06:44:27.601363 Duration: 6.454 ms
packet_device.virl (remote-exec): Name: salt-call --local ip.build_interface eth0 eth True proto=dhcp - Function: cmd.run - Result: Changed Started: - 06:44:27.607982 Duration: 821.891 ms
packet_device.virl (remote-exec): Name: /etc/dhcp/dhclient.conf - Function: file.managed - Result: Changed Started: - 06:44:28.430258 Duration: 21.788 ms
packet_device.virl (remote-exec): ----------
packet_device.virl (remote-exec): ID: eth0 ifup
packet_device.virl (remote-exec): Function: cmd.run
packet_device.virl (remote-exec): Name: ifup eth0
packet_device.virl (remote-exec): Result: False
packet_device.virl (remote-exec): Comment: Command "ifup eth0" run
packet_device.virl (remote-exec): Started: 06:44:28.452693
@thorr18
thorr18 / vagrant_plugin_install.dbg
Created June 13, 2017 05:15
Debug output from failed Vagrant plugin install
vagrant plugin install virtualbox --debug
INFO global: Vagrant version: 1.9.5
INFO global: Ruby version: 2.2.5
INFO global: RubyGems version: 2.4.5.1
INFO global: VAGRANT_OLD_ENV_TERM="xterm-256color"
INFO global: VAGRANT_OLD_ENV_SECURITYSESSIONID="186a7"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded"
INFO global: VAGRANT_OLD_ENV_PWD="/Users/bem"
INFO global: VAGRANT_OLD_ENV_XPC_SERVICE_NAME="0"
INFO global: VAGRANT_OLD_ENV_SHLVL="1"
!UDLD sends frames to a special fake MAC address and it wants them echod back by the UDLD on the other device.
!A unidirectional fiber failure should be simulatable with a MAC address filter.
!UDLD only acts if a port enters bidirectional UDLD state before tranistioning to unidirectional.
!
!Wait for bidirectional state, then:
mac access-list extended UDLD_FILTER
deny any host 0100.0ccc.cccc
perm any
!
int G x/x