Skip to content

Instantly share code, notes, and snippets.

View jc1518's full-sized avatar
🐶

Jackie Chen jc1518

🐶
View GitHub Profile
@jc1518
jc1518 / data_classification_workflow
Created December 6, 2018 05:49
Comala Workflow for Confluence Page Data Classification
{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 / splunk_query.js
Last active December 6, 2018 05:50
Nodejs splunk query sample
'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 / check_confluence_jmx.js
Last active December 6, 2018 05:51
Nodejs JMX query sample
/**
* Check confluence jmx status
*/
'use strict';
const exec = require('child_process').exec;
module.exports = function (robot) {
@jc1518
jc1518 / confluence_key_query.js
Created December 13, 2018 05:09
Check if the Confluence key has been used.
<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 January 23, 2019 23:25
Nginx config example of reverse proxy for LDAP and HTTP
# 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;
}
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 July 8, 2019 12:19
Find all Confluence spaces (including archived ones) that are in Cloud category
/**
* 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: {
@jc1518
jc1518 / jira_sprintquery_sample.js
Created July 8, 2019 12:53
Jira sprint query sample
/*
* 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 September 11, 2019 23:56
S3 Access Policy for SSM
{
"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 October 29, 2019 10:00
Use Image Scanning for AWS ECR
#!/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