Skip to content

Instantly share code, notes, and snippets.

View example.sql
SELECT hosts.host
FROM ((hosts
INNER JOIN host_resources on hosts.id = host_resources.host_id
INNER JOIN resources on resources.id = host_resources.resource_id))
WHERE resources.name = 'Motd';
View host.yaml
mongodb::dbs:
testdb:
user: user1
password_hash: a15fbfca5e3a758be80ceaf42458bcd8
View test.c
#include <stdio.h>
#include <curl/curl.h>
#include <openssl/crypto.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
CURLcode cas_curl_ssl_ctx(CURL *curl, void *sslctx, void *parm)
{
View gsuite.py
#!/usr/bin/env python3
"""A simple example of how to access the Google Analytics API."""
from argparse import ArgumentParser
from apiclient.discovery import build
from google.oauth2 import service_account
def get_args():
View foo.rb
class Foo
@@count = 1
def self.count
@@count
end
def self.increment
@@count += 1
end
end
Puppet::Functions.create_function(:'test::foo') do
View test.pp
class resolv {
case $hostname {
/^[Abc]/: {
resolv::resolv_config { 'Default':
domain => "mydomain.local",
}
}
}
}
View bash.sh.erb
<% if @test -%>
command0
<%- if @test2 -%>
command1
command2
command3
<%- end -%>
<%- end -%>
View sqlite.pp
class sqlite {
file{'/usr/local/share/myschema.sql':
ensure => file,
content => file('sqlite/myschema.sql')
}
exec{'sqllite3 /path/to/db.sql < /usr/local/share/myschema.sql':
refreshonly => true
subscribe => File['/usr/local/share/myschema.sql']
}
}
View chain.pp
$chain = @("CHAIN")
${file('/tmp/foo.pem')}
${file('/tmp/bar.pem')}
| CHAIN
notice($chain)
View data.yaml
profile::bacula::myclass::mydefines:
foobar:
abc: some value