Skip to content

Instantly share code, notes, and snippets.

View martineg's full-sized avatar

Martin Eggen martineg

View GitHub Profile

Keybase proof

I hereby claim:

  • I am martineg on github.
  • I am martineg (https://keybase.io/martineg) on keybase.
  • I have a public key ASDqkQqYU5xVLin8IuMOAGC8exvuwNMX5USr82wg2Olz1wo

To claim this, I am signing this object:

# provision a test stack
# assumes OS_* credentials are set in environment
provider "openstack" {}
# keypair
resource "openstack_compute_keypair_v2" "keypair" {
name = "tf-keypair-1"
region = ""
public_key = "${file(var.pubkey_path)}"
$ dpkg -l vim
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-===========================-===========================-======================================================================
un vim <none> (no description available)
$ cat apt.yml
---
@martineg
martineg / gist:f035a762d2a96b803c32
Created September 3, 2014 13:52
Ansible playbook for HP server tools
---
- hosts: all
tasks:
- name: add HP repository key
apt_key: url=http://downloads.linux.hp.com/SDR/downloads/mcp/GPG-KEY-mcp state=present
- name: add HP tools repository
apt_repository: repo="deb http://downloads.linux.hp.com/SDR/repo/mcp precise/current non-free"
- name: add HP packages
@martineg
martineg / gist:1f5d3bf3f0af095eebdf
Created August 25, 2014 12:19
Pharo Teapot REST example
"From http://smalltalkhub.com/#!/~zeroflag/Teapot"
| books teapot |
books := Dictionary new.
teapot := Teapot configure: {
#defaultOutput -> #json. #port -> 8000. #debugMode -> true }.
teapot
GET: '/books' -> books;
@martineg
martineg / gist:10604955
Last active August 29, 2015 13:59
Ansible - wait for webapp to be available
- name: wait for app server to start up
wait_for: host=127.0.0.1 port=8080 state=started
- name: wait for webapp to be available
uri: url=http://localhost:8080/{{ monitor_uri }} method=GET
return_content=yes
timeout=30
register: result
until: "{{ status_string_ok }}" in result.content
retries: 15
@martineg
martineg / heartbleed.yml
Last active August 29, 2015 13:58
Check for listening on :443 on all RHEL 6.5 hosts
---
- hosts: all
tasks:
- name: Check if we listen on 443 on RHEL 6.5
command: nc -z {{ ansible_default_ipv4.address }} 443
when: ansible_distribution_version == '6.5'
register: rc
ignore_errors: true
changed_when: rc|success
---
- hosts: xxx
user: root
vars:
ssl_cert_pkg: http://spacewalk-server/pub/rhn-org-trusted-ssl-cert-1.0-1.noarch.rpm
ssl_cert_file: /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT
tasks:
- name: check for Spacewalk server SSL certificate
@martineg
martineg / gist:9049447
Last active August 29, 2015 13:56
mysql snippets
-- connections per database
select db, count(db) as connections
from information_schema.processlist group by(db) order by connections desc;
- name: tomcat | Deploy configuration
template: src={{ item }}.j2 dest={{ tomcat_root }}/conf/{{ item }}
owner={{ tomcat_user }} group={{ tomcat_user }}
with_items:
- server.xml
- tomcat-users.xml
- log4j.xml
notify: restart tomcat