Skip to content

Instantly share code, notes, and snippets.

View jkordish's full-sized avatar

Joseph Kordish jkordish

  • Trellix
  • San Antonio
  • 08:46 (UTC -05:00)
View GitHub Profile
import csv
import urllib2
from bs4 import BeautifulSoup
ifile = open('data/CVE.txt', "r").readlines()
ofile = writer = csv.writer(open('data/export.csv', 'wb'))
data = []
@jkordish
jkordish / openstack.cfg
Created November 7, 2012 16:25
Ubuntu 12.10 Juju Folsom Openstack.cfg
$ cat openstack.cfg
keystone:
openstack-origin: "cloud:precise-folsom"
admin-password: "openstack"
nova-cloud-controller:
openstack-origin: "cloud:precise-folsom"
nova-volume:
openstack-origin: "cloud:precise-folsom"
overwrite: "true"
nova-compute:
@jkordish
jkordish / gist:4032705
Created November 7, 2012 16:41
Ubuntu MaaS/JuJu OpenStack Folsom Notes
cat openstack.cfg
keystone:
openstack-origin: "cloud:precise-folsom"
admin-password: "openstack"
nova-cloud-controller:
openstack-origin: "cloud:precise-folsom"
nova-volume:
openstack-origin: "cloud:precise-folsom"
overwrite: "true"
nova-compute:
@jkordish
jkordish / .opt.rpcs.chef-cookbooks.cookbooks.swift.attributes.default.rb
Created January 18, 2013 19:33
added system() to have the disk being selected for swift skip over my fc storage
default["swift"]["disk_test_filter"] = [ "candidate =~ /sd[^a]/ or candidate =~ /hd[^a]/ or candidate =~ /vd[^a]/ or candidate =~ /xvd[^a]/",
"File.exist?('/dev/' + candidate)",
"not system('/sbin/parted /dev/' + candidate + ' -s print | grep linux-swap')",
"not system('/bin/grep FAStT ' + '/sys/block/' + candidate + '/device/model')",
"info['removable'] == 0.to_s"
]
@jkordish
jkordish / Change Swift-Proxy-Server listen port
Created January 21, 2013 16:29
The collectd-graphite and swift-proxy both run on port 8080. Following knife command will change the swift-proxy port. Run it prior to installing swift-proxy-server. This makes swift-proxy-server listen on 8180 instead of 8080. I'm changing the swift-proxy-server port instead of collectd-graphite because collectd-graphite is already installed on…
$ sudo -i
# knife exec -E '@e=Chef::Environment.load("rpcs"); @e.override_attributes(@e.override_attributes.merge({"swift"=>{"services"=>{"proxy"=>{"port"=>"8180"}}}})); @e.save'
# chef-client
# knife node run_list add node.fqdn 'role[swift-proxy-server]'
# chef-client
@jkordish
jkordish / nova-compute bug 1081808 fix
Last active December 11, 2015 17:29
#OpenStack start_guest_on_host_boot nova-compute bug See https://bugs.launchpad.net/nova/+bug/1081808 for more info
Add the following lines into /etc/nova/nova.conf
start_guests_on_host_boot=false
resume_guests_state_on_host_boot=true
Otherwise if you are using the RCBOPS cookbooks from https://github.com/rcbops-cookbooks/ you can do the following
----
$ sudo -i
# knife exec -E '@e=Chef::Environment.load("rpcs"); \
@jkordish
jkordish / gist:4706703
Last active December 12, 2015 03:28
rcbops chef mysql-openstack error
[Mon, 04 Feb 2013 08:16:59 -0500] INFO: Processing ruby_block[cleanup insecure default mysql users] action create (mysql-openstack::server line 177)
[Mon, 04 Feb 2013 08:16:59 -0500] ERROR: ruby_block[cleanup insecure default mysql users] (mysql-openstack::server line 177) has had an error
[Mon, 04 Feb 2013 08:16:59 -0500] ERROR: ruby_block[cleanup insecure default mysql users] (/var/chef/cache/cookbooks/mysql-openstack/recipes/server.rb:177:in `from_file') had an error:
ruby_block[cleanup insecure default mysql users] (mysql-openstack::server line 177) had an error: Mysql::Error: Can't connect to MySQL server on '0.0.0.0' (111)
/var/chef/cache/cookbooks/mysql-openstack/recipes/server.rb:187:in `new'
/var/chef/cache/cookbooks/mysql-openstack/recipes/server.rb:187:in `block (2 levels) in from_file'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/resource/conditional.rb:83:in `call'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/resource/conditional.rb:83:in `evaluate_block'
@jkordish
jkordish / OpenStack NOVA Database Cleanup
Created July 25, 2013 18:13
Clean up the OpenStack Nova Database -- I think I found some of this somewhere else online but can't recall the source. Putting here for perpetuity
DELETE FROM security_group_instance_association WHERE id IN (SELECT id FROM instances WHERE deleted = "1");
DELETE FROM block_device_mapping WHERE instance_uuid IN (SELECT uuid FROM instances WHERE deleted = "1");
DELETE FROM instance_info_caches WHERE instance_uuid IN (SELECT uuid FROM instances WHERE deleted = "1");
DELETE FROM instance_system_metadata WHERE instance_uuid IN (SELECT uuid FROM instances WHERE deleted = "1");
DELETE FROM virtual_interfaces WHERE instance_uuid IN (SELECT uuid FROM instances WHERE deleted = "1");
UPDATE fixed_ips SET allocated = 0 WHERE instance_uuid IN (SELECT uuid FROM instances WHERE deleted = "1");
DELETE FROM instances WHERE deleted = "1";
#!/usr/bin/env python
import urllib2
import gzip
import os
from subprocess import call
'''
Updates Transmission Blocklist with specified blocklist file. Must be run as root
if using default blocklist_path directory.
@jkordish
jkordish / apache-storm-nimbus.conf
Last active September 2, 2017 07:15
example apache storm 0.9.2 with zookeeker 3.4.6
# apache storm nimbus upstart
description "apache storm nimbus"
start on started zookeeper
stop on runlevel [!2345]
console log
limit nofile 65535 65535
respawn