This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| user=> (def c [{:next-hop "192.168.1.1", :prefix "172.16.1.1/32", :route-status "*|e"} | |
| #_=> {:next-hop "192.168.255.255", :prefix nil, :route-status "*>e"}]) | |
| #'user/c | |
| user=> | |
| user=> (let [prev (atom nil)] | |
| #_=> (map (fn [r] | |
| #_=> (if (and @prev (not (:prefix r))) | |
| #_=> (assoc r :prefix @prev) | |
| #_=> (do (reset! prev (:prefix r)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'eventmachine' | |
| require 'em-http-request' | |
| require 'logger' | |
| require 'pry' | |
| ## | |
| # concurrent requests with EM::Iterator concurrency limit of 2 | |
| FIVE = 'http://ipv4.download.thinkbroadband.com/5MB.zip' | |
| TEN = 'http://ipv4.download.thinkbroadband.com/10MB.zip' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'eventmachine' | |
| require 'em-http-request' | |
| require 'logger' | |
| require 'pry' | |
| ## | |
| # concurrent requests without concurrency limits | |
| FIVE = 'http://ipv4.download.thinkbroadband.com/5MB.zip' | |
| TEN = 'http://ipv4.download.thinkbroadband.com/10MB.zip' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'eventmachine' | |
| require 'em-http-request' | |
| require 'logger' | |
| require 'pry' | |
| ## | |
| # Single request | |
| @start_time = Time.now | |
| @logger = Logger.new($stdout) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'eventmachine' | |
| require 'em-http' | |
| require 'logger' | |
| class HTTPAsyncMulti | |
| @@multi = [] | |
| @@multi_done = [] | |
| @@concurrency = 2 | |
| @@logger = Logger.new($stdout) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ gem build expect-behaviors.gemspec | |
| WARNING: open-ended dependency on net-ssh (>= 0) is not recommended | |
| if net-ssh is semantically versioned, use: | |
| add_runtime_dependency 'net-ssh', '~> 0' | |
| WARNING: open-ended dependency on codeclimate-test-reporter (>= 0, development) is not recommended | |
| if codeclimate-test-reporter is semantically versioned, use: | |
| add_development_dependency 'codeclimate-test-reporter', '~> 0' | |
| WARNING: pessimistic dependency on mocha (~> 1.1.0, development) may be overly strict | |
| if mocha is semantically versioned, use: | |
| add_development_dependency 'mocha', '~> 1.1', '>= 1.1.0' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| // via http://apple.stackexchange.com/questions/16135/remap-home-and-end-to-beginning-and-end-of-line | |
| "\UF729" = moveToBeginningOfParagraph:; // home | |
| "\UF72B" = moveToEndOfParagraph:; // end | |
| "$\UF729" = moveToBeginningOfParagraphAndModifySelection:; // shift-home | |
| "$\UF72B" = moveToEndOfParagraphAndModifySelection:; // shift-end | |
| // Add to ~/Library/KeyBindings/DefaultKeyBinding.dict and restart your program. | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Nexus vlan assigned but not created | |
| asw1-p05-0-lab# sh int eth1/17 sw | |
| Name: Ethernet1/17 | |
| Switchport: Enabled | |
| Switchport Monitor: Not enabled | |
| Operational Mode: access | |
| Access Mode VLAN: 200 (Vlan not created) | |
| Trunking Native Mode VLAN: 1 (default) | |
| Trunking VLANs Allowed: 1-4094 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Create OSX Yosemite Installer for VirtualBox using iesd gem | |
| gem install iesd | |
| iesd -i /Applications/Install\ OS\ X\ Yosemite.app/ -o yosemite.dmg -t BaseSystem | |
| hdiutil convert yosemite.dmg -format UDSP -o yosemite.sparseimage | |
| ls -lh yo* | |
| hdiutil mount /Applications/Install\ OS\ X\ Yosemite.app/Contents/SharedSupport/InstallESD.dmg | |
| hdiutil mount yosemite.sparseimage | |
| cp /Volumes/OS\ X\ Install\ ESD/BaseSystem.* /Volumes/OS\ X\ Base\ System/ | |
| hdiutil detach /Volumes/OS\ X\ Install\ ESD/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Service receives *no input* in *any application* | |
| # bind to ctrl-alt-l in keyboard shortcuts | |
| on run {input, parameters} | |
| tell application "System Events" to start current screen saver | |
| return input | |
| end run |
NewerOlder