Skip to content

Instantly share code, notes, and snippets.

@gojun077
gojun077 / cfme_check_provider.py
Last active January 17, 2016 00:50
A python 3 script that uses the manageIQ REST API v2.1 for manageIQ/Cloudforms 4 to get information about cloud providers
# cfme_check_provider.py
# Python3 script that queries Cloud providers through
# the CFME API (v2.1.0+) for CFME v4 and returns
# details for each provider
import requests
import pprint
import doctest
import re
curl --user admin:smartvm \
-i -k -X GET -H "Accept: application/json" \
https://192.168.40.250/api/providers
# cfme_add_provider.py
# Python 3 script that adds an Openstack cloud provider through
# the CFME API (v2.1.0+) for CFME v4
import requests, pprint, json
payload = json.dumps({'action' : 'create',
'resource' :
{"name" : "openstack-cfme",
"type" : "ManageIQ::Providers::Openstack::CloudManager",
curl --user admin:smartvm \
-i -k -X POST -H "Accept: application/json" \
-d '{ "action" : "create", "resource" : { "type" : "ManageIQ::Providers::Openstack::CloudManager", "name" : "openstack-cfme", "hostname" : "192.168.40.198", "ipaddress" : "192.168.40.198", "port" : "5000", "credentials" : [ { "userid" : "admin", "password" : "admin" }, { "userid" : "guest", "password" : "guest", "auth_type" : "amqp" } ] } }' \
https://192.168.40.250/api/providers
@gojun077
gojun077 / tty_startup.sh
Created September 26, 2015 14:54
launch SpiderOakONE and dropboxd daemons in a tty session
#!/bin/bash
# This script launches various daemons for a non-graphical
# session
SpiderOakONE --headless &
dropbox-cli start &
@gojun077
gojun077 / screen_netbook.sh
Last active October 17, 2015 18:26
GNU screen launch script for netbook
#!/bin/bash
#screen_netbook.sh
#This script launches Screen with various tabs and starts various programs
#such as htop, cmus, etc. as well as custom scripts in separate tabs.
#It is intended to be used in tty-only sessions on netbooks that don't
#have enough memory and CPU to handle X11 graphical sessions
# Meaning of GNU Screen option flags:
# -A adapt the sizes of all windows to the size of the current terminal
@gojun077
gojun077 / apple2_example2.xml
Created September 20, 2015 06:22
example of a custom entry in MESS xml software list for apple2.xml
<software name="snptrpgp">
<description>Snooper Troops Case of the Granite Point Ghost</description>
<year>1982</year>
<publisher>Spinnaker Software</publisher>
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="143360">
<rom name="Snooper Troops and the Case of- The Granit Point Ghost (1982)(Spinmaker Software Corp).dsk" size="143360" crc="1ee9fec2" sha1="fedc1df0bbf84b1c9569ba497b320535f4b2752c" offset="0x0000" />
</dataarea>
</part>
@gojun077
gojun077 / apple2_example1.xml
Created September 20, 2015 06:15
sample software entry using xml schema for MESS software lists
<software name="archon2">
<description>Archon II: Adept</description>
<year>1985</year>
<publisher>Electronic Arts</publisher>
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="143360">
<rom name="archon ii - adept (1985)(electronic arts)[cr racketeers].dsk" size="143360" crc="fcf7b2e8" sha1="9b6e91644b23e08138dd125a11ce51aef0e1138d" offset="0x0000" />
</dataarea>
</part>
@gojun077
gojun077 / mcelog.conf
Created June 13, 2015 18:02
my mcelog.conf file that works with systemd (not syslog)
# Example config file for mcelog
# mcelog is the user space backend that decodes and process machine check events
# (cpu hardware errors) reported by the CPU to the kernel
#
# general format
#optionname = value
# white space is not allowed in value currently, except at the end where it is dropped
#
#!/bin/bash
# Brainworkshop 4.8.4-4 launch script for Archlinux
BRW_CONFIGFILE=$HOME/Dropbox/.brainworkshop/data/.brainworkshop.ini
BRW_STATFILE=$HOME/Dropbox/.brainworkshop/data/.brainworkshop.stats
BRW_DATADIR=$HOME/Dropbox/.brainworkshop/data/
python2 /usr/share/brainworkshop/brainworkshop.pyw --configfile ~/Dropbox/.brainworkshop/data/.brainworkshop.ini --statsfile ~/Dropbox/.brainworkshop/data/.brainworkshop.stats --datadir ~/Dropbox/.brainworkshop/data/