Skip to content

Instantly share code, notes, and snippets.

@zeridon
zeridon / site.yml
Created February 4, 2021 12:44
ansible add all hosts in dnsmasq for resolving (delegate to dns servers)
- hosts: all
tasks:
- name: Add the inventory into dnsmasq
lineinfile:
dest: /etc/dnsmasq.d/40-custom-hosts.conf
regexp: '^host-record={{ item }}.*'
line: "host-record={{item}},{{ hostvars[item]['ansible_default_ipv4']['address'] }},,300"
state: present
when: (hostvars[item] is defined) and (hostvars[item]['ansible_default_ipv4'] is defined) and (hostvars[item]['ansible_default_ipv4']['address'] is defined)
with_items:
@zeridon
zeridon / customer-xxxxx.tf
Last active October 19, 2017 07:44
Terraform project structure
module "customer_xxxx" {
customer_name = "xxxx"
source = "private-modules/customer_layer"
vpc_id = "${module.vpc-1.vpc_id}"
// add to every server
additional_security_group_ids = [
"${module.sg_infra.sg-1}",
"${module.sg_infra.sg-2}",
"${module.sg_infra.sg-3}",
@zeridon
zeridon / keybase.md
Created August 11, 2016 07:23
keybase.md

Keybase proof

I hereby claim:

  • I am zeridon on github.
  • I am zeridon (https://keybase.io/zeridon) on keybase.
  • I have a public key ASB27CGWi-OVuxKAQxATJPV7I5ux7WwJB6tI-HvlR-gdFwo

To claim this, I am signing this object:

# various speedups
RUN echo force-unsafe-io > /etc/dpkg/dpkg.cfg.d/docker-apt-speedup
# use apt-cacher-ng (if running)
RUN echo "HEAD /" | nc $(route -n | awk '/^0.0.0.0/ {print $2}') 3142 && \
(echo "Acquire::http::Proxy \"http://$(route -n | awk '/^0.0.0.0/ {print $2}'):3142\";" > /etc/apt/apt.conf.d/30proxy) || \
echo "No Apt-Cacher-NG detected on docker host"
@zeridon
zeridon / gist:2fa25e5b51b50b609cdf
Created June 4, 2015 15:23
Set nodes in jenkins to accept jobs
def requiredNodes = ['node1', 'node2', 'node3'];
def status = 0;
for (node in requiredNodes)
{
println "Searching for $node";
slave = Hudson.instance.slaves.find({it.name == node});
if (slave != null)
{
computer = slave.getComputer();
if (computer.isOffline())
@zeridon
zeridon / gist:f50eda1aaa16dd0d96ca
Created December 19, 2014 12:28
IAM Policy to manage own credentials including MFA
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowUsersAllActionsForCredentials",
"Effect": "Allow",
"Action": [
"iam:ChangePassword",
"iam:*LoginProfile",
"iam:*SigningCertificate*",