Skip to content

Instantly share code, notes, and snippets.

View shubhamgupta0122's full-sized avatar
🔧
Tinkering with things

Shubham Gupta shubhamgupta0122

🔧
Tinkering with things
View GitHub Profile
#!/usr/bin/env ruby
require 'yaml'
require 'rotp'
status_only = (ARGV[0].to_s == '--status-only')
conf = YAML.load(File.read('./conf.yml'))
totp = ROTP::TOTP.new(conf['totp'], interval: 60).now
@shubhamgupta0122
shubhamgupta0122 / tunnelblick_toggle.applescript
Last active May 14, 2021 16:53
applescript to toggle vpn via tunnelblick
set toggle to %TOGGLE%
set conf_name to "%NAME%"
set conf_user to "%USER%"
set conf_pass to "%PASS%"
set conf_index to -1
if application "Tunnelblick" is running then
else
tell application "Tunnelblick" to activate
end if