Skip to content

Instantly share code, notes, and snippets.

View standaloneSA's full-sized avatar

Matt Simmons standaloneSA

View GitHub Profile
@standaloneSA
standaloneSA / gist:0ffdef6bd77661979eb791ba5c885944
Created December 24, 2023 04:54
Quick python script to break up a text file into training data
#!/usr/bin/env python3
import sys
import os
import json
import re
def break_text_into_segments(input_file, max_segment_length, overlap_length):
segments = []
@standaloneSA
standaloneSA / nvidia.md
Last active April 29, 2024 17:11 — forked from meikuam/nvidia.md
Nvidia GPUs sorted by CUDA cores
@standaloneSA
standaloneSA / install-awx.sh
Created May 9, 2020 21:49
Install AWX (Tower) on CentOS 7
#!/bin/bash
set -e
setenforce Permissive
yum install -y epel-release
yum remove python-docker-py -y
yum install python3 python3-pip3 -y
pip3 install cryptography
haproxy::frontend { 'myhost':
collect_exported => false,
mode => 'http',
bind => { "${::ipaddress_eth1}:443" => [ 'ssl', 'crt', '/etc/haproxy/certs/ssl.pem' ] },
options => { 'default_backend' => 'myhost'},
}
open("/var/run/SERVICE.pid", O_RDONLY) = -1 ENOENT (No such file or directory)
getpid() = 5778
open("/var/run/SERVICEd.pid", O_WRONLY|O_CREAT|O_TRUNC|O_NOFOLLOW, 0666) = 3
fcntl(3, F_GETFL) = 0x28001 (flags O_WRONLY|O_LARGEFILE|O_NOFOLLOW)
fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08cc83a000
lseek(3, 0, SEEK_CUR) = 0
write(3, "5778\n", 5) = 5
close(3) = 0
munmap(0x7f08cc83a000, 4096) = 0
msimmons@nagios:/opt/collectd/etc$ cat collectd.conf
# Generated by Puppet
#Hostname localhost
FQDNLookup true
#BaseDir "/var/lib/collectd"
#PluginDir "/usr/lib/collectd"
#TypesDB "/usr/share/collectd/types.db" "/etc/collectd/my_types.db"
Interval 10
Monday, June 22nd, 2015 8 days ago
3:22 PM <MPSimmons> What I'm trying to do is have apache listen on a particular IP, and I'm doing it with ip => "$::fact::ipaddress_eno16780032_1"
3:22 PM <MPSimmons> (using the apache module from puppetforge)
3:22 PM <MPSimmons> facter only shows the first IP of the interface if I don't make it a sub-interface
3:23 PM <Thermi> MPSimmons: Creating a sub interface makes no sense for that
3:23 PM <MPSimmons> Why is that"?
3:23 PM <Thermi> Fix facter then.
3:23 PM <MPSimmons> That facter only shows the first IP is orthogonal to the problem, which is that I don't know how to create a subinterface
3:23 PM <Thermi> Because facter is broken? (Wild guess)
3:24 PM <tigalch> if that IP does not change - why not configure apache to listen to it in the configuration of apache?
@standaloneSA
standaloneSA / gist:fdcee007a392a572636a
Created June 30, 2015 13:51
CentOS 7 Bridge - Halp
[vagrant@vagrant-centos7 ~]$ brctl show
bridge name bridge id STP enabled interfaces
br0 8000.005056a70416 no eno16780032
veth0
[vagrant@vagrant-centos7 ~]$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
@standaloneSA
standaloneSA / gist:bc2dc758005bccda4c81
Created April 28, 2015 12:28
Get the switchport a VM NIC is attached to
$MYHOSTNAME = "Your.Host.Here"
$VMNIC = "vmnic0"
$NS = (((Get-VMhost -name $MYHOSTNAME) | Get-View).ConfigManager.NetworkSystem)
(((Get-view -ID $NS).NetworkINfo.Pnic |
Where-Object { $_.Device -eq $VMNIC } |
%{ (Get-View -ID $NS).QueryNetworkHint($_.Device) }).ConnectedSwitchPort).PortID
# We're going to use fpm to create the package.
# https://github.com/jordansissel/fpm
sudo gem install fpm
cd ~
# This is where we'll install the compiled collectd into
mkdir ~/collectd-package
# Get the source