Skip to content

Instantly share code, notes, and snippets.

View JSzaszvari's full-sized avatar

John Szaszvari JSzaszvari

  • All over the World
View GitHub Profile
#!/bin/bash
# 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/com.apple.systemuiserver" menuExtras | grep -o VPN)
if [ "$vpnMenuItemExists" ]; then
printf "VPN menu item is already on the status bar!"
@JSzaszvari
JSzaszvari / 0_reuse_code.js
Created June 17, 2017 01:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
server {
server_name my.website.com;
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;