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 / _debian.md
Last active December 16, 2015 09:09
Debian: Setup.md

Keybase proof

I hereby claim:

  • I am alexleekt on github.
  • I am alexleekt (https://keybase.io/alexleekt) on keybase.
  • I have a public key whose fingerprint is 1F70 C98B D758 2675 A767 7FE9 413C A953 0903 9097

To claim this, I am signing this object:

@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=
@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;
### 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 / 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'
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 / 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
@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
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