Skip to content

Instantly share code, notes, and snippets.

Avatar

Asa Baylus asabaylus

View GitHub Profile
View gitcheats.txt
# From the last release to the HEAD of master
# find all commits with a Jira key
$ git log <branch_A>..<branch_B> 2> /dev/null | grep -Eo "[A-Za-z]+-[0-9]+" | sort | uniq
# checkout the same branch across multiple repos
$ ls | xargs -P10 -I{} git -C {} checkout <branch_name>
# make an alias to run a git command across multiple repo, add to ~/.bashrc or ~/.zshrc
alias agit="ls | xargs -P10 -I{} git -C {}"
@asabaylus
asabaylus / get-keys
Last active May 18, 2017
Jira Keys from Git Branches
View get-keys
# From the last release to the HEAD of master
# find all commits with a Jira key
$ git log origin/6.6..master | grep -Eo [A-Za-z]+-[0-9]+ | sort | uniq
View foo.html
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.4.js" type="text/javascript"></script>
<script src="https://sde.birst.com/js/birst_embed.js" type="text/javascript"></script>
<script type="text/javascript">
var ssoUrl = 'https://sde.birst.com/TokenGenerator.aspx?birst.username=birstforward2016@birst.com&birst.ssopassword=wVn4lZIoEx81nj7BsdC1OJ3TsGdkJF2N&birst.spaceId=6760e6ce-413c-4f41-9b90-6d9906158299';
var params = '&birst.module=newDashboards&birst.embedded=true&birst.dashboard=Sales%20Analysis&birst.page=Summary';
function ssoPost( params ) {
$.post( ssoUrl, {}, function( data ) {
var opts = { width: '100%', height: '800', iframeSrc: 'https://sde.birst.com/SSO.aspx?birst.SSOToken=' + data + params };
View vsync-monitor.sh
#!/bin/bash
# print last timestampe from last two log files
# "2016-10-28T14:21:28.022-04:00"
# compare the date to now and return if > 5 min
# convert date to unix epoch
if [ $# = 1 ]; then
now=$(date +"%F %T");
if [[ $(date -d `cat $(ls -1tr /syslog/vsynch/app*.log*) | grep "pushing changes" | cut -c1-19 | tail -1` +%s ) > `date -d "$1 secs ago" +%s` ]];
then echo "$now: VSYNC UP" >> /syslog/vsynch/vsync-monitor.log;
else mail -s "vsync down!" asa@baylus.com,cprocunier@gmail.com,parmstrong@ifthen.com < /dev/null;
View gist:53378907a336cbbbce8b
'use strict';
var tagBody = '(?:[^"\'>]|"[^"]*"|\'[^\']*\')*',
tagOrComment = new RegExp(
'<(?:' +
// Comment body.
'!--(?:(?:-*[^->])*--+|-?)' +
// Special "raw text" elements whose content should be elided.
'|script\\b' + tagBody + '>[\\s\\S]*?</script\\s*' +
View gist:8daeceed6e4d8302b9fe
~/Dropbox (National Geographic)/Projects/cq-reference/platform feature/AEM-2478* 13s
(vagrant)❯ fab deploy
1.7.0
bpdtool.tasks.aem.deploy WARNING No username argument received, using default: admin
bpdtool.tasks.aem.deploy WARNING No password argument received, using default: admin
[aem.localhost.nationalgeographic.com] Executing task 'check_webapp_access_over_ssh'
[aem.localhost.nationalgeographic.com] run: sudo puppet --version
[aem.localhost.nationalgeographic.com] out: 3.7.3 (Puppet Enterprise 3.7.1)
[aem.localhost.nationalgeographic.com] out:
View gist:018ebe9870ec2c600f50
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.foo.www</groupId>
<artifactId>fe-package</artifactId>
<version>0.1.0</version>
@asabaylus
asabaylus / aem_deploy.sh
Last active Sep 1, 2020
AEM Deploy Script
View aem_deploy.sh
#!/bin/bash
#GLOBAL
HTTPRESPONSE="json"
SUCCESS="success"
#TEST
#UIARTFCT="target/package.zip"
#UILOC="./target/"
#AUTHORHOST="localhost"
View gist:6e22452b2efa02fcf197
_isUrl = function (str) {
// pass --> http://google.com
// pass --> ftp://google.com
// pass --> google.com
// pass --> localhost
// pass --> 127.0.0.1
// pass --> 1.1.1.1
// pass --> http://127.0.0.1
// pass --> http://localhost