Skip to content

Instantly share code, notes, and snippets.

View alexleekt's full-sized avatar
🎯
Focusing

(Alex) Kwan Ting Lee alexleekt

🎯
Focusing
View GitHub Profile
@alexleekt
alexleekt / script.js
Created February 16, 2021 19:51
robinhood history to excel and google sheets
// exports robinhood history to tab-separated file which can be imported to excel and google sheets
//
// modified version of the script from https://medium.com/@anonovation/how-to-download-your-robinhood-transaction-history-357b1ff4df15
// go to https://robinhood.com/account/history in Chrome
// Scroll down to the bottom to where it says “Show more items” and click that button (so that all transactions are shown)
// Open the Chrome Dev Tools window (Windows — Ctrl + Shift + I, Mac — Option + Cmd + I)
// Paste this code into the console
let csv = "Date\tType\tTotal\tPrice per share\tNumber of Shares\n";
let sections = document.querySelectorAll('section');
@alexleekt
alexleekt / alacritty.yml
Last active April 20, 2020 20:56
alacritty.yml
# Reference: https://github.com/alacritty/alacritty/blob/master/alacritty.yml
colors: # https://github.com/arcticicestudio/nord-alacritty
primary:
background: '0x2E3440'
foreground: '0xD8DEE9'
cursor:
text: '0x2E3440'
cursor: '0xD8DEE9'
normal:
@alexleekt
alexleekt / exiftool.sh
Created September 9, 2018 19:00
exiftool renaming script
exiftool -overwrite_original -Artist="Kwan Ting Lee (Alex)" -Copyright="(c) Kwan Ting Lee, all rights reserved" -Credit="photos.alexleekt.com" -Contact="Kwan Ting Lee (Alex), photos@alexleekt.com" '-filename<CreateDate' -d "%Y%m%d_%H%M%S_%%c_alexleekt_5DM2.%%e" -r -ext CR2 .
@alexleekt
alexleekt / caddy-setup.sh
Last active June 4, 2024 19:29
caddyserver
# https://www.digitalocean.com/community/tutorials/how-to-host-a-website-with-caddy-on-ubuntu-16-04
curl -s https://getcaddy.com | bash -s personal dns,net,http.cors,http.filter,http.filemanager,http.forwardproxy,http.git,http.jwt,http.login,http.minify,http.nobots,http.upload
sudo mkdir /etc/caddy
sudo chown -R root:www-data /etc/caddy
sudo touch /etc/caddy/Caddyfile
sudo mkdir /etc/ssl/caddy
sudo chown -R www-data:root /etc/ssl/caddy
sudo chmod 0770 /etc/ssl/caddy
sudo mkdir /var/www
sudo chown www-data:www-data /var/www
@alexleekt
alexleekt / esxi-update.sh
Last active August 22, 2020 02:05
esxi update
# https://esxi-patches.v-front.de/ESXi-6.7.0.html
cd /tmp
esxcli network firewall ruleset set -e true -r httpClient
esxcli software profile update -p ESXi-6.7.0-20200804001-standard -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml
esxcli software vib install -v https://cdn.tinkertry.com/files/net-ixgbe_4.5.3-1OEM.600.0.0.2494585.vib --no-sig-check
tar -xzf NutClient-ESXi500-1.4.0.tar.gz
./upsmon-update.sh
esxcli network firewall ruleset set -e false -r httpClient
reboot
https://smile.amazon.com/gp/customer-reviews/R170GQNXYR3IUH/ref=cm_cr_dp_d_rvw_btm?ie=UTF8&ASIN=B01GJ826F8#wasThisHelpful
Based on all the helpful posts I've found here I created a quick set of commands that will install hass and configure the ZWave and ZHA settings on a clean installation of Raspbian Jessie.
# deploy HAss with all-in-one installer per: https://home-assistant.io/docs/installation/raspberry-pi-all-in-one/
curl -O https://raw.githubusercontent.com/home-assistant/fabric-home-assistant/master/hass_rpi_installer.sh && sudo chown pi:pi hass_rpi_installer.sh && bash hass_rpi_installer.sh
# that will run for an hour+
# add commands for the Linear HUSBZB-1
echo 'SUBSYSTEM=="tty", ATTRS{interface}=="HubZ Z-Wave Com Port", SYMLINK+="zwave"' | sudo tee --append /etc/udev/rules.d/99-usb-serial.rules
@alexleekt
alexleekt / bootlocal.sh
Created April 21, 2017 04:14
boot2docker autorun with NFS mount
#
# /var/lib/boot2docker/bootlocal.sh
#
# boot2docker will automatically run the script at this location.
#
mkdir -p /mnt/tank/media /mnt/tank/appconfig
/usr/local/etc/init.d/nfs-client start
mount nas.sagano.lan:/mnt/tank/media /mnt/tank/media
mount nas.sagano.lan:/mnt/tank/appconfig /mnt/tank/appconfig
@alexleekt
alexleekt / docker_cheatsheet.sh
Last active August 13, 2017 15:43
Docker cheatsheet
# Update all docker images
docker images | grep -v REPOSITORY | awk ‘{print $1}’ | xargs -L1 docker pull
# Get command of running containers
docker inspect -f "{{.Name}} {{.Config.Cmd}}" $(docker ps -a -q)
# Remove unused images
docker images -q | xargs docker rmi
# Remove stopped dockers
http://developer.yahoo.com/yql/console/?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22usdcad%3Dx%22)%0A%09%09&env=http%3A%2F%2Fdatatables.org%2Falltables.env
@alexleekt
alexleekt / android_helpers.sh
Created November 9, 2015 23:52
android aliases
alias adbss="adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > adbss_\$(date +'%y%m%d_%H%M%S').png"
alias wtf='adb logcat | grep E/AndroidRuntime'