Skip to content

Instantly share code, notes, and snippets.

View prishs's full-sized avatar
🇮🇳

Pritam prishs

🇮🇳
View GitHub Profile
@prishs
prishs / Ldap Passback Dockerfile
Last active July 19, 2023 07:21
ldap-passback-docker
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
@prishs
prishs / BatteryStatusNotification.scpt
Last active July 12, 2023 11:58 — forked from brandon1024/BatteryStatusNotification.scpt
Battery Percentage Boundary Notification Background Script for macOS
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"