Skip to content

Instantly share code, notes, and snippets.

View zhanghan177's full-sized avatar
:shipit:
Nobody gonna use this feature. I bet.

Han Zhang zhanghan177

:shipit:
Nobody gonna use this feature. I bet.
View GitHub Profile
@zhanghan177
zhanghan177 / bash_strict_mode.md
Created October 28, 2021 18:43 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation

set -e, -u, -x, -o pipefail

The set lines

  • These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing.
  • With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.
  • set -euxo pipefail is short for:
set -e
set -u

Using an older platform tools didn't work for me. I had to extract the system image and flash one item at a time.

This is for Nexus 5x but should work for all Google provided system images downloaded at https://developers.google.com/android/images where this error occurs.

> unzip [downloaded zip file]
> cd [new directory]
> unzip image-[device specific].zip
  inflating: android-info.txt        
<!DOCTYPE html>
<head>
<title>{{ title }}</title>
</head>
<body>
<h1>PLANT HELPLINE</h1>
<h2>The date and time on the server is: {{ time }}</h2>
<h2> {{ text }} </h2>
<a href="/auto/water/ON"><button>Turn ON Auto Watering</button></a>
# External module imp
import RPi.GPIO as GPIO
import datetime
import time
init = False
GPIO.setmode(GPIO.BOARD) # Broadcom pin-numbering scheme
def get_last_watered():
import water
if __name__ == "__main__":
water.auto_water()

Keybase proof

I hereby claim:

  • I am zhanghan177 on github.
  • I am zhanghan177 (https://keybase.io/zhanghan177) on keybase.
  • I have a public key whose fingerprint is 922E 5BB5 EE4A 1E45 14CA FF20 E198 C0A3 3BE4 7D7B

To claim this, I am signing this object: