Skip to content

Instantly share code, notes, and snippets.

View zahodi's full-sized avatar

Valentin zahodi

  • Seattle
View GitHub Profile
@zahodi
zahodi / k8s.yml
Created March 26, 2019 05:50
ansible tasks to deploy your app stack to k8s
---
- name: use the venv python to ensure all dependencies are satisfied
set_fact:
ansible_python_interpreter: '{{ ansible_playbook_python }}'
- name: Create Namespaces
k8s:
kubeconfig: ~/.kube/config
state: present
definition:
@zahodi
zahodi / awx_inventory.yml
Created March 26, 2019 05:49
awx ansible inventory defintion for use with k8s, make sure you have an ingress controller running
---
groups:
all:
vars:
eks_namespaces:
- awx
- ingress-nginx
k8s_secrets:
- apiVersion: v1
kind: Secret
@zahodi
zahodi / awx_kuberntes
Last active March 26, 2019 05:52
simple awx deployment to kubernetes, assumes you have ingress controller available for use
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: awx
annotations:
kubernetes.io/ingress.class: "nginx"
spec:
tls:
- hosts:
@zahodi
zahodi / data.json
Created April 26, 2018 17:28
bandwith usage
[{"email": "dcarnell5@theguardian.com", "first_name": "Derril", "ip_address": "19.110.56.145", "last_name": "Carnell", "badwith_in_bytes": 1988, "start_date": "2018-04-25 10:34:36", "end_date": "2018-04-11 02:53:45"}, {"email": "hmacdearmaid3@godaddy.com", "first_name": "Henry", "ip_address": "134.49.19.155", "last_name": "MacDearmaid", "badwith_in_bytes": 1568, "start_date": "2018-04-12 22:01:26", "end_date": "2018-04-15 02:47:32"}, {"email": "hfeldberger2@nationalgeographic.com", "first_name": "Hamnet", "ip_address": "26.236.251.95", "last_name": "Feldberger", "badwith_in_bytes": 9034, "start_date": "2018-04-24 04:18:15", "end_date": "2018-04-20 08:29:39"}, {"email": "hmemmory8@hhs.gov", "first_name": "Hildagarde", "ip_address": "217.28.205.150", "last_name": "Memmory", "badwith_in_bytes": 4494, "start_date": "2018-04-14 08:22:16", "end_date": "2018-04-24 10:37:18"}, {"email": "gborkin9@sciencedirect.com", "first_name": "Giraud", "ip_address": "144.19.199.53", "last_name": "Borkin", "badwith_in_bytes": 7693
@zahodi
zahodi / upgrade_elasticsearch.yml
Created November 8, 2017 17:06
Ansible task to upgrade elasticsearch cluster.
---
- name: get current elasticsearch version
uri:
url: http://localhost:9200
method: GET
headers:
Content-Type: application/json
register: current_elasticsearch_version
- block:
@zahodi
zahodi / id_rsa.pub
Created April 6, 2016 18:18
valentin public key
ssh-rsa AAAAB4NzaC1yc2EAAAADAQABAAABAQC4fOC/LiPzEa3aTu8O+y91A0LhuF5yT/9PD6Xd3Dokoaa351t4mfg7mCbjifOTCl7s4NmGAK8HAvKxdtYiwFIQ80ibfT97cgK60ZRpqg//PCTMbvwuPOdyPx4J89leuzGBUGc9/IkHtfyW3hz6f1IBOX9tm48+6tQdqocGKh94T0HH0eSLx9QaPKZanVt9u22K7M9YAqomJ4IyU2XiMyBPRKgcelEkiWEvWz+w4lwhXJafPEnynO66L/ppMYwCRuII0+HRtEttrJ+jW0kEJRaOdMS4OZ6yFD8YuwjHN0qcv2pFVuDCW0XNepQ/JX60Rqr57CU5ARwIt13w+QfSYZfF valentin@valentin-vm
@zahodi
zahodi / pub.key
Created January 2, 2016 01:41
pub.key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCx4aP00AFH87vHDbkMMwVqFTEStdmmKQ+fHNW120FTs4ZxnqOd9yJ86WNAqycO66U+7faqYiTCMwg55tyyOyKptdv7KbHef+6HHKtaRFlge5tqmmbYUfzIFPNnY10oKJwoYkykot0XqQa7ySdwJhN6DwKXfKJbCx916WufTmmZSfA4tSLKVFJw7y/G1XT5ZmD+Fih+rCWDE6BGG1JUVuaPxsThthzuePKFn6FTuy6Du4Ztpu0DekCPO+FA9l9A+u4Bh1z5SyjU02XiLdQtquv5rY5TUVhK/iaTkwoUwmeIBA7N1MnUuJJZ6xQF8KjoUfK++GB70aBo2BPCoZTa9Oip root@hp-laptop
@zahodi
zahodi / wunderground
Created December 31, 2015 07:26
wunderground
#!/usr/bin/env ruby
require 'open-uri'
require 'json'
open('http://api.wunderground.com/api/key/geolookup/conditions/q/WA/Seattle.json') do |f|
json_string = f.read
parsed_json = JSON.parse(json_string)
location = parsed_json['location']['city']
temp_f = parsed_json['current_observation']['temp_f']
print "Current temperature in #{location} is: #{temp_f}\n"
@zahodi
zahodi / person class
Last active October 1, 2015 22:34
person class
#!/usr/bin/env ruby
class Person
def greet(first, last)
puts "Hello, #{first} #{last}"
end
end
person = Person.new
@zahodi
zahodi / factorial.rb
Created September 28, 2015 05:06
factorial
#!/usr/bin/env ruby
def countdown(n)
if n == 0
1
else
n*countdown(n-1)
end
end