Skip to content

Instantly share code, notes, and snippets.

View scopenco's full-sized avatar

Andrei Skopenko scopenco

View GitHub Profile
@rbramwell
rbramwell / ansible-summary.md
Created December 15, 2017 01:12 — forked from andreicristianpetcu/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@rocket-ron
rocket-ron / gist:bf7d7ce3e5b8b7cd9197
Created August 3, 2015 05:21
Resize (increase) Root Partition on AWS EBS Volume Linux LVM
This is a resize of the actual EBS volume as opposed to adding additional disks using LVM
1. Follow the steps here: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/storage_expand_partition.html
2. Use the instructions for gdisk further down the page to set the new partition table, not gparted or fdisk.
3. Reboot the instance once the partition table is written.
4. On the instance, execute:
sudo pvresize /dev/xvda2 (or whatever the device name is)
sudo pvdisplay
@mlconnor
mlconnor / tomcat_memory.md
Created September 17, 2014 13:57
Memory settings for Java JVM in Amazon Elastic Beanstalk

Elastic Beanstalk Java JVM Settings

Determining the right memory settings (MX & MS) for the JVM is not trivial. If you set memory too low then your machine will trash as it runs out and eventually crash. If you set it too high then other critical processes such as Apache or the OS itself may become memory starved and also cause crashes.

In general, I think it best to set the initial memory setting (MS) to be small, around 200M. The real variable we need to calculate is the limit we will place on JVM memory (MS).

In order to make this determination, we need to calculate a few things such as the memory that Apache and the Linux OS need to operate efficiently.

Apache Memory Needs

@binamov
binamov / vbox_ipaddress.rb
Created April 25, 2014 17:40
An Ohai 7 plugin that assigns the IP address of eth1 to node.ipaddress attribute (for virtualbox vagrant boxes). It's an Ohai 7 rewrite of this: http://johntdyer.com/blog/2013/01/25/ohai/
Ohai.plugin(:Vboxipaddress) do
provides "ipaddress"
depends "ipaddress", "network/interfaces", "virtualization/system", "etc/passwd"
collect_data(:default) do
if virtualization["system"] == "vbox"
if etc["passwd"].any? { |k,v| k == "vagrant"}
if network["interfaces"]["eth1"]
network["interfaces"]["eth1"]["addresses"].each do |ip, params|
if params['family'] == ('inet')
ipaddress ip
@zsup
zsup / ddd.md
Last active July 31, 2024 12:15
Documentation-Driven Development (DDD)

Documentation-Driven Development

The philosophy behind Documentation-Driven Development is a simple: from the perspective of a user, if a feature is not documented, then it doesn't exist, and if a feature is documented incorrectly, then it's broken.

  • Document the feature first. Figure out how you're going to describe the feature to users; if it's not documented, it doesn't exist. Documentation is the best way to define a feature in a user's eyes.
  • Whenever possible, documentation should be reviewed by users (community or Spark Elite) before any development begins.
  • Once documentation has been written, development should commence, and test-driven development is preferred.
  • Unit tests should be written that test the features as described by the documentation. If the functionality ever comes out of alignment with the documentation, tests should fail.
  • When a feature is being modified, it should be modified documentation-first.
  • When documentation is modified, so should be the tests.
@willurd
willurd / web-servers.md
Last active September 21, 2024 09:18
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000