Skip to content

Instantly share code, notes, and snippets.

View ev0rtex's full-sized avatar

David Warkentin ev0rtex

View GitHub Profile

How to use 1Password and 2FA with eTrade

IMPORTANT!
As of May 17, 2020, python-vipaccess stopped working for provisioning new Symantec VIP Access tokens (which was its raison d'être).
As of May 27, 2020, it's working again.
It might stop working again. and we might not be able to get it to work again (see #39)

Note: Your password cannot be more than 26 characters for you to use 2FA in general. eTrade makes you enter your 2FA code appened to your password to login and limits the length of password input to 32 characters, thus further restricting the maximum length of your actual password.

@ahmetozer
ahmetozer / IPv4-IPv6-domain-regex.go
Last active December 14, 2023 22:28
Ipv4 - IPv6 - domain Regex Golang
ipv6_regex := `^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$`
ipv4_regex := `^(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.|$)){4})`
domain_regex := `^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$`
match, _ := regexp.MatchString(ipv4_regex+`|`+ipv6_regex+`|`+domain_regex, host)
if match {
fmt.Println("Input is valid")
} else {
fmt.Println("Given input does not match")
re
@lcarsos
lcarsos / restore_functionality.sh
Last active March 28, 2024 17:32
Repeatedly kill sentinelone so you can actually use the processor and ram on your mac
#!/usr/bin/env bash
# Usage: sudo ./restore_functionality.sh
#ps aux | grep sentinel | awk -F " +" '{print $2}' | xargs kill
while true; do
launchctl kill SIGKILL system/com.crowdstrike.falcond
launchctl kill SIGKILL system/com.crowdstrike.userdaemon
launchctl kill SIGKILL system/com.sentinelone.sentineld
launchctl kill SIGKILL system/com.sentinelone.sentineld-helper
@gweakliem
gweakliem / okta.sh
Created August 15, 2019 00:08
Okta SAML authentication logic as a bash script
OKTA_DOMAIN= # e.g. example.okta.com
curl -d '{ "username":"$USERNAME","password":"$PASSWORD" }' -c cookie_jar.txt \
-H "Content-Type: application/json" -b cookie_jar.txt -c cookie_jar.txt \
https://$OKTA_DOMAIN/api/v1/authn > auth.json
{
"stateToken": "00oBpbTzKnRdKLYvc8yNBdFTusuoS4KUhdANgrMsOt",
"expiresAt": "2019-07-08T22:54:32.000Z",
"status": "MFA_REQUIRED",
"_embedded": {
@laggardkernel
laggardkernel / startup-time-of-zsh.md
Last active April 12, 2024 13:24
Comparison of ZSH frameworks and plugin managers

Comparison of ZSH frameworks and plugin managers

Changelog

  • update 1: add a FAQ section
  • update 2: benchmark chart and feature comparison table
  • update 3:
    • improve the table with missing features for antigen
    • new zplg times result

TLDR

@ThomasLeister
ThomasLeister / cloud-ubuntu-netplan-secondary-ip-static.md
Created May 25, 2018 08:30
Ubuntu netplan config for secondary ip address

In case there's already a DHCP config for netplan for the private IP address:

File: /etc/netplan/50-cloud-init.yaml

Contents:

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active April 15, 2024 19:36 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@emilefraser
emilefraser / mac-setup-script.sh
Last active April 16, 2023 02:47
[Mac Setup Script] #mac #install #configure
# Complete macOS Setup
# From clean install to fully configured.
# Step 1: Init Environment
#Temporarily Disable sudo Password Timeout
#The sudo password timeout is re-enabled at the end of this script. ##+BEGIN_SRC sh sudo tee /etc/sudoers.d/timeout > /dev/null <<-EOF Defaults timestamp_timeout=-1 EOF ##+END_SRC
##+BEGIN_SRC sh sudo tee /etc/sudoers.d/installer > /dev/null <<-EOF %admin ALL=(ALL) NOPASSWD:SETENV: /usr/sbin/installer EOF ##+END_SRC
@matthewjberger
matthewjberger / instructions.md
Last active April 14, 2024 11:21
Install a nerd font on ubuntu

1.) Download a Nerd Font

2.) Unzip and copy to ~/.fonts

3.) Run the command fc-cache -fv to manually rebuild the font cache

@thomasdarimont
thomasdarimont / readme.md
Last active March 15, 2024 08:56
Example for decoding a JWT Payload with your Shell (bash, zsh...)

Setup

Add this to your .profile, .bashrc, .zshrc...

decode_base64_url() {
  local len=$((${#1} % 4))
  local result="$1"
  if [ $len -eq 2 ]; then result="$1"'=='
  elif [ $len -eq 3 ]; then result="$1"'=' 
  fi
 echo "$result" | tr '_-' '/+' | openssl enc -d -base64