This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian | |
RUN apt-get update | |
RUN apt-get -y install ldap-utils | |
RUN echo -e "slapd slapd/internal/generated_adminpw password admin\nslapd slapd/password2 password admin\nslapd slapd/internal/adminpw password admin\nslapd slapd/password1 password admin\n" | debconf-set-selections | |
RUN apt-get -y install slapd | |
EXPOSE 389/tcp | |
RUN service slapd start | |
RUN echo olcSaslSecProps: noanonymous,minssf=0,passcred >> /etc/ldap/slapd.d/cn=config.ldif | |
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install tshark |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repeat | |
set chargeState to do shell script "pmset -g batt | awk '{printf \"%s %s\\n\", $4,$5;exit}'" | |
set percentLeft to do shell script "pmset -g batt | egrep -ow '([0-9]{1,3})[%]' | egrep -ow '[0-9]{1,3}'" | |
considering numeric strings | |
if chargeState contains "Battery Power" and percentLeft ≤ 40 then | |
if (percentLeft mod 5 = 0) then | |
try | |
--say "Battery Low" | |
do shell script "afplay /System/Library/Sounds/Blow.aiff" | |
--display notification "Time to plug me in 🔌" with title "Battery Charge Boundary" sound name "Blow" |