Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dlangille
dlangille / pushovernet.sh
Last active October 19, 2019 01:42
using pam_exec to send pushover.net notifications of all logins (ssh, scp)
Credit to @feldpos for providing the original version of this file, designed for inclusion into a .bashrc etc file
$ ls -l /etc/pam.d/pushovernet.sh
-rwxr-xr-x 1 root wheel 485 Mar 22 14:48 /etc/pam.d/pushovernet.sh
$ cat /etc/pam.d/pushovernet.sh
#!/bin/sh
(if [ "${PAM_SM_FUNC}" == "pam_sm_open_session" ]; then
P_KEY="YOUR USER KEY HERE"
P_TOKEN="YOUR APP TOKEN HERE"
P_MSG="${PAM_USER} logged in to $(hostname) from ${PAM_RHOST} via ${PAM_SERVICE}"
# Generate a file containing all URLs for Logic Pro X content
curl -s http://audiocontentdownload.apple.com/lp10_ms3_content_2016/logicpro1023.plist | \
grep -B 1 DownloadSize | grep "<string>" | sed -e "s:.*<string>::" -e "s:</string>.*::" | \
sed "s;^;http://audiocontentdownload.apple.com/lp10_ms3_content_2016/;" > logic-pro-x-download-urls-2016.txt
# After generating the output file logic-pro-x-download-urls-2016.txt, I recommend opening it with Firefox
# and using DownloadThemAll to download all the URLs.
# When the downloads are complete, you may automatically install packages as follows
sudo -v
@igrr
igrr / esp8266_pubsubclient.ino
Created January 6, 2015 23:44
PubSubClient sample for ESP8266 Arduino
#include <PubSubClient.h>
#include <ESP8266WiFi.h>
const char* ssid = ".................";
const char* password = "................";
char* topic = "esp8266_arduino_out";
char* server = "iot.eclipse.org";