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
knife ssh "role:varnish_webs" AND chef_environment:datasift_production" "/etc/init.d/varnish restart" && knife search node "role:varnish_webs AND chef_environment:datasift_production" -i | tr "\\n " " " | xargs cssh -a 'varnishtop' |
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 | |
for i in `ls -l /var/www/html/rra/ | grep !!!RRDNAME!!! | awk '{print $9}'` | |
do | |
rrdtool tune /var/www/html/rra/$i -a traffic_out=4000000000 && rrdtool tune /var/www/html/rra/$i -a traffic_in=4000000000 | |
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
["powersupply","powersupplywarn","tempwarn","tempfail","fanwarn","fanfail","voltwarn","voltfail","redundegrad","redunlost","memprefail","memfail","hardwarelogwarn","hardwarelogfull","processorwarn","processorfail","watchdogasr","batterywarn","batteryfail","systempowerwarn","systempowerfail","systempeakpower","removableflashmediapresent","removableflashmediaremoved","removableflashmediafail","storagesyswarn","storagesysfail","storagectrlwarn","storagectrlfail","pdiskwarn","pdiskfail","vdiskwarn","vdiskfail","enclosurewarn","enclosurefail","storagectrlbatterywarn","storagectrlbatteryfail"].each do |alert_name| | |
execute "Set up alert for #{alert_name}" do | |
command "/opt/dell/srvadmin/bin/omconfig system alertaction event=#{alert_name} alert=true broadcast=true execappath=\"php /opt/dell/omsa_alerting.php #{alert_name}\"" | |
action :run | |
end | |
end |
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
PKCS8EncodedKeySpec spec = new PKCS8EncodedKeySpec(Base64.decode(this.PrivateKey.getBytes(),0)); | |
KeyFactory kf = KeyFactory.getInstance("RSA"); | |
PrivateKey pk = kf.generatePrivate(spec); | |
Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1PADDING"); | |
cipher.init(Cipher.ENCRYPT_MODE, pk); | |
byte[] EncryptedStream = new byte[cipher.getOutputSize(dataToSign.length())]; | |
try | |
{ | |
cipher.doFinal(dataToSign.getBytes(),0,dataToSign.length(), EncryptedStream,0); |
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
Headers.add(new BasicNameValuePair("Accept","application/json")); | |
Headers.add(new BasicNameValuePair("Content-Type","application/json")); | |
Headers.add(new BasicNameValuePair("X-Ops-Sign","version=1.0")); | |
Headers.add(new BasicNameValuePair("X-Ops-Userid",this.ClientName)); | |
Headers.add(new BasicNameValuePair("X-Ops-Timestamp",TimeStamp)); | |
Headers.add(new BasicNameValuePair("X-Ops-Content-Hash",Disgesteriser.hash_string(Body))); | |
signed_canonicalize_request = SignHeaders("Method:GET"+ | |
"\nHashed Path:" + Disgesteriser.hash_string(Path) + |
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
while(rubyLength < 61 && charLocation < signed_canonicalize_request.length()) | |
{ | |
if(signed_canonicalize_request.charAt(charLocation) != '\n' && signed_canonicalize_request.charAt(charLocation) != '\r') | |
{ | |
AuthString += signed_canonicalize_request.charAt(charLocation); | |
rubyLength++; | |
} | |
charLocation++; | |
} | |
Headers.add(new BasicNameValuePair("X-Ops-Authorization-"+Integer.toString(AuthorizationIteration),AuthString)); |
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
String Path = "/cookbooks"; | |
this.httpget = new HttpGet(this.ChefURL + Path); | |
List <NameValuePair> Headers = ChefAuth.GetHeaders(Path, ""); | |
for(int i = 0; i < Headers.size(); i++) | |
{ | |
this.httpget.setHeader(Headers.get(i).getName(),Headers.get(i).getValue()); | |
} | |
String jsonTempString = httpClient.execute(this.httpget, responseHandler); |
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
httppost = new HttpPost("https://portal.pulsant.com/json/getViewData.php?panel=" + Panel + "&page=" + Page + "&extra=" + Key + Payload); | |
httppost.setHeader("Cookie","PHPSESSID=" + this.SessionID); | |
response = httpclient.execute(httppost); |
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
http = Net::HTTP.new("#{pagerduty_subdomain}.pagerduty.com", 443) | |
http.use_ssl = true | |
path = "/api/v1/schedules/#{pagerduty_schedule}/entries?since=#{Year}-#{Month}-#{Day}&until=#{Year}-#{Month}-#{Day}" | |
req = Net::HTTP::Get.new(path) | |
req.basic_auth pagerduty_username, pagerduty_password | |
resp, data = http.request(req) | |
#Check if the response code was a good 200 | |
if resp.code.to_i == 200 | |
puts "Received a 200 response" |
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
HttpPost httpost = new HttpPost(URL + "/zport/acl_users/cookieAuthHelper/login"); | |
List <NameValuePair> nvps = new ArrayList <NameValuePair>(); | |
nvps.add(new BasicNameValuePair("__ac_name", UserName)); | |
nvps.add(new BasicNameValuePair("__ac_password", Password)); | |
nvps.add(new BasicNameValuePair("submitted", "true")); | |
nvps.add(new BasicNameValuePair("came_from", URL + "/zport/dmd")); | |
httpost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8)); |
OlderNewer