Skip to content

Instantly share code, notes, and snippets.

@jc1518
jc1518 / check_confluence_jmx.js
Last active Dec 6, 2018
Nodejs JMX query sample
View check_confluence_jmx.js
/**
* Check confluence jmx status
*/
'use strict';
const exec = require('child_process').exec;
module.exports = function (robot) {
@jc1518
jc1518 / splunk_query.js
Last active Dec 6, 2018
Nodejs splunk query sample
View splunk_query.js
'use strict';
var splunkjs = require('splunk-sdk');
module.exports = function (robot) {
var service = new splunkjs.Service({
username: process.env.SPLUNK_USERNAME,
password: process.env.SPLUNK_PASSWORD,
scheme:"https",
@jc1518
jc1518 / data_classification_workflow
Created Dec 6, 2018
Comala Workflow for Confluence Page Data Classification
View data_classification_workflow
{workflow:name=Data Classification Workflow}
{description}
Description here
{description}
{state:Public|colour=Green}
{state}
{state:Internal|colour=Blue}
{state}
{state:Protected|colour=Orange}
{state}
@jc1518
jc1518 / confluence_key_query.js
Created Dec 13, 2018
Check if the Confluence key has been used.
View confluence_key_query.js
<form class="aui">
<script>
AJS.toInit(function() {
AJS.$("#check-key").click(function() {
var validate = /^[0-9a-zA-Z]+$/;
var spacekey = AJS.$("#space-key").val();
if (spacekey.match(validate)) {
AJS.$.ajax({
url: "/rest/api/space/" + spacekey,
type: "GET",
@jc1518
jc1518 / nginx.conf
Created Jan 23, 2019
Nginx config example of reverse proxy for LDAP and HTTP
View nginx.conf
# http://nginx.org/en/docs/
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/log/nginx/nginx.pid;
events {
worker_connections 1024;
}
View check_undo_tablespace.sql
SELECT SUM(a.bytes) as UNDO_SIZE
FROM v$datafile a,
v$tablespace b,
dba_tablespaces c
WHERE c.contents = 'UNDO'
AND c.status = 'ONLINE'
AND b.name = c.tablespace_name
AND a.ts# = b.ts#;
@jc1518
jc1518 / confluence_cql_sample.js
Created Jul 8, 2019
Find all Confluence spaces (including archived ones) that are in Cloud category
View confluence_cql_sample.js
/**
* Confluence CQL sample
* Find all spaces (including archived ones) that are in Cloud category
*/
const request = require('request')
const options = {
headers: { "Content-Type": "application/json" },
auth: {
View jira_sprintquery_sample.js
/*
* Jira sprint query sample
* Find out current sprint and next sprint
*/
'use strict'
const Promise = require('promise')
const request = require('request')
const lodash = require('lodash')
@jc1518
jc1518 / S3AccessForSSM
Created Sep 11, 2019
S3 Access Policy for SSM
View S3AccessForSSM
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": [
"arn:aws:s3:::aws-ssm-<region>/*",
"arn:aws:s3:::aws-windows-downloads-<region>/*",
"arn:aws:s3:::amazon-ssm-<region>/*",
@jc1518
jc1518 / ECR_image_scanning_sample.sh
Created Oct 29, 2019
Use Image Scanning for AWS ECR
View ECR_image_scanning_sample.sh
#!/bin/bash
# Define your ECR
MY_ECR='<account>.dkr.ecr.<region>.amazonaws.com'
# Sample for scanning atlassian/jira-software:8.3
aws ecr get-login --no-include-email | bash -
aws ecr create-repository --repository-name jira --image-tag-mutability IMMUTABLE --image-scanning-configuration scanOnPush=true
docker pull atlassian/jira-software:8.3
docker tag atlassian/jira-software:8.3 ${MY_ECR}/jira:8.3