Skip to content

Instantly share code, notes, and snippets.

@yrammos
yrammos / gist:abe5cca8c4a744a380cd7e553e7da8b8
Last active April 8, 2022 14:55
Automatic login to Cisco AnyConnect VPN using password from the macOS Keychain.
set vpn to do shell script "/opt/cisco/anyconnect/bin/vpn status | grep 'Connected' && echo 'connected' || echo 'disconnected'"
if (vpn is not "disconnected") then
do shell script "/opt/cisco/anyconnect/bin/vpn disconnect"
display dialog "VPN disconnected!" with icon caution buttons {"OK"} default button "OK"
tell application "Cisco AnyConnect Secure Mobility Client" to quit
else if (vpn is "disconnected") then
set pwd to do shell script "/usr/bin/security find-internet-password -wl your.keychain.item.name"
set output to do shell script "echo '
" & pwd & "'| /opt/cisco/anyconnect/bin/vpn -s connect your.vpn.server"
-- Do not indent the line above!
@yrammos
yrammos / ermd.js
Last active April 18, 2020 09:23
Userscript for Sergey Lebedev's "English-Russian Music Dictionary" (http://eremus.celum.xyz/)
// ==UserScript==
// @name Англо-русский словарь музыкальных терминов (celum.xyz)
// @namespace http://tampermonkey.net/
// @match http://eremus.celum.xyz/*
// @grant GM_addStyle
// @version 1.0
// @author Yannis Rammos, Ph.D. (y@rammos.co)
// @description 1/26/2020, 11:55:13 AM
// ==/UserScript==

Keybase proof

I hereby claim:

  • I am yrammos on github.
  • I am yrammos (https://keybase.io/yrammos) on keybase.
  • I have a public key ASDObT8BSDw6NiNrrQbfCny7dv0BHgu8pwzVYSLtmOPhlQo

To claim this, I am signing this object: