Skip to content

Instantly share code, notes, and snippets.


John Szaszvari JSzaszvari

  • All over the World
View GitHub Profile
View RDM-Nginx
server {
listen 443 ssl;
ssl_certificate /path/to/ssl/fullchain.pem;
ssl_certificate_key /path/to/ssl/privkey.pem;
ssl_protocols TLSv1.3 TLSv1.2 TLSv1.1;
ssl_ciphers AES256+EECDH:AES256+EDH:!aNULL;
JSzaszvari / 0_reuse_code.js
Created Jun 17, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# Script adds the VPN item to the menu bar and enables the 'show time
# connected' & 'show status while connecting' options. Last tested on 10.11
currentUser=$(python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");')
currentUserHomeDirectory=$(dscl . -read "/users/$currentUser" NFSHomeDirectory | cut -d " " -f 2)
vpnMenuItemExists=$(defaults read "$currentUserHomeDirectory/Library/Preferences/" menuExtras | grep -o VPN)
if [ "$vpnMenuItemExists" ]; then
printf "VPN menu item is already on the status bar!"