Skip to content

Instantly share code, notes, and snippets.

View rpetti's full-sized avatar

Rob Petti rpetti

View GitHub Profile
@rpetti
rpetti / docuum-daemonset.yml
Last active May 16, 2024 19:01
docuum daemonset for kubernetes
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: docuum
namespace: kube-system
labels:
k8s-app: docuum
spec:
selector:
matchLabels:
@rpetti
rpetti / .bashrc
Created January 20, 2024 06:00
change directory using ranger
function ranger-cd {
local IFS=$'\t\n'
local tempfile="$(mktemp -t tmp.XXXXXX)"
local ranger_cmd=(
command
ranger
--cmd="map <enter> chain shell echo %d > "$tempfile"; quitall"
)
${ranger_cmd[@]} "$@"
@rpetti
rpetti / export-awx-inventory.py
Created February 5, 2020 22:40
Export Ansible AWX/Tower Inventory to a standard Inventory
#!/usr/bin/python
import requests
import argparse
import sys
parser = argparse.ArgumentParser(description='Convert Ansible AWX/Tower Inventory to standard inventory')
parser.add_argument('--url', required=True, help='base url of AWX/Tower')
parser.add_argument('-u', '--username', help='username')
@rpetti
rpetti / o365-notifications.user.js
Created July 29, 2019 22:04 — forked from bparker98/o365-notifications.user.js
Office 365 Notifications Tampermonkey Script
// ==UserScript==
// @name Office 365 Notifications
// @namespace http://tampermonkey.net/
// @version 0.4
// @description try to take over the world!
// @author Brandon Parker
// @match https://outlook.office365.com/*
// @match https://outlook.office.com/*
// @iconURL https://r1.res.office365.com/owa/prem/16.1630.12.2223203/resources/images/0/favicon_mail.ico
// @UpdateURL https://gist.githubusercontent.com/bparker98/fdd125541c8ec9c676ca435e9eb9165a/raw/o365-notifications.user.js
#!/usr/bin/python
import marshal
import subprocess, shlex
import re
import os
import sys
clienthostcache = {}
@rpetti
rpetti / kill-scm-threads.groovy
Created January 24, 2018 17:19 — forked from andyjones/kill-scm-threads.groovy
Kills long running SCM polling threads in Jenkins
Jenkins.instance.getTrigger("SCMTrigger").getRunners().each()
{
item ->
long millis = Calendar.instance.time.time - item.getStartTime()
if(millis > (1000 * 60 * 60)) // 1000 millis in a second * 60 seconds in a minute * 3 minutes
{
Thread.getAllStackTraces().keySet().each()
{
tItem ->

Keybase proof

I hereby claim:

  • I am rpetti on github.
  • I am rpetti (https://keybase.io/rpetti) on keybase.
  • I have a public key whose fingerprint is 09CE 769D FE6B 78FA A08B A95B 9A66 5BE0 F3F3 92BE

To claim this, I am signing this object:

@rpetti
rpetti / auth-set.pl
Last active December 27, 2015 12:19
/etc/p4passwd contains plain text passwords (for administrator override). When a user changes their password, a shadow password entry is added to /etc/p4shadow, which is used for authentication from then-on. If the user isn't in the p4passwd or p4shadow file, it will use ldap authentication.
#!/usr/bin/perl
# p4 trigger: updateLocalPw auth-set auth "%serverroot%/triggers/auth-set.pl %user% %serverroot%/triggers/ldap-check-auth.pl"
$login = shift(ARGV);
$authCmd = shift(ARGV);
open(LCL_PASSWD_FILE,"</etc/p4shadow") or die "Can't open local shadow password file.";
@PASSWD = <LCL_PASSWD_FILE>;
close(LCL_PASSWD_FILE);
def project = hudson.model.Hudson.instance.getItem("Project A");
project.lastSuccessfulBuild == project.lastBuild;
traceroute to 192.18.49.136 (192.18.49.136), 30 hops max, 60 byte packets
1 192.168.2.1 (192.168.2.1) 0.602 ms 1.469 ms 1.750 ms
2 tauron.lan (192.168.1.1) 7.692 ms 8.736 ms 9.307 ms
3 * * *
4 rd1so-ge3-0-0-18.cg.shawcable.net (64.59.142.226) 87.492 ms 91.480 ms 91.844 ms
5 rc2so-tge0-8-2-0.cg.shawcable.net (66.163.71.117) 92.380 ms 95.657 ms 96.077 ms
6 rc1nr-tge0-9-2-0.wp.shawcable.net (66.163.77.54) 112.856 ms 81.660 ms 26.250 ms
7 rc2ec-tge0-8-2-0.il.shawcable.net (66.163.77.133) 50.097 ms 56.851 ms 57.181 ms
8 xe-4-2-0.edge3.Chicago3.Level3.net (4.53.96.105) 55.940 ms 55.459 ms 54.902 ms
9 ae-31-55.ebr1.Chicago1.Level3.net (4.68.101.158) 57.771 ms ae-31-51.ebr1.Chicago1.Level3.net (4.68.101.30) 70.492 ms ae-31-55.ebr1.Chicago1.Level3.net (4.68.101.158) 70.868 ms