Skip to content

Instantly share code, notes, and snippets.

View fapestniegd's full-sized avatar

James S White fapestniegd

View GitHub Profile
my $t_elements = keys(%{ $tmpl });
print Data::Dumper->Dump([ {
'tmpl' => $tmpl,
't_elements' => $t_elements,
} ]);
$VAR1 = {
'tmpl' => {
'service_notification_options' => 'w,u,c,r',
2010-03-27 18:42:57 999 +999 -0 [email protected] initial migration from superstrings
2010-03-27 18:54:03 1020 +21 -0 [email protected] adding host-specific nodes, goddamnit.
2010-03-27 18:57:20 1020 +3 -3 [email protected] stop postfix from neutering
2010-03-27 18:59:41 1020 +2 -2 [email protected] making it run puppet-strings
2010-03-27 19:02:36 1042 +22 -0 [email protected] adding postfix-server
2010-03-27 19:03:43 1042 +1 -1 [email protected] renamed copied class
2010-03-28 11:36:58 1051 +72 -63 [email protected] switching the global ldap.conf to anonpass
2010-03-28 11:38:05 1153 +102 -0 [email protected] switching the global ldap.conf to anonpass
2010-03-28 11:43:55 1164 +12 -1 [email protected] adding wcyd apt key
2010-03-28 11:52:25 1164 +1 -1 [email protected] trunkated passwd bugfix
################################################################################
# export BASE="/var/tmp/$(hostname)";
# openssl pkcs12 -in ${BASE}.p12 -passin pass:$(secret) -out ${BASE}.pem -nokeys
# openssl x509 -in ${BASE}.pem -out ${BASE}.crt -text
# openssl pkcs12 -in ${BASE}.p12 -passin pass:$(secret) -out ${BASE}.ekey -passout pass:$(secret) -nocerts
# openssl rsa -in ${BASE}.ekey -passin pass:$(secret) -out ${BASE}.key
################################################################################
snmp_extend_oid (){
oid=$1; tag=$2;
taglen=$(expr length $tag)
tag_oid=$(
echo "${tag}"| sed 's/\(.\)/\1\n/g'| while read char ;do
if [ ! -z "${char}" ];then
echo -n .
echo -n $(( ( 256 + $(printf '%d' "'$char"))%256 ));
fi
done
Q: "...in/service $(se": $(service): unrecognized service
I: Last 1 quoted lines were generated by promiser "/sbin/service $(service) restart"
########################################################################################################################
Given 3 systems and 2 IPSec tunnels,
[ System A ]<---------->[ Systtem B ]<---------->[ System C ]
Such that:
System A: (road warrior, passes all traffic to System B)
internal: 172.16.0.128
external: 1.1.1.1
{"results":[{"profile_image_url":"http://a3.twimg.com/profile_images/1095036455/Picture0002_normal.jpg","created_at":"Wed, 08 Sep 2010 04:35:54 +0000","from_user":"iiMJusOC","metadata":{"result_type":"recent"},"to_user_id":92774888,"text":"@Fatboy_Finesse nope but it wont be hard to get sumthin! lol #howudoin!","id":23885102331,"from_user_id":6843369,"to_user":"Fatboy_Finesse","geo":null,"iso_language_code":"en","source":"&lt;a href=&quot;http://twitter.com/&quot;&gt;web&lt;/a&gt;"},{"profile_image_url":"http://a3.twimg.com/profile_images/1109589819/JessABratt_normal.jpg","created_at":"Wed, 08 Sep 2010 04:26:34 +0000","from_user":"JessABratt","metadata":{"result_type":"recent"},"to_user_id":null,"text":"Lol that's my shit RT @Lo_Henry: #honesthour I love to b love... N wendy Williams thanks to @jessabratt #howudoin","id":23884527656,"from_user_id":89456410,"geo":null,"iso_language_code":"en","source":"&lt;a href=&quot;http://www.echofon.com/&quot; rel=&quot;nofollow&quot;&gt;Echofon&lt;/a&gt;"},{"profile_imag
<%#?php :) --------------------------------------------------------------------%>
<%# if DNS is tehborken then so is this #-%>
<%
require 'rubygems'
require 'phact_erb'
p = PhactERB.new
data ={:vpn_peers => p.peer_vpn_data(p.domainname),:self_vpn => p.self_vpn_data}
-%>
<%#---------------------------------------------------------------------------%>
puts data[:self_vpn][:pool] # 32
# puts data[":self_vpn"][":pool"] # ./phacts.rb:39: undefined method `[]' for nil:NilClass (NoMethodError)
# puts data["self_vpn"]["pool"] # ./phacts.rb:40: undefined method `[]' for nil:NilClass (NoMethodError)
# puts data[':self_vpn'][':pool'] # ./phacts.rb:41: undefined method `[]' for nil:NilClass (NoMethodError)
# puts data['self_vpn']['pool'] # ./phacts.rb:42: undefined method `[]' for nil:NilClass (NoMethodError)
:self_vpn:
:pub_ip: 207.192.74.54
:netmask: 255.255.255.224
:vpn_ip: 172.16.0.3
:network: 172.16.0.96
:cidr: 172.16.0.96/27
:peer: thor.websages.com
:pool: 32