Skip to content

Instantly share code, notes, and snippets.

View Aricg's full-sized avatar

Aric Gardner Aricg

View GitHub Profile
@Aricg
Aricg / ref-update
Created October 11, 2016 22:23
goes in the hooks dir, requires the hooks plugin on newer versions of gerrit
#!/bin/bash
ref="$(awk -F'newrev' '{print $2}' <<< "$@" | xargs)"
log="$(git log --format=%s%b -n 1 "$ref")"
if grep -iq "JIRA:*[0-9]*" <<< "$log"
then
:
else
echo "Commit rejected, please provide a jira issue in the format JIRA: ISSUE_NUMBER in the commit message"
exit 1
INFO: Project [bifrost-upstream-verify-ubuntu] triggered by Gerrit: [[ManualPatchsetCreated Change: Change-Id for #367608: I37fe286c76cab6c0b34ff496e7188bff09222f5c PatchSet: PatchSet: 3]]
Sep 08, 2016 9:53:55 PM com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.EventListener schedule
INFO: Project bifrost-upstream-verify-ubuntu Build Scheduled: true By event: 367608/3
Sep 08, 2016 9:53:55 PM com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ToGerritRunListener onStarted
INFO: Gerrit build [bifrost-upstream-verify-ubuntu #3] Started for cause: [GerritCause: [ManualPatchsetCreated Change: Change-Id for #367608: I37fe286c76cab6c0b34ff496e7188bff09222f5c PatchSet: PatchSet: 3] silent: false].
Sep 08, 2016 9:53:55 PM com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ToGerritRunListener onStarted
INFO: MemoryStatus:
Project/Build: [bifrost-upstream-verify-ubuntu]: [#3: null] Completed: false
[opnfv@lf_pod2 ~]$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 63
model name : Intel(R) Xeon(R) CPU E5-2637 v3 @ 3.50GHz
stepping : 2
microcode : 0x29
cpu MHz : 1200.117
cache size : 15360 KB
@Aricg
Aricg / ref-update
Last active August 29, 2015 14:16
ref-update enforcement hook for jira issue
#!/bin/bash
ref="$(awk -F'newrev' '{print $2}' <<< "$@" | xargs)"
log="$(git log --format=%s%b -n 1 "$ref")"
if grep -iq "JIRA:*[0-9]*" <<< "$log"
then
:
else
echo "Commit rejected, please provide a jira issue in the format JIRA: ISSUE_NUMBER in the commit message"
exit 1
@Aricg
Aricg / checksnmp_pdu
Last active August 29, 2015 14:11
Nagios Check for Raritan 1000X PDU
#!/bin/bash
help () {
echo "===================================="
echo "$0"
echo "Option:-"
echo " -w : PDU Usage warning "
echo " -c : PDU Usage critical "
@Aricg
Aricg / gist:56f1a769cbdcbb93b459
Last active June 12, 2023 09:43
Enable gerrit replication to github
Gerrit version 2.8
Replication plugin extracted from gerrit.war and installed over ssh
Installation method ->
a) Relevant configs:
/var/lib/gerrit/etc/replication.config
[remote "aricg-compliance"]
url = git@github.com:somerepo/${name}.git
@Aricg
Aricg / gist:b97dab858b7553f7f3c3
Last active August 29, 2015 14:06
color test
for x in 0 1 4 5 7 8; do for i in `seq 30 37`; do for a in `seq 40 47`; do echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m "; done; echo; done; done; echo "";
@Aricg
Aricg / gist:cfaa0210e664d5b4f71d
Created September 10, 2014 01:02
tmux config
set -g default-terminal "screen-256color"
setw -g mode-keys vi
set -g prefix C-d
unbind C-b
bind C-d send-prefix
unbind ^A
bind ^A select-pane -t :.+
# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "xsel --clipboard -i"
@Aricg
Aricg / Build its-Bugzilla for gerrit 2.9
Last active August 29, 2015 14:06
Build its-Bugzilla for gerrit 2.9
(Configuring buck not included)
git clone --recursive -b stable-2.9 https://gerrit.googlesource.com/gerrit
buck build api
buck build api_install
cd buck-out/gen/gerrit-plugin-api/
mvn install:install-file \
-DgroupId=com.google.gerrit \
@Aricg
Aricg / gist:4ed35ad3fde0e44a89ca
Last active August 29, 2015 14:06
Debug for an bug report
###### STARTING THE CONTAINER:
Sep 08 10:44:03 hyperion.local docker[13188]: 2014/09/08 10:44:03 POST /v1.13/containers/create
Sep 08 10:44:03 hyperion.local docker[13188]: [87d65874] +job create()
Sep 08 10:44:03 hyperion.local kernel: device-mapper: thin: Creation of new snapshot 44 of device 30 failed.
Sep 08 10:44:03 hyperion.local kernel: EXT4-fs (dm-6): mounted filesystem with ordered data mode. Opts: discard
Sep 08 10:44:03 hyperion.local kernel: SELinux: initialized (dev dm-6, type ext4), uses xattr
Sep 08 10:44:03 hyperion.local kernel: device-mapper: thin: Creation of new snapshot 46 of device 45 failed.
Sep 08 10:44:03 hyperion.local docker[13188]: [87d65874] -job create() = OK (0)
Sep 08 10:44:03 hyperion.local docker[13188]: 2014/09/08 10:44:03 POST /v1.13/containers/c0ff44ef206cdd617fdfe394fab4ef63b26dc4d89163dd93395073114361083b/attach?stderr=1&stdin=1&stdout=1&stream=1
Sep 08 10:44:03 hyperion.local docker[13188]: [87d65874] +job container_inspect(c0ff44ef206cdd617fdfe394fab4ef63b26dc4d89163dd