This file contains 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
(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) { | |
// Calcuate signature for verification using request headers, data and token | |
var centralService = request.getHeader('X-Central-Service'); | |
var centralDeliveryId = request.getHeader('X-Central-Delivery-ID'); | |
var centralDeliveryTimestamp = request.getHeader('X-Central-Delivery-Timestamp'); | |
var token = "<webhook_token>"; // Webhook token | |
var body = request.body.dataString; | |
var message = body + centralService + centralDeliveryId + centralDeliveryTimestamp; | |
var calculatedSign = new Hashes.SHA256().b64_hmac(token, message); |
This file contains 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
/** | |
* jshashes - https://github.com/h2non/jshashes | |
* Released under the "New BSD" license | |
* | |
* Algorithms specification: | |
* | |
* MD5 - http://www.ietf.org/rfc/rfc1321.txt | |
* RIPEMD-160 - http://homes.esat.kuleuven.be/~bosselae/ripemd160.html | |
* SHA1 - http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf | |
* SHA256 - http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf |
This file contains 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
for daemon in com.mcafee.ssm.Eupdate \ | |
com.mcafee.virusscan.ssm.ScanFactory \ | |
com.mcafee.agent.cma \ | |
com.mcafee.virusscan.fmpd \ | |
com.mcafee.ssm.ScanManager \ | |
com.mcafee.console.3396 \ | |
com.mcafee.reporter \ | |
com.mcafee.menulet | |
do | |
launchctl remove $daemon |
This file contains 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/sh | |
for vmid in `vim-cmd vmsvc/getallvms | grep -v template | awk -F ' ' 'NR>1 {print $1}'` | |
do | |
if vim-cmd vmsvc/power.getstate $vmid | grep -q "Powered off" ; then | |
vmname=`vim-cmd vmsvc/get.summary $vmid | grep name | sed -e 's/.*\"\(.*\)\".*/\1/g'` | |
echo VM $vmname is powered off, powering on | |
vim-cmd vmsvc/power.on $vmid | |
fi | |
done |
This file contains 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 | |
echo Removing /tmp/cookbooks folder... | |
rm -r -f /tmp/cookbooks | |
echo Running berks vendor | |
bundle exec berks vendor /tmp/cookbooks | |
echo Creating tar archive | |
tar czvf /tmp/demeter-cookbook.tar.gz -C /tmp cookbooks |
This file contains 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
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 | |
\curl -sSL https://get.rvm.io | bash -s stable | |
source $HOME/.rvm/scripts/rvm | |
rvm install 2.0.0 | |
rvm use 2.0.0 | |
cat > Gemfile << EOF | |
source 'https://rubygems.org' | |
gem 'chef', "12.5.1" | |
EOF | |
gem install bundler |
This file contains 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
package com.noorul.learnscala | |
import org.eclipse.jgit.api._ | |
import scala.collection.JavaConverters._ | |
import java.io.File | |
import org.eclipse.jgit.storage.file.FileRepositoryBuilder | |
import org.eclipse.jgit.lib.{Repository,Ref} | |
object JGit { |
This file contains 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/sh | |
# WARNING: REQUIRES /bin/sh | |
# | |
# - must run on /bin/sh on solaris 9 | |
# - must run on /bin/sh on AIX 6.x | |
# - if you think you are a bash wizard, you probably do not understand | |
# this programming language. do not touch. | |
# - if you are under 40, get peer review from your elders. | |
# | |
# Author:: Tyler Cloke (tyler@opscode.com) |
This file contains 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
{ | |
"recipes": [ | |
{ | |
"name": "default.rb", | |
"path": "recipes\/default.rb", | |
"checksum": "cd9b688975824954297838f7d4214b7f", | |
"specificity": "default", | |
"url": "https:\/\/cu002.c.maa.collab.net:443\/bookshelf\/organization-00000000000000000000000000000000\/checksum-cd9b688975824954297838f7d4214b7f?AWSAccessKeyId=cfffb1e9c1cb87e1e86d293207840c888caa705b&Expires=1377489036&Signature=x83aJ%2B9nZn9%2B6e%2B5nkGkKzKzAqQ%3D" | |
} | |
], |
This file contains 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
| Failure: testGetCookbook(com.collabnet.devops.services.chef.ChefServiceTests) | |
| java.lang.NoSuchMethodError: com.google.gson.internal.ConstructorConstructor: method <init>()V not found | |
at org.jclouds.json.config.GsonModule.provideGson(GsonModule.java:127) | |
at com.google.inject.internal.ProviderMethod.get(ProviderMethod.java:104) | |
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40) | |
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46) | |
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031) | |
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) | |
at com.google.inject.Scopes$1$1.get(Scopes.java:65) | |
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40) |
NewerOlder