Skip to content

Instantly share code, notes, and snippets.

View powellnathanj's full-sized avatar

Nathan Powell powellnathanj

  • Carlisle PA
View GitHub Profile
@powellnathanj
powellnathanj / .curlrc
Created March 10, 2024 18:53
don't want to forget this
#resolve: hostname:port:ipaddress
resolve: hw.local:443:10.123.123.198
@powellnathanj
powellnathanj / ff.py
Last active February 19, 2024 17:11
Generate a filter for panorama firewall monitor for urls with multiple ips
#!/usr/bin/env python3
import sys
ffilter = ""
for line in sys.stdin:
ffilter = ffilter + "( addr.dst in '" + line.rstrip() + "' ) or "
print(ffilter)
@powellnathanj
powellnathanj / gist:b9b071571191c207e966b2d5f14223ad
Created October 18, 2023 19:53
Working Ansible/Azure pipenv environment (RHEL 8)
python3.8 -m pip install pipenv
mkdir env
cd env
pipenv install
pipenv shell
pip install ansible
pip install azure-cli
ansible-galaxy collection install azure.azcollection --force # need to be on latest to fix a lot
sudo updatedb
pip install -r $(locate requirements-azure.txt | grep -v sanity | grep env)
---
- name: Get SSH keys
hosts: all
gather_facts: no
connection: local
tasks:
- name: "ssh and accept key with expect"
ansible.builtin.expect:
command: ssh {{inventory_hostname}} 'uptime'
responses:
@powellnathanj
powellnathanj / SSLPoke.java
Last active August 26, 2022 20:07 — forked from 4ndrej/SSLPoke.java
Test of java SSL / keystore / cert setup. Check the comment #1 for howto.
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
public class SSLPoke {
public static void main(String[] args) {
if (args.length != 2) {
System.out.println("Usage: "+SSLPoke.class.getName()+" <host> <port>");
System.exit(1);
# ssh-agent configuration
if [ -z "$(pgrep ssh-agent)" ]; then
rm -rf /tmp/ssh-*
eval $(ssh-agent -s) > /dev/null
else
export SSH_AGENT_PID=$(pgrep ssh-agent)
export SSH_AUTH_SOCK=$(find /tmp/ssh-* -name agent.*)
fi
if [ "$(ssh-add -l)" == "The agent has no identities." ]; then
[root@cabbage ~]# free -m
total used free shared buff/cache available
Mem: 3936 282 1151 1 2503 3237
Swap: 4067 0 4067
[root@cabbage ~]# cat /proc/cpuinfo | grep model\ name | head -n 1
model name : Intel(R) Atom(TM) CPU D2550 @ 1.86GHz
[root@cabbage ~]# cat /proc/cpuinfo | grep model\ name | wc -l
4
@powellnathanj
powellnathanj / puppetdb-curl.sh
Created August 12, 2016 14:45 — forked from marshyski/puppetdb-curl.sh
Puppet DB Curl Examples
curl -sfG 'http://localhost:8080/v3/nodes' --data-urlencode 'query=["=", ["node", "active"], true]'
curl -sf 'http://localhost:8080/v3/facts'
curl -sf 'http://localhost:8080/v3/nodes'
curl -sfG 'http://localhost:8080/v3/nodes' --data-urlencode 'query=["=", ["fact", "kernel"], "Linux"]'
curl -sfG 'http://localhost:8080/v3/nodes' --data-urlencode 'query=["=", ["fa, "operatingsystem"], "windows"]'
function gu(){
if [[ $1 != '' ]]; then
for i in $(seq $1); do
dots="$dots../"
done
cd $dots
else
echo 'gu requires number arg'
fi
dots=''
root@turnip speedtest-cli]# ./speedtest_cli.py --server 1775
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Comcast Cable (75.75.160.35)...
Hosted by Comcast (Baltimore, MD) [115.19 km]: 57.616 ms
Testing download speed........................................
Download: 22.15 Mbit/s
Testing upload speed..................................................
Upload: 4.90 Mbit/s