nmcli con up uuid <your-uuid-here>
To find out the UUID of the VPN connection, use:
nmcli -p con list
The command to disconnect from a VPN is:
nmcli con down uuid <your-uuid-here>
Assorted notes on my development experiences, and other useful workflow and environment tips, for Windows and Linux.
nmcli con up uuid <your-uuid-here>
nmcli -p con list
nmcli con down uuid <your-uuid-here>
sudo visudo
<user> ALL=NOPASSWD: <absolute_path_to_script_file>
| The inspiration for the Redcar editors name |
#!/bin/bash
source ~/.bashrc
/home/<USERNAME>/.rvm/gems/ruby-1.9.3-p125/bin/redcar
which redcar
chmod +x start_redcar.sh
./ start_redcar.sh
/home/<USERNAME>/.rvm/gems/ruby-1.9.3-p125/gems/redcar-icons-0.3/icons/redcar-icon-beta.png
gem install flickraw
gem install launchy
The code: #!/usr/bin/env ruby
require 'flickraw'
require 'launchy'
FlickRaw.api_key = 'YOUR_API_KEY_HERE'
FlickRaw.shared_secret = 'YOUR_SHARED_SECRET_HERE'
results = flickr.photos.search(:tags => ARGV[0])
rand = Random.new.rand(results.length)
info = flickr.photos.getInfo(:photo_id => results[rand].id)
url = FlickRaw.url_b(info)
Launchy.open(url)
ruby flickr_single_tag.rb surf
#{variable_to_display}
x=5
puts "The value of X is #{x}"
ruby string_interp.rb
#!/bin/bash
# Author: Andrew Martin
# Credit: http://ubuntuforums.org/showthread.php?t=1309247
echo "Enter the primary display from the following:" # prompt for the display
xrandr --prop | grep "[^dis]connected" | cut --delimiter=" " -f1 # query connected monitors
read choice # read the users's choice of monitor
xrandr --output $choice --primary # set the primary monitor
chmod +x monitor-switcher.sh
./monitor-switcher.sh