A Nagios check that connects to PuppetDB and determines the Puppet agent run health on a host.
- PuppetDB
- A puppetmaster configured to send reports to PuppetDB
| #!/usr/bin/env bash | |
| # starts (or restarts) a 1password cli session, sets 30 minute countdown variable | |
| # use: OP_CLOUD_ACCOUNT="[your-account-name]" source /path/to/op_session.sh command | |
| # e.g.: OP_CLOUD_ACCOUNT="familyname" source ~/op_session.sh get account | |
| check_session(){ | |
| # attempt sign in if session is not active |
| #!/usr/bin/env ruby | |
| # To make it work: | |
| # - change account details to yours ( obviously ;) ) | |
| # - install mechanize gem in version 1.0.0 ( gem install mechanize -v '1.0.0' ) | |
| # - look for !!HERE!! comments in code in case you'd like to change default behavior | |
| # - for best results run this script few times as hipchat / ruby openssl don't play together that well and | |
| # there might be an exception thrown from time to time. Script should retry then but hey.. Nobody is perfect. | |
| # .. and finally. Remember that other part should run this script as well to make history clean. |
| #chat-box.ubuntu.hidden-xs | |
| .closed | |
| .pull-right | |
| = link_to_function content_tag(:i, nil, class: 'glyphicon glyphicon-chevron-up').html_safe, 'chat.show()' | |
| .m-l-small | |
| = link_to_function 'Chat with us', 'chat.show()' | |
| .opened{style: 'display: none'} | |
| .header | |
| .pull-right | |
| = link_to_function content_tag(:i, nil, class: 'glyphicon glyphicon-plus-sign').html_safe, 'chat.maximize()', class: 'maximize', style: 'display: none' |
| <script language="JavaScript" type="text/javascript"> | |
| // Comcast Cable Communications, LLC Proprietary. Copyright 2012. | |
| // Intended use is to display browser notifications for critical and time sensitive alerts. | |
| var SYS_URL='/e8f6b078-0f35-11de-85c5-efc5ef23aa1f/aupm/notify.do'; | |
| // var image_url='http://servicealerts.comcast.net:8080/images/mt'; | |
| var image_url='http://xfinity.comcast.net/constantguard/BotAssistance/notice/images'; | |
| var headertext1='<strong>Comcast Courtesy Notice</strong>'; | |
| var textline1='You have reached 90% of your <b>monthly data usage allowance</b>.'; | |
| var textline2='Please sign in for more information and to remove this alert.'; | |
| var acknowledgebutton='<a href=\"#\" onClick="document.location.href=\''+SYS_URL+'?dispatch=redirect&redirectName=login¶mName=bmUid\'" title="Sign in to acknowledge" style="color: #FFFFFF;"><img alt="Sign in to acknowledge" src="'+image_url+'/mt_signin.png"/></a>'; |
| # Description: | |
| # Log all the things to ElasticSearch then lets you ask hubot what you missed | |
| # | |
| # Dependencies: | |
| # None | |
| # | |
| # Configuration: | |
| # ELASTICSEARCH_HOSTNAME - E.G. elasticsearch.example.com:9200, where to send the put requests | |
| # ELASTICSEARCH_USERNAME - OPTIONAL basic auth username | |
| # ELASTICSEARCH_PASSWORD - OPTIONAL basic auth password |
| #get root access | |
| $su - | |
| $ cd /tmp | |
| #Remove old Ruby | |
| $ yum remove ruby | |
| # Install dependencies | |
| $ yum groupinstall "Development Tools" | |
| $ yum install zlib zlib-devel |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| #!/bin/bash | |
| # CentOS rbenv system wide installation script | |
| # Forked from https://gist.github.com/1237417 | |
| # Installs rbenv system wide on CentOS 5/6, also allows single user installs. | |
| # Install pre-requirements | |
| yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel \ | |
| make bzip2 autoconf automake libtool bison iconv-devel git-core |
Copy, with line wrapping!
If you've been trying to copy/paste text from a multi-pane tmux session with the mouse, you've probably been pretty pissed at the blissful ignorance a terminal application has of the rodent in your hand.
The alternative, which is quote-unqoute native copy/pasting using copy-mode takes a bit to get used to. So this is one solution for copying and pasting lines from a session with correct line wrapping behaviour, albeit keyboard only.
Disclaimer
Since copy-mode has similar concepts of marks, regions, and temp buffers to Emacs .. you'll probably find it straight forward if you're familar with Emacsen. For people using vi-mode in tmux, the same still applies but obviously the default key bindings will differ alot from what I show below.