Skip to content

Instantly share code, notes, and snippets.

Martin Cleaver mrjcleaver

Block or report user

Report or block mrjcleaver

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View zapier_code_use_basic_authentication_with_fetch.js
var username = '';
var password = '';
var encoded_credentials = new Buffer(username + ':' + password).toString('base64');
fetch('https://example.com', { method: 'POST', headers: {'Authorization': 'Basic ' + encoded_credentials} })
.then(function(res) {
return res.json();
})
.then(function(body) {
View CreateConfluencePage.groovy
package examples.docs
import com.atlassian.applinks.api.ApplicationLink
import com.atlassian.applinks.api.ApplicationLinkService
import com.atlassian.applinks.api.application.confluence.ConfluenceApplicationType
import com.atlassian.jira.issue.Issue
import com.atlassian.sal.api.component.ComponentLocator
import com.atlassian.sal.api.net.Request
import com.atlassian.sal.api.net.Response
import com.atlassian.sal.api.net.ResponseException
View BellBox.postInstall
Move-LibraryDirectory "My Pictures" "Z:\Pictures"
Move-LibraryDirectory "My Video" "Z:\Videos"
Move-LibraryDirectory "My Music" "Z:\Music"
Move-LibraryDirectory "Downloads" "Z:\Downloads"
#Move-LibraryDirectory "Personal" "Z:\Documents"
Move-LibraryDirectory "Desktop" "Z:\Desktop"
View BellBox.boxstarter
# Usage: see http://www.hurryupandwait.io/blog/setup-a-new-machine-with-just-a-url-and-chocolatey-package
# Get RAW URL from this GIST
# START http://boxstarter.org/package/nr/url?<RAW URL from GIST>
#######################
# Windows Configuration
Update-ExecutionPolicy Unrestricted
Disable-InternetExplorerESC
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowFileExtensions
View gist:5c76aa160dedc555739f
599$ knife data bag list
lumberjack
600$ knife data bag show lumberjack
secrets
601$ knife data bag show lumberjack/secrets
certificate
id
key
View gist:5fd014c083bcffbf2ce1
On my knife workstation:
mkdir -p data_bags/lumberjack
cd data_bags/lumberjack
wget https://raw.githubusercontent.com/rackspace-cookbooks/elkstack/master/test/integration/default/data_bags/lumberjack/secrets.json
wget https://raw.githubusercontent.com/rackspace-cookbooks/elkstack/master/test/integration/default/encrypted_data_bag_secret -O encrypted_data_bag_secret
knife data bag create lumberjack
knife data bag --secret-file=encrypted_data_bag_secret from file lumberjack secrets.json data_bags/lumberjack
View gist:05eb5869de63719c5846
[2015-01-20T01:27:14+04:00] WARN: Previous service[elasticsearch]: /var/chef/cache/cookbooks/elasticsearch/recipes/default.rb:72:in `from_file'
[2015-01-20T01:27:14+04:00] WARN: Current service[elasticsearch]: /var/chef/cache/cookbooks/elkstack/recipes/elasticsearch.rb:30:in `from_file'
[2015-01-20T01:27:15+04:00] WARN: Could not find encrypted data bag item lumberjack/secrets
================================================================================
Recipe Compile Error in /var/chef/cache/cookbooks/bp_elkstack/recipes/default.rb
================================================================================
NoMethodError
-------------
View gist:6dd464d3efa733701d57
Simple install based on
625 20150119-13:32:09 git clone https://github.com/rackspace-cookbooks/elkstack.git elkstack
626 20150119-13:32:24 cd elkstack/
630 20150119-13:34:45 knife cookbook upload elkstack --include-dependencies
638 20150119-13:36:36 emacs Berksfile # add a dependency on curl
639 20150119-13:36:58 berks install
641 20150119-13:38:18 berks upload --ssl-verify=false
# https://github.com/berkshelf/berkshelf/issues/1132
650 20150119-13:51:20 cd /Volumes/Storage/martincleaver/.berkshelf/cookbooks/percona-multi-0.1.0/attributes/
View gist:2b99d5a50783fea21ec7
This file has been truncated, but you can view the full file.
0 info it worked if it ends with ok
1 verbose cli [ 'node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli 'karma-phantomjs-launcher',
1 verbose cli 'karma-jasmine',
1 verbose cli 'grunt-karma',
1 verbose cli '--save-dev' ]
2 info using npm@1.4.3
View gist:4734775
2013-01-31 21:07:07,947 ERROR [TP-Processor12] [atlassian.confluence.servlet.ConfluenceServletDispatcher] sendError Could not execute action
-- url: /homepage.action | userName: anonymous
org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is net.sf.hibernate.exception.GenericJDBCException: Cannot open connection
at org.springframework.orm.hibernate.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:473)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:374)
at com.atlassian.xwork.interceptors.TransactionalInvocation.getNewTransaction(TransactionalInvocation.java:141)
at com.atlassian.xwork.interceptors.TransactionalInvocation.invokeInTransaction(TransactionalInvocation.java:40)
at com.atlassian.xwork.interceptors.XWorkTransactionInterceptor.intercept(XWorkTransactionInterceptor.java:56)
at com.opensymphony.xwork.DefaultAc
You can’t perform that action at this time.