Skip to content

Instantly share code, notes, and snippets.

View jflemer-ndp's full-sized avatar

James E. Flemer jflemer-ndp

  • NDP, LLC.
  • Boulder, CO
View GitHub Profile
#!/bin/sh
# Copyright 2017, NDP LLC
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
@jflemer-ndp
jflemer-ndp / pps_yum.sh
Last active December 2, 2017 22:51
Generate markdown software report for yum repos
#!/bin/sh
# Usage:
# pps_yum.sh /path/to/repo1 ... /path/to/repoN
#
# Example:
# pps_yum.sh /export/repos/rhel-7-* /export/repos/rhel-*-7-* > rhel7_pps.md
# Copyright 2017, NDP LLC
#
ipmitool -H $IP -U $USER -P $PASSWORD sensor 2>&1 | perl -pe '%p;$s="ok";while(<>){chomp;my @a=split/\s*\|\s*/;next if $a[3] eq "na" or $a[2] eq "discrete"; $s=$a[3] if $a[3] ne "ok";$p{$a[0]}=\@a} print "SENSOR $s"; map { ($n=lc $_->[0])=~s/[^+a-z0-9]/_/g; print "|$n=$_->[1] $_->[2]\n"} values %p'
#!/bin/sh
##############################################################################
# Generate a version string based on tags in the current git repo.
#
# Usage
# -----
#
# git-version.sh VERSION
#
@jflemer-ndp
jflemer-ndp / tiles.jmx
Created May 9, 2016 20:22
tile server benchmark with jmeter
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.6" jmeter="2.11.20150716">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="tiles" enabled="true">
<boolProp name="TestPlan.functional_mode">false</boolProp>
<stringProp name="TestPlan.comments"></stringProp>
<stringProp name="TestPlan.user_define_classpath"></stringProp>
<boolProp name="TestPlan.serialize_threadgroups">true</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
@jflemer-ndp
jflemer-ndp / convert.pl
Created December 30, 2015 21:57
junos legacy dhcp to extended dhcp conversion for static reservations
#!/usr/bin/env perl
$i = "FOO";
$p = "BAR";
while(<>){
if(m/system services dhcp static-binding (\S*) (\S*) (\S*)/){$d{$1}->{$2}=$3}
}
map {
printf("set routing-instances $i access address-assignment pool $p family inet host %s hardware-address %s\n", $d{$_}->{"host-name"}, $_);
printf("set routing-instances $i access address-assignment pool $p family inet host %s ip-address %s\n", $d{$_}->{"host-name"}, $d{$_}->{"fixed-address"});
} keys %d
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Map[]>
<Map srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over" buffer-size="128" background-color="#ffffff">
<Parameters>
<Parameter name="name"><![CDATA[POSM]]></Parameter>
<Parameter name="attribution"><![CDATA[Data © OpenStreetMap Contributors]]></Parameter>
<Parameter name="center">-75.525,39.158,12</Parameter>
<Parameter name="format">png</Parameter>
<Parameter name="minzoom">0</Parameter>
@jflemer-ndp
jflemer-ndp / network-manager-vpnc-0.9.4.0-juniper.diff
Created September 19, 2012 03:32
network-manager-vpnc patch to add "juniper" as a vendor
diff -ru network-manager-vpnc-0.9.4.0/po/es.po network-manager-vpnc-0.9.4.0-juniper/po/es.po
--- network-manager-vpnc-0.9.4.0/po/es.po 2012-03-12 17:55:20.000000000 -0600
+++ network-manager-vpnc-0.9.4.0-juniper/po/es.po 2012-05-20 23:09:22.201087344 -0600
@@ -215,9 +215,9 @@
msgstr "Fabricante:"
#: ../properties/nm-vpnc-dialog.ui.h:6
-msgid "Vendor of your IPsec gateway&#10;config: Vendor <cisco/netscreen>"
+msgid "Vendor of your IPsec gateway&#10;config: Vendor <cisco/juniper/netscreen>"
msgstr ""