Skip to content

Instantly share code, notes, and snippets.

View gist:5c47eebba341d8bf5d6b88ce27d42b8a
diff --git a/lib/puppet/network/http/compression.rb b/lib/puppet/network/http/compression.rb
index e4fd5b9e8a..782cbcb1de 100644
--- a/lib/puppet/network/http/compression.rb
+++ b/lib/puppet/network/http/compression.rb
@@ -18,7 +18,11 @@ module Puppet::Network::HTTP::Compression
# return an uncompressed body if the response has been
# compressed
def uncompress_body(response)
- Puppet.deprecation_warning(_('Puppet::Network::HTTP::Compression is deprecated.'))
+ Puppet.deprecation_warning(_('Puppet::Network::HTTP::Compression::Active#uncompress_body is deprecated.'))
View puppetserver-httpclient.rb
require 'puppet'
module Puppet::Server
class HttpClient
def get(url, headers: {}, params: {}, options: {}, &block)
puts "GET #{url}"
end
end
end
View gist:608fcc027cbf77550cd302d9d8a6de9f
Executing 'dnf install -y --allowerasing autoconf automake createrepo gcc gcc-c++ java-1.8.0-openjdk-devel libsepol libsepol-devel libselinux-devel make pkgconfig cmake readline-devel rsync rpm-build rpm-libs rpm-sign rpmdevtools swig yum-utils zlib-devel systemtap-sdt-devel' on 'root@silken-vogue.delivery.puppetlabs.net'
Warning: Permanently added 'silken-vogue.delivery.puppetlabs.net,10.16.117.76' (ECDSA) to the list of known hosts.
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
localmirror-appstream 191 kB/s | 4.5 kB 00:00
localmirror-appstream 44 MB/s | 13 MB 00:00
localmirror-base 293 kB/s | 4.1 kB 00:00
localmirror-base 60 MB/s | 12 MB 00:00
Last metadata expiration check: 0:00:03 ago on Tue 10 Dec 2019 06:50:59 PM UTC.
View gist:82f89b9a79f3698000490eee77e18985
* @puppetlabs/platform-core
# @puppetlabs/platform-os
lib/puppet/type/group
lib/puppet/type/package
lib/puppet/type/service
lib/puppet/type/user
lib/puppet/provider/group
lib/puppet/provider/package
lib/puppet/provider/service
View gist:54bffd95463ae4955cd207b9fc94174f
$ bx puppet --version
5.5.7
$ bx puppet apply --modulepath=/etc/puppetlabs/code/environments/development -e "notice(mysql::deepmerge({'one' => 1}, {'two' => 2}))"
Error: Evaluation Error: Unknown function: 'mysql::deepmerge'. (line: 1, column: 8) on node localhost
$ bx puppet apply --modulepath=/etc/puppetlabs/code/environments/development -e "notice(mysql::deepmerge({'one' => 1}, {'two' => 2}))" --environment development
Error: Evaluation Error: Unknown function: 'mysql::deepmerge'. (line: 1, column: 8) on node localhost
$ bx puppet apply -e "notice(mysql::deepmerge({'one' => 1}, {'two' => 2}))" --environment development
Notice: Scope(Class[main]): {one => 1, two => 2}
Notice: Compiled catalog for localhost in environment development in 0.02 seconds
Notice: Applied catalog in 0.01 seconds
View gist:cf338b3e8426a85fd74016e5e075ed76
Warning: foo: Param :foo -> Starting
Warning: baz: Property :baz -> Starting
Warning: bar: Param :bar -> Starting
Warning: Setting Property Class Variables
Warning: qux: Param :name -> Validating 'qux'
Warning: qux: Param :name -> Munging 'qux'
Warning: Provider: Initializing Classvars
Warning: Provider Initialization :name= 'qux'
Warning: Provider Initialization :foo = ''
Warning: Provider Initialization :bar = ''
View rich.md

Given file with binary file content:

class rich {
  file { '/tmp/binary':
    ensure => file,
    content => Binary('YWJj'),
  }
}
View gist:d5e722a066b58c139d6a4776ceee8359
$ tree -I 'yard' references_output/puppet
references_output/puppet
├── configuration.md
├── function.md
├── function_strings_prefer_v3.md
├── function_strings_prefer_v4.md
├── http_api
│   ├── http_api_index.md
│   ├── http_catalog.md
│   ├── http_certificate.md
View gist:982c215beb0f26f1b1d885535f7b318b
Host ny0sgvglhhgfmsl (ubuntu-1504-i386) not connected, last checked 78833.50 minutes ago: getaddrinfo: nodename nor servname provided, or not known
Host bhc1a2boleuv9gv (ubuntu-1504-i386) not connected, last checked 78833.50 minutes ago: getaddrinfo: nodename nor servname provided, or not known
Host ko78nqn78v9o2ps (ubuntu-1504-i386) not connected, last checked 78833.50 minutes ago: getaddrinfo: nodename nor servname provided, or not known
Host kcctlxletmnez7k (win-81-x86_64) not connected, last checked never: getaddrinfo: nodename nor servname provided, or not known
Host ljbde48uwr21xvh (win-81-x86_64) not connected, last checked never: getaddrinfo: nodename nor servname provided, or not known
Host q6e5rvte9zz8rv6 (win-81-x86_64) not connected, last checked never: getaddrinfo: nodename nor servname provided, or not known
Host fwf5h9j81hznfz7 (debian-6-x86_64) not connected, last checked 78824.38 minutes ago: getaddrinfo: nodename nor servname provided, or not known
Host f8s56bmoifzbnqb (debian-6-x86_64) not
View calculator.html
<html>
<body>
<p>Enter a number: <input id="number1" type="text"/>
<p>Enter another number: <input id="number2" type="text"/>
<p id="answer"></p>
<button onclick="myFunction()">Calculate</button>
<script>
function myFunction() {
var x = document.getElementById("number1").value;
var y = document.getElementById("number2").value;