Skip to content

Instantly share code, notes, and snippets.

View alexleekt's full-sized avatar
🎯
Focusing

(Alex) Kwan Ting Lee alexleekt

🎯
Focusing
  • United States
View GitHub Profile
@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'
### unlock
# fastboot flashing unlock
### flash-base.sh
fastboot flash bootloader bootloader-angler-angler-03.68.img
fastboot reboot-bootloader
sleep 5
fastboot flash radio radio-angler-angler-03.81.img
fastboot reboot-bootloader
sleep 5
@alexleekt
alexleekt / breathing_night_light.ino
Last active August 29, 2015 14:17
Arduino breathing light - with variable brightness and breathing rate.
/*
Arduino breathing light - with variable brightness and breathing rate.
*/
#include <math.h>
const int PIN_POT = 0;
const int PIN_LED = 13;
const int BRIGHTNESS_MIN = 0;
@alexleekt
alexleekt / panda.html
Created September 12, 2014 22:19
iPanda stream.
<!--
height="720"
-->
<head>
<script src="http://api.html5media.info/1.1.6/html5media.min.js"></script>
</head>
<body style="margin:0;">
<embed type="application/x-shockwave-flash" src="http://player.cntv.cn/standard/AkamaiLive20140127.swf?v=110.171.5.8.9.6.3.9" width="100%" height="100%" id="hds_flash_player" name="hds_flash_player" bgcolor="#000000" quality="high" wmode="window" menu="false" allowfullscreen="true" allowscriptaccess="always" flashvars="vodURL=http://ak.live.cntv.cn/z/ipanda_1@137740/manifest.f4m&amp;videoURL=http://ak.live.cntv.cn/z/ipanda_1@137740/manifest.f4m&amp;tai=ipanda&amp;videoID=ipanda&amp;videoName=ipanda&amp;cdnCode=LIVE-HDS-CDN-AK&amp;addrs=http://ak.live.cntv.cn/z/ipanda_1@137740/manifest.f4m&amp;backUrl=http://ak.live.cntv.cn/z/ipandadvr_1@167353/manifest.f4m&amp;preView=http://vpic.cntv.chinacache.net:8000/live/pic/channel54&amp;cdn=LIVE-HDS-CDN-AK&amp;Url=http://ak.live.cntv.cn/z/ipanda_1@137740/manifest.f4m&amp;ChannelID=ipanda&amp;videoTVChannel=ipanda&amp;P2PChannelID=