Skip to content

Instantly share code, notes, and snippets.

View shalomb's full-sized avatar
🎯
Knolling

Shalom Bhooshi shalomb

🎯
Knolling
View GitHub Profile
@shalomb
shalomb / disable-ipxe-netfront.patch
Created March 6, 2015 14:03
disable netfront in ipxe
diff --git a/src/arch/x86/drivers/xen/hvm.c b/src/arch/x86/drivers/xen/hvm.c
index 7ac32d5..cee7ce8 100644
--- a/src/arch/x86/drivers/xen/hvm.c
+++ b/src/arch/x86/drivers/xen/hvm.c
@@ -500,4 +500,4 @@ struct pci_driver hvm_driver __pci_driver = {
REQUIRING_SYMBOL ( hvm_driver );
/* Drag in netfront driver */
-REQUIRE_OBJECT ( netfront );
+/* REQUIRE_OBJECT ( netfront );*/
@shalomb
shalomb / keybase.md
Created August 21, 2016 18:49
keybase.md

Keybase proof I hereby claim: * I am shalomb on github. * I am shalomb (https://keybase.io/shalomb) on keybase. * I have a public key whose fingerprint is F0BE 97A9 0F3A 5885 A0E1 ABA3 4EEE E8E7 C549 498D

Keybase proof

I hereby claim:

  • I am shalomb on github.
  • I am shalomb (https://keybase.io/shalomb) on keybase.
  • I have a public key whose fingerprint is F0BE 97A9 0F3A 5885 A0E1 ABA3 4EEE E8E7 C549 498D

To claim this, I am signing this object:

@shalomb
shalomb / discover_mgmt_ipv4_address.play.yml
Last active September 27, 2017 20:23
Discover IPv4 management address
# requires python-netaddr on the control vm
# pip install netaddr
- name: Discover management ipv4 address
hosts: localhost
vars:
mgmt_network_cidr: '172.19.0.0/16' # Change this to reflect our mgmt. subnet cidr
tasks:
- name: Collect subnet addresses
@shalomb
shalomb / keybase.md
Created August 15, 2018 13:58
keybase.md

Keybase proof

I hereby claim:

  • I am shalomb on github.
  • I am shalomb (https://keybase.io/shalomb) on keybase.
  • I have a public key whose fingerprint is 6234 6401 0750 80B1 DADD D4EA C9DF B9FD 0BFC A396

To claim this, I am signing this object:

@shalomb
shalomb / artifactory-sm
Created January 9, 2019 18:31
Improved artifactory systemd service manager
#!/bin/bash
set -eu -o pipefail
ping_url='http://localhost:8081/artifactory/api/system/ping'
source /var/opt/jfrog/artifactory/etc/default
ARTIFACTORY_PIDFILE="$ARTIFACTORY_PID"
: ${START_TMO:=120}
// Square root implementation using Newton's Method
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) (z float64) {
// Solution to exercise at https://tour.golang.org/methods/18
// Exercise: Stringers
// Make the IPAddr type implement fmt.Stringer to print the address as a dotted quad.
// For instance, IPAddr{1, 2, 3, 4} should print as "1.2.3.4".
package main
import (
"fmt"
#!/usr/bin/env python3
import yaml
def get_content(file='clouds.yaml'):
with open(file, 'r') as stream:
return yaml.safe_load(stream)
def set_content(file='clouds.yaml', content=None):
with open(file, 'wt') as stream:
@shalomb
shalomb / backup.sh
Last active July 31, 2020 21:02
using rsync to backup data from aws instance
#!/bin/bash
set -eu -o pipefail
set -xv
ssh_args='-i ./aws-jira.pem -o StrictHostKeyChecking=no -o PubkeyAuthentication=yes'
ssh_host=ubuntu@XXX.XXX.XXX.XXX
# Stop services so our backups are integral