Skip to content

Instantly share code, notes, and snippets.

View jooooooon's full-sized avatar

Jonathan Clarke jooooooon

View GitHub Profile
@jooooooon
jooooooon / gist:e3f9158a422424b36fcbe880451f61fd
Created October 31, 2016 10:33
Logs for dashkiosk issue #49
{"level":"info","message":"Rescan Chromecast devices","timestamp":"2016-10-28T15:02:57.522Z"}
{"level":"info","message":"Rescan Chromecast devices","timestamp":"2016-10-28T15:04:57.527Z"}
{"level":"info","message":"Rescan Chromecast devices","timestamp":"2016-10-28T15:06:57.531Z"}
{"level":"info","message":"display disconnected 1FZR42","timestamp":"2016-10-28T15:06:57.673Z"}
{"domain":{"domain":null,"_events":{},"_eventsCount":1,"members":[]},"_events":{"message":[null,null,null,null]},"_eventsCount":5,"id":"47d492cf484d7645c0bbdfd51bf7c5a7","friendlyName":"Bureaux-2","address":"192.168.90.160","port":8009,"logger":{"domain":null,"_events":{},"_eventsCount":0,"padLevels":false,"levels":{"silly":0,"debug":1,"verbose":2,"info":3,"warn":4,"error":5},"level":"info","emitErrs":false,"stripColors":false,"exitOnError":true,"transports":{"console":{"domain":null,"_events":{"error":[null,null]},"_eventsCount":1,"silent":false,"raw":false,"name":"console","level":"info","handleExceptions":true,"exceptionsLevel":"error"
@jooooooon
jooooooon / install-rudder-agent-rpm-latest.yml
Last active November 28, 2016 17:25
These files allow to install a Rudder agent automatically using cloud-init. All you need to do to use them is set the user-data field in your cloud provider to contain "#include" on one line, and the URL to the raw version of this script on the second line. Assuming you're using an image with cloud-init pre-installed, your new instance will spin…
#cloud-config
# Set up the package repository to get Rudder.
# We use the "latest" pseudo-version name to always get an up-to-date agent.
yum_repos:
- rudder-latest:
baseurl: http://www.rudder-project.org/rpm-latest/RHEL_7/
enabled: true
gpgcheck: true
gpgkey: http://www.rudder-project.org/packages.gpg.key
#cloud-config
# Set up the package repository to get Rudder.
# We use the "latest" pseudo-version name to always get an up-to-date agent.
# Key from http://www.rudder-project.org/packages.gpg.key
apt_sources:
- source: "deb http://www.rudder-project.org/apt-latest/ $RELEASE main"
key: |
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.10 (GNU/Linux)
@jooooooon
jooooooon / mysql_user.cf
Created May 16, 2012 12:19 — forked from frbayart/mysql_user.cf
mysql_user with cfengine
bundle agent mysql_user() {
vars:
any::
"users_to_check" slist => { "francois", "benoit" };
classes:
"user_is_not_here_$(users_to_check)" expression => returnszero("/usr/local/bin/mysql_user_check $(users_to_check)","noshell");
"mysql_users_check_NOK" expression => classmatch("user_is_not_here_.*");
commands:
body action my_bg {
background => "true";
}
body classes kept_if_else_exclusive_persist(kept, repaired, failed, persist) {
kept_returncodes => { "0" };
#repaired_returncodes => { "1", "3", "5" };
#failed_returncodes => { "7", "9" };
promise_kept => { "$(kept)" };
body common control {
bundlesequence => { "set_sections" };
}
bundle agent set_sections {
vars:
"value2in1" string => "No";
"value3in2" string => "Yes";
files:
body common control {
bundlesequence => { "set_dns_configuration" } ;
}
#######################################################################
# Configure DNS
# Use Google's DNS servers, and set the defaut domain to normation.com
#######################################################################
bundle agent set_dns_configuration {
vars:
@jooooooon
jooooooon / gist:877378
Created March 19, 2011 10:20
resolv_conf_example_template
body common control {
bundlesequence => { "set_dns_configuration" } ;
}
#######################################################################
# Configure DNS
# Use Google's DNS servers, and set the defaut domain to normation.com
#######################################################################
bundle agent set_dns_configuration {
vars:
@jooooooon
jooooooon / cron_ensure_cfexecd_running.c
Created March 3, 2011 15:29
Cfengine: add line to /etc/crontab
bundle agent cron_ensure_cfexecd_running {
files:
"$(g.crontab)"
edit_line => add_lines;
}
bundle edit_line add_lines
{
insert_lines:
"*/5 * * * * root if [ `ps -efww | grep cf-execd | grep -v grep | wc -l` -eq 0 ]; then /var/cfengine/bin/cf-execd; fi";
@jooooooon
jooooooon / cron.bash
Created March 3, 2011 15:18
Keep cf-execd alive in crontab
*/5 * * * * root if [ `ps -efww | grep cf-execd | grep -v grep | wc -l` -eq 0 ]; then /var/cfengine/bin/cf-execd; fi