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
#include <stdio.h> | |
//Code for calculate parity from http://graphics.stanford.edu/~seander/bithacks.html#ParityNaive | |
unsigned int calculateParity(int data) { | |
unsigned int parity = 1; //Even parity to start | |
while (data) { | |
parity = !parity; | |
data = data & (data - 1); | |
} | |
return parity; |
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
- project: | |
name: cassandra | |
parameters: | |
- foo | |
jobs: | |
- "deployment-tests-{name}" | |
- job-template: | |
name: "deployment-tests-{name}" | |
description: "Tests the deployment of {name}" |
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
Wed Nov 2 20:36:18 UTC 2016 |
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
--- | |
apiVersion: v1 | |
kind: Secret | |
metadata: | |
name: password | |
namespace: my-cool-ns | |
data: | |
password: foobarbaz |
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
import jenkins.model.* | |
import hudson.model.* | |
import hudson.security.SecurityRealm | |
import org.jenkinsci.plugins.GithubSecurityRealm | |
import com.cloudbees.plugins.credentials.* | |
import com.cloudbees.plugins.credentials.common.* | |
import com.cloudbees.plugins.credentials.domains.* | |
import com.cloudbees.plugins.credentials.impl.* | |
import com.cloudbees.jenkins.plugins.sshcredentials.SSHUserPrivateKey | |
import com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey |
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
--- | |
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: alert-rules | |
data: | |
foo-file: | | |
foo: bar | |
whiz: bang | |
special.conf: | |
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
--- | |
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: test | |
spec: | |
replicas: 1 | |
template: | |
spec: | |
containers: |
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
- include_vars: "group_vars/secrets/secrets_{{ k8s_environment }}_{{ jenkins_type }}.yml" | |
- name: "Jenkins specs directory" | |
file: | |
dest: "./build/{{ k8s_environment }}/" | |
state: directory | |
- name: "Jenkins environment directory" | |
file: | |
dest: "./build/{{ k8s_environment }}/jenkins" | |
state: directory | |
- name: "Set path where specs go" |
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
stream | |
// The following stream alerts based on changes in cpu/usage | |
// Every minute the rate of change for the cpu/usage is calculated | |
// Alerts are sent out when that rate is unusually high | |
|from() | |
.measurement('cpu/usage') | |
.where(lambda: "type" == 'node' AND "nodename" =~/.*cassandra.*/) | |
.groupBy('nodename') | |
|derivative('value') | |
.unit(60s) |
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
def check_pods(get_pods_json): | |
problemPods = list() | |
for pod in get_pods_json['items']: | |
isBad = False | |
if pod['status']['phase'] != 'Running' and pod['status']['phase'] != 'Completed': | |
isBad = True | |
else: | |
for container_status in pod['status']['containerStatuses']: | |
if not container_status['ready']: | |
isBad = True |
OlderNewer