Close

Uncategorized

The screen command

useful for: collaboration: 1. share screens with colleages 2. long running jobs. e.g. cp 100GB to an NFS. You can monitor progress by going back the screen. https://www.lynda.com/Linux-tutorials/Manage-terminal-sessions-screen/618702/729627-4.html

Read More

Register external service to consul

https://www.consul.io/docs/guides/external.html https://aws.amazon.com/blogs/aws/keeping-time-with-amazon-time-sync-service/ https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-time.html#configure-amazon-time-service $ curl -X PUT -d ‘{ “Node”: “aws-ntp”, “Address”: “169.254.169.123”, “Service”: { “Service”: “ntp” } }’ http://localhost:8500/v1/catalog/register nslookup of ntp.service.{{domain}} should now work. you can then populate /etc/ntp.conf with ‘ntp.service.{{domain}}’ using consul templates. In case you want to deregister this service from consul, run: $ curl –request […]

Read More

Editing the httpd.conf file using Augeas

Sometimes you might want to edit the httpd.conf file using a shell script. For example let’s say we have the following file on our CentOS 7 machine: $ cat /etc/httpd/conf/httpd.conf ServerRoot “/etc/httpd” Listen 80 Include conf.modules.d/*.conf User apache Group apache ServerAdmin root@localhost AllowOverride none Require all denied DocumentRoot “/var/www/html” AllowOverride […]

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

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