Skip to content

Instantly share code, notes, and snippets.

View Oloremo's full-sized avatar

Proskurin Kirill Oloremo

  • Behavox
  • GB, London
View GitHub Profile
@Oloremo
Oloremo / parse-options.sh
Created August 7, 2018 13:42 — forked from cosimo/parse-options.sh
Example of how to parse options with bash/getopt
#!/bin/bash
#
# Example of how to parse short/long options with 'getopt'
#
OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
echo "$OPTS"
@Oloremo
Oloremo / gist:482c5247ef80ce60bab93c8628909ae5
Created August 4, 2018 16:15 — forked from Ray33/gist:ba189a729d81babc99d7cef0fb6fbcd8
Amazon Elastic Network Adapter (ENA) on CentOS 7
sudo su
yum --enablerepo=extras install epel-release
yum -y install patch dkms kernel-devel perl
yum update
reboot
//TODO fetch latest ena_driver from: https://github.com/amzn/amzn-drivers/releases, this script is based on 1.5.3
cd /tmp
@Oloremo
Oloremo / ec2_group_set
Created August 1, 2018 17:36 — forked from weirdbricks/ec2_group_set
Alter security groups on EC2 nodes
#!/usr/bin/python
from boto.ec2 import connect_to_region
from boto.ec2.group import Group
from pprint import pprint
def main():
module = AnsibleModule(
argument_spec = dict(
ec2_id = dict(required=True),
@Oloremo
Oloremo / gist:6534732
Created September 12, 2013 08:59 — forked from tonyc/gist:1384523

Using strace and lsof to debug blocked processes

You can use strace on a specific pid to figure out what a specific process is doing, e.g.:

strace -fp <pid>

You might see something like:

select(9, [3 5 8], [], [], {0, 999999}) = 0 (Timeout)