CodingBee

A beginners guide to programming and automating stuff

RHCE – Network teaming or bonding

In CentOS 7 it’s possible to configure to separate network interfaces to work together. Combining two network interfaces like this is referred to as ‘Link Aggregation’. Link aggregations has the following benefits: combined bandwith – This means improved performance, better performance load balancing – So that one interface doesn’t do . . . Read more

puppet performance tuning

The latest version of PE 2016.4 has the capability to monitor the heap memory as a feature of puppet server 2.6. https://docs.puppet.com/puppetserver/2.6/status-api/v1/services.html#example-request-and-response-for-a-debug-level-get-request this guide: https://puppet.com/blog/puppet-server-advanced-memory-debugging https://docs.puppet.com/pe/latest/install_multimaster.html https://support.puppet.com/hc/en-us/articles/225049688 https://docs.puppet.com/puppetserver/latest/tuning_guide.html#number-of-jrubies Thundering herd test: After you’ve added hundreds of nodes to your deployment you may notice that your agents are running slow or . . . Read more

Git – Handy git tools and utilities

Find and get rid of really big files from your git repo: https://rtyley.github.io/bfg-repo-cleaner/ Handy tool for getting rid of stale bug/feature branches that have already been merged in to the main release/master branches: https://github.com/arc90/git-sweep

Puppet – Using AWS web console as Puppet’s external node classifier (ENC)

This is a script I wrote that queries the ec2 tags of an aws console, in order to figure out what environment a node belongs to, and what class to assign to it. #!/bin/bash # https://docs.puppetlabs.com/guides/external_nodes.html # http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html export AWS_ACCESS_KEY_ID=xxxxxxxxxxxxxxxxxxxxxx export AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxx export AWS_DEFAULT_REGION=xxxxxxx instanceid=`echo $1 | awk -F”_” ‘{print . . . Read more

Puppet – querying puppetdb with postgres command line, psql

Exported Resources https://docs.puppet.com/puppet/latest/reference/lang_collectors.html https://docs.puppet.com/pe/latest/node_deactivation.html querying puppetdb with postgres command line, psql psql -h localhost -U puppetdb puppetdb However to connect to puppet enterprise’s puppetdb, then follow: https://gist.github.com/tnolet/7133083 \q \h \l \d select * FROM catalog_resources \X \x SELECT * FROM catalog_resourcesSELECT * FROM factsselect * from factsssselect * from reports . . . Read more

AWS – SSL termination on the ELB

http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/using-elb-listenerconfig-quickref.html   Terminating SSL using Amazon ELB In my case I replaced: !/elbcheck.html with: ^(.*)$

RHCE – Network Teaming

Link Aggregation In RHEL/CentOS it is possible to combine two (physical or virtual) network interfaces so that they act as one. Having 2 network interfaces acting as one is referred to as link aggregation. There’s 2 advantages to setting up link aggregations: Improved redundancy – i.e. one interface is active, and . . . Read more

RHCE – The getent command

The getent command essentially queries a collection of sources to return a comprehensive list. $ get passwd root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin adm:x:3:4:adm:/var/adm:/sbin/nologin lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin sync:x:5:0:sync:/sbin:/bin/sync shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown halt:x:7:0:halt:/sbin:/sbin/halt mail:x:8:12:mail:/var/spool/mail:/sbin/nologin operator:x:11:0:operator:/root:/sbin/nologin games:x:12:100:games:/usr/games:/sbin/nologin ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin nobody:x:99:99:Nobody:/:/sbin/nologin systemd-bus-proxy:x:999:998:systemd Bus Proxy:/:/sbin/nologin systemd-network:x:998:997:systemd Network Management:/:/sbin/nologin dbus:x:81:81:System message bus:/:/sbin/nologin polkitd:x:997:996:User for polkitd:/:/sbin/nologin sssd:x:996:995:User for sssd:/:/sbin/nologin abrt:x:173:173::/etc/abrt:/sbin/nologin . . …etc . . . Read more