From 2a0f3afe20d5b6eaae9eed4d01393a70fa2abc39 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 1 May 2021 19:12:40 +0100 Subject: fix < and > in pre --- ...inning-up-my-own-authoritative-dns-servers.html | 50 +++++++++++----------- content/html/gemfeed/2016-11-20-methods-in-c.html | 18 ++++---- 2 files changed, 34 insertions(+), 34 deletions(-) (limited to 'content/html/gemfeed') diff --git a/content/html/gemfeed/2016-05-22-spinning-up-my-own-authoritative-dns-servers.html b/content/html/gemfeed/2016-05-22-spinning-up-my-own-authoritative-dns-servers.html index adb9c181..95f6f78f 100644 --- a/content/html/gemfeed/2016-05-22-spinning-up-my-own-authoritative-dns-servers.html +++ b/content/html/gemfeed/2016-05-22-spinning-up-my-own-authoritative-dns-servers.html @@ -30,28 +30,28 @@ li { color: #98be65; } include freebsd freebsd::ipalias { '2a01:4f8:120:30e8::14': - ensure => up, - proto => 'inet6', - preflen => '64', - interface => 're0', - aliasnum => '5', + ensure =>gt; up, + proto =>gt; 'inet6', + preflen =>gt; '64', + interface =>gt; 're0', + aliasnum =>gt; '5', } include jail::freebsd class { 'jail': - ensure => present, - jails_config => { - dns => { - '_ensure' => present, - '_type' => 'freebsd', - '_mirror' => 'ftp://ftp.de.freebsd.org', - '_remote_path' => 'FreeBSD/releases/amd64/10.1-RELEASE', - '_dists' => [ 'base.txz', 'doc.txz', ], - '_ensure_directories' => [ '/opt', '/opt/enc' ], - 'host.hostname' => "'dns.ian.buetow.org'", - 'ip4.addr' => '192.168.0.15', - 'ip6.addr' => '2a01:4f8:120:30e8::15', + ensure =>gt; present, + jails_config =>gt; { + dns =>gt; { + '_ensure' =>gt; present, + '_type' =>gt; 'freebsd', + '_mirror' =>gt; 'ftp://ftp.de.freebsd.org', + '_remote_path' =>gt; 'FreeBSD/releases/amd64/10.1-RELEASE', + '_dists' =>gt; [ 'base.txz', 'doc.txz', ], + '_ensure_directories' =>gt; [ '/opt', '/opt/enc' ], + 'host.hostname' =>gt; "'dns.ian.buetow.org'", + 'ip4.addr' =>gt; '192.168.0.15', + 'ip6.addr' =>gt; '2a01:4f8:120:30e8::15', }, . . @@ -65,8 +65,8 @@ class { 'jail': . . # dns.ian.buetow.org -rdr pass on re0 proto tcp from any to $pub_ip port {53} -> 192.168.0.15 -rdr pass on re0 proto udp from any to $pub_ip port {53} -> 192.168.0.15 +rdr pass on re0 proto tcp from any to $pub_ip port {53} ->gt; 192.168.0.15 +rdr pass on re0 proto udp from any to $pub_ip port {53} ->gt; 192.168.0.15 pass in on re0 inet6 proto tcp from any to 2a01:4f8:120:30e8::15 port {53} flags S/SA keep state pass in on re0 inet6 proto udp from any to 2a01:4f8:120:30e8::15 port {53} flags S/SA keep state . @@ -76,8 +76,8 @@ pass in on re0 inet6 proto udp from any to 2a01:4f8:120:30e8::15 port {53} flags

In "manifests/dns.pp" (the Puppet manifest for the Master DNS Jail itself) I configured the BIND DNS server this way:

 class { 'bind_freebsd':
-  config         => "puppet:///files/bind/named.${::hostname}.conf",
-  dynamic_config => "puppet:///files/bind/dynamic.${::hostname}",
+  config         =>gt; "puppet:///files/bind/named.${::hostname}.conf",
+  dynamic_config =>gt; "puppet:///files/bind/dynamic.${::hostname}",
 }
 

The Puppet module is actually a pretty simple one. It installs the file "/usr/local/etc/namerd/named.conf" and it populates the "/usr/local/etc/named/dynamicdb" directory with all my zone files.

@@ -142,10 +142,10 @@ zone "buetow.zone" {

The end result looks like this now:

 % dig -t ns buetow.org
-; <<>> DiG 9.10.3-P4-RedHat-9.10.3-12.P4.fc23 <<>> -t ns buetow.org
+; gt;>gt; DiG 9.10.3-P4-RedHat-9.10.3-12.P4.fc23 gt;>gt; -t ns buetow.org
 ;; global options: +cmd
 ;; Got answer:
-;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37883
+;; ->gt;>gt;HEADER> DiG 9.10.3-P4-RedHat-9.10.3-12.P4.fc23 <<>> -t any buetow.org @dns1.buetow.org
+; gt;>gt; DiG 9.10.3-P4-RedHat-9.10.3-12.P4.fc23 gt;>gt; -t any buetow.org @dns1.buetow.org
 ;; global options: +cmd
 ;; Got answer:
-;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 49876
+;; ->gt;>gt;HEADERExample
 

Lets have a look at the following sample program. Basically all you have to do is to add a function pointer such as "calculate" to the definition of struct "something_s". Later, during the struct initialization, assign a function address to that function pointer:

-#include 
+#include gt;
 
 typedef struct {
     double (*calculate)(const double, const double);
@@ -53,26 +53,26 @@ int main(void) {
 
     const double a = 3, b = 2;
 
-    printf("%s(%f, %f) => %f\n", mult.name, a, b, mult.calculate(a,b));
-    printf("%s(%f, %f) => %f\n", div.name, a, b, div.calculate(a,b));
+    printf("%s(%f, %f) =>gt; %f\n", mult.name, a, b, mult.calculate(a,b));
+    printf("%s(%f, %f) =>gt; %f\n", div.name, a, b, div.calculate(a,b));
 }
 

As you can see you can call the function (pointed by the function pointer) the same way as in C++ or Java via:

-printf("%s(%f, %f) => %f\n", mult.name, a, b, mult.calculate(a,b));
-printf("%s(%f, %f) => %f\n", div.name, a, b, div.calculate(a,b));
+printf("%s(%f, %f) =>gt; %f\n", mult.name, a, b, mult.calculate(a,b));
+printf("%s(%f, %f) =>gt; %f\n", div.name, a, b, div.calculate(a,b));
 

However, that's just syntactic sugar for:

-printf("%s(%f, %f) => %f\n", mult.name, a, b, (*mult.calculate)(a,b));
-printf("%s(%f, %f) => %f\n", div.name, a, b, (*div.calculate)(a,b));
+printf("%s(%f, %f) =>gt; %f\n", mult.name, a, b, (*mult.calculate)(a,b));
+printf("%s(%f, %f) =>gt; %f\n", div.name, a, b, (*div.calculate)(a,b));
 

Output:

 pbuetow ~/git/blog/source [38268]% gcc methods-in-c.c -o methods-in-c
 pbuetow ~/git/blog/source [38269]% ./methods-in-c
-Multiplication(3.000000, 2.000000) => 6.000000
-Division(3.000000, 2.000000) => 1.500000
+Multiplication(3.000000, 2.000000) =>gt; 6.000000
+Division(3.000000, 2.000000) =>gt; 1.500000
 

Not complicated at all, but nice to know and helps to make the code easier to read!

Taking it further

-- cgit v1.2.3