<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.7.3">Jekyll</generator><link href="http://log.48k.io/feed.xml" rel="self" type="application/atom+xml" /><link href="http://log.48k.io/" rel="alternate" type="text/html" /><updated>2018-04-01T21:06:55+00:00</updated><id>http://log.48k.io/</id><title type="html">&amp;gt; /dev/null 2&amp;gt;&amp;amp;1</title><subtitle>48k, Dtrace, Hadoop, Mesos, Spark, Erlang, JVM, node.js, PHP, Python, porting software, Ansible, Puppet, Capistrano, Habitat, Poudriere, Packer, terraform, FreeBSD, illumos, OmniOS, Unix, scaling databases, AWS, Google Cloud, OpenStack, Rackspace, ZFS, bhyve KVM, Xen
</subtitle><entry><title type="html">FreeBSD debug rc.d script</title><link href="http://log.48k.io/2018/03/31/freebsd-debug-rc-script.html" rel="alternate" type="text/html" title="FreeBSD debug rc.d script" /><published>2018-03-31T10:05:00+00:00</published><updated>2018-03-31T10:05:00+00:00</updated><id>http://log.48k.io/2018/03/31/freebsd-debug-rc-script</id><content type="html" xml:base="http://log.48k.io/2018/03/31/freebsd-debug-rc-script.html">&lt;p&gt;Debugging rc.d scripts can be… always remember to set&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;sysrc &lt;span class=&quot;nv&quot;&gt;rc_debug&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;YES&quot;&lt;/span&gt;
sysrc &lt;span class=&quot;nv&quot;&gt;rc_info&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;YES&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;or set &lt;strong&gt;-x&lt;/strong&gt; flag in rc script&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'%s\n'&lt;/span&gt; 1a &lt;span class=&quot;s1&quot;&gt;'set -x'&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; w | ed &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; /etc/rc.d/serviceScriptName&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content><author><name></name></author></entry><entry><title type="html">Fedora kernel lock</title><link href="http://log.48k.io/2018/03/25/fedora-kernel-lock.html" rel="alternate" type="text/html" title="Fedora kernel lock" /><published>2018-03-25T13:15:00+00:00</published><updated>2018-03-25T13:15:00+00:00</updated><id>http://log.48k.io/2018/03/25/fedora-kernel-lock</id><content type="html" xml:base="http://log.48k.io/2018/03/25/fedora-kernel-lock.html">&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sed &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;s/UPDATEDEFAULT=yes/UPDATEDEFAULT=no/&quot;&lt;/span&gt; /etc/sysconfig/kernel&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content><author><name></name></author></entry><entry><title type="html">Fedora searching for space on /</title><link href="http://log.48k.io/2018/03/25/fedora-get-space-back.html" rel="alternate" type="text/html" title="Fedora searching for space on /" /><published>2018-03-25T13:00:00+00:00</published><updated>2018-03-25T13:00:00+00:00</updated><id>http://log.48k.io/2018/03/25/fedora-get-space-back</id><content type="html" xml:base="http://log.48k.io/2018/03/25/fedora-get-space-back.html">&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;c&quot;&gt;# let's check for journal disk space&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;journalctl &lt;span class=&quot;nt&quot;&gt;--disk-usage&lt;/span&gt;
Archived and active journals take up 11.0G &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the file system.

&lt;span class=&quot;c&quot;&gt;# time to clean up&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;journalctl &lt;span class=&quot;nt&quot;&gt;--vacuum-time&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1d
Deleted archived journal ...
Deleted archived journal ...
Deleted archived journal ...

Vacuuming &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;, freed 10.4G of archived journals from ... .&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;du &lt;span class=&quot;nt&quot;&gt;-csh&lt;/span&gt; /var/cache/PackageKit/&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; | sort &lt;span class=&quot;nt&quot;&gt;-h&lt;/span&gt;
5G      /var/cache/PackageKit/25
3.1G    /var/cache/PackageKit/26
1.2G    /var/cache/PackageKit/27
9.3G    total


&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;pkcon refresh force &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-1&lt;/span&gt;
Refreshing cache                    &lt;span class=&quot;o&quot;&gt;[=========================]&lt;/span&gt;
Loading cache                       &lt;span class=&quot;o&quot;&gt;[=========================]&lt;/span&gt;
Downloading repository information  &lt;span class=&quot;o&quot;&gt;[=========================]&lt;/span&gt;
...
...
...
Finished                            &lt;span class=&quot;o&quot;&gt;[=========================]&lt;/span&gt;


&lt;span class=&quot;c&quot;&gt;# I don't need cache from older releases...&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;rm &lt;span class=&quot;nt&quot;&gt;-rf&lt;/span&gt; /var/cache/PackageKit/25 /var/cache/PackageKit/26

&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;du &lt;span class=&quot;nt&quot;&gt;-csh&lt;/span&gt; /var/cache/PackageKit/&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; | sort &lt;span class=&quot;nt&quot;&gt;-h&lt;/span&gt;
192M    /var/cache/PackageKit/27
192M    total&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content><author><name></name></author></entry><entry><title type="html">Cleaning after doF*&amp;amp;r</title><link href="http://log.48k.io/2017/11/01/cleaning-after.html" rel="alternate" type="text/html" title="Cleaning after doF*&amp;r" /><published>2017-11-01T18:00:00+00:00</published><updated>2017-11-01T18:00:00+00:00</updated><id>http://log.48k.io/2017/11/01/cleaning-after</id><content type="html" xml:base="http://log.48k.io/2017/11/01/cleaning-after.html">&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;c&quot;&gt;# kill all running docker containers&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;docker &lt;span class=&quot;nb&quot;&gt;kill&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;$(&lt;/span&gt;docker ps &lt;span class=&quot;nt&quot;&gt;-q&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;c&quot;&gt;# remove all containers&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;docker rm &lt;span class=&quot;k&quot;&gt;$(&lt;/span&gt;docker ps &lt;span class=&quot;nt&quot;&gt;-aq&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;c&quot;&gt;# remove all images&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;docker rmi &lt;span class=&quot;k&quot;&gt;$(&lt;/span&gt;docker images &lt;span class=&quot;nt&quot;&gt;-q&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;c&quot;&gt;# remove unused volumes&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;docker volume rm &lt;span class=&quot;k&quot;&gt;$(&lt;/span&gt;docker volume &lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-qf&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;dangling&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;c&quot;&gt;# clean network interfaces&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;docker network rm &lt;span class=&quot;k&quot;&gt;$(&lt;/span&gt;docker network &lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; | awk &lt;span class=&quot;s1&quot;&gt;'$3 == &quot;bridge&quot; &amp;amp;&amp;amp; $2 != &quot;bridge&quot; { print $1 }'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content><author><name></name></author></entry><entry><title type="html">ESXi 5 and nested virtualization</title><link href="http://log.48k.io/2017/02/24/esxi-5-and-nested-virtualization.html" rel="alternate" type="text/html" title="ESXi 5 and nested virtualization" /><published>2017-02-24T10:00:00+00:00</published><updated>2017-02-24T10:00:00+00:00</updated><id>http://log.48k.io/2017/02/24/esxi-5-and-nested-virtualization</id><content type="html" xml:base="http://log.48k.io/2017/02/24/esxi-5-and-nested-virtualization.html">&lt;p&gt;Trying to use &lt;a href=&quot;https://en.wikipedia.org/wiki/Virtualization&quot;&gt;virtualization&lt;/a&gt; inside a guest OS but error pops up?&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;KVM: no hardware support&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;on a ESXi host one can easy turn on the &lt;a href=&quot;https://en.wikipedia.org/wiki/Virtualization#NESTED&quot;&gt;nested virtualization&lt;/a&gt; by editing the .vmx file&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;vim-cmd vmsvc/getallvms&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;make a note of vmID, file name and data store&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;EOF&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt; &amp;gt;&amp;gt; /vmfs/volumes/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$DATA_STORE&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$FILE_NAME&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;.vmx
vhv.enable = &quot;TRUE&quot;
&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;EOF

&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;vim-cmd vmsvc/reload &lt;span class=&quot;nv&quot;&gt;$vmID&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content><author><name></name></author></entry><entry><title type="html">MySQL reset password</title><link href="http://log.48k.io/2017/02/01/mysql-reset-password.html" rel="alternate" type="text/html" title="MySQL reset password" /><published>2017-02-01T19:00:00+00:00</published><updated>2017-02-01T19:00:00+00:00</updated><id>http://log.48k.io/2017/02/01/mysql-reset-password</id><content type="html" xml:base="http://log.48k.io/2017/02/01/mysql-reset-password.html">&lt;p&gt;Sometimes passwords are lost …, however in most cases we can find a workaround and reset the missing password.&lt;/p&gt;

&lt;p&gt;First stop MySQL service, then we can start it in background without loading &lt;a href=&quot;https://dev.mysql.com/doc/refman/5.7/en/server-options.html#option_mysqld_skip-grant-tables&quot;&gt;grant
table&lt;/a&gt;.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;mysqld_safe &lt;span class=&quot;nt&quot;&gt;--skip-grant-tables&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--skip-networking&lt;/span&gt; &amp;amp;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Now we can connect to MySQL without password …
Update root password:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;mysql &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot; &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;
  UPDATE mysql.user &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;
  SET &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;
    authentication_string = PASSWORD('new_password') &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;
  WHERE &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;
    User = 'root' &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;
  AND &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;
    Host = 'localhost' &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;
;&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;All done, time to stop current running instance and start MySQL service as normal.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;pkill mysql&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content><author><name></name></author></entry><entry><title type="html">FreeBSD ttyv0 auto login</title><link href="http://log.48k.io/2017/01/30/freebsd-ttyv0-auto-login.html" rel="alternate" type="text/html" title="FreeBSD ttyv0 auto login" /><published>2017-01-30T13:00:00+00:00</published><updated>2017-01-30T13:00:00+00:00</updated><id>http://log.48k.io/2017/01/30/freebsd-ttyv0-auto-login</id><content type="html" xml:base="http://log.48k.io/2017/01/30/freebsd-ttyv0-auto-login.html">&lt;p&gt;Sometimes there’s a need for auto login user over &lt;strong&gt;serial&lt;/strong&gt; or &lt;strong&gt;ttyv&lt;/strong&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;EOF&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt; &amp;gt;&amp;gt; /etc/gettytab
autoLogin.Pc:\
  :ht:np:sp#9600:al=USER_NAME
EOF&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; ^ttyv0 /etc/ttys
ttyv0 &lt;span class=&quot;s2&quot;&gt;&quot;/usr/libexec/getty autoLogin.Pc&quot;&lt;/span&gt;   xterm on  secure&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;&lt;a href=&quot;https://man.freebsd.org/gettytab(5)&quot;&gt;/etc/gettytab(5)&lt;/a&gt;, &lt;a href=&quot;https://man.freebsd.org/ttys(5)&quot;&gt;/etc/ttys(5)&lt;/a&gt;&lt;/p&gt;</content><author><name></name></author></entry><entry><title type="html">Ansible custom Python interpreter</title><link href="http://log.48k.io/2016/12/09/ansible_custom_python_interpreter.html" rel="alternate" type="text/html" title="Ansible custom Python interpreter" /><published>2016-12-09T10:16:00+00:00</published><updated>2016-12-09T10:16:00+00:00</updated><id>http://log.48k.io/2016/12/09/ansible_custom_python_interpreter</id><content type="html" xml:base="http://log.48k.io/2016/12/09/ansible_custom_python_interpreter.html">&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;http://docs.ansible.com/ansible/intro_inventory.html#list-of-behavioral-inventory-parameters&quot;&gt;ansible_python_interpreter&lt;/a&gt;&lt;/strong&gt; - target host python path, useful for systems with multiple Python interpreters or not located at &lt;em&gt;/usr/bin/python&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;You can change interpreter location using &lt;a href=&quot;http://docs.ansible.com/ansible/intro_inventory.html#host-variables&quot;&gt;host variables&lt;/a&gt;.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-yml&quot; data-lang=&quot;yml&quot;&gt;&lt;span class=&quot;s&quot;&gt;freebsd_host    ansible_python_interpreter=/usr/local/bin/python&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Or by &lt;a href=&quot;http://docs.ansible.com/ansible/playbooks_variables.html#hey-wait-a-yaml-gotcha&quot;&gt;playbook variables&lt;/a&gt;.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-yml&quot; data-lang=&quot;yml&quot;&gt;&lt;span class=&quot;nn&quot;&gt;---&lt;/span&gt;
&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;main build&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;hosts&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;freebsd_host&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;vars&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;ansible_python_interpreter&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/usr/local/bin/python2&quot;&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;roles&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;common&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content><author><name></name></author></entry><entry><title type="html">FreeBSD DHCP Preferred DNS</title><link href="http://log.48k.io/2016/12/08/freebsd-dhcp-preferred-dns.html" rel="alternate" type="text/html" title="FreeBSD DHCP Preferred DNS" /><published>2016-12-08T12:00:00+00:00</published><updated>2016-12-08T12:00:00+00:00</updated><id>http://log.48k.io/2016/12/08/freebsd-dhcp-preferred-dns</id><content type="html" xml:base="http://log.48k.io/2016/12/08/freebsd-dhcp-preferred-dns.html">&lt;p&gt;When you system is configured to use DHCP.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sysrc &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; ifconfig_re0
DHCP&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;&lt;em&gt;/etc/resolv.conf&lt;/em&gt; file will be regenerated on each system boot via &lt;a href=&quot;https://github.com/freebsd/freebsd/blob/release/11.0.0/sbin/dhclient/dhclient-script#L194&quot;&gt;/sbin/dhclient-script&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;However one would prefer to use &lt;a href=&quot;https://duckduckgo.com/?q=Public+DNS+Servers&amp;amp;t=ffab&amp;amp;ia=answer&amp;amp;iax=1&quot;&gt;Public DNS Servers&lt;/a&gt; instead the ones provided by the DHCP server.&lt;/p&gt;

&lt;p&gt;According to &lt;a href=&quot;https://man.freebsd.org/dhclient-script(8)#OPERATION&quot;&gt;dhclient-script&lt;/a&gt; man page, we can change the behavior by overeating the &lt;strong&gt;add_new_resolv_conf&lt;/strong&gt; function in &lt;em&gt;/etc/dhclient-enter-hooks&lt;/em&gt; file.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;EOF&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt; &amp;gt; /etc/dhclient-enter-hooks
add_new_resolv_conf() {
       return 0
}
EOF&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Now we can safely edit &lt;em&gt;/etc/resolv.conf&lt;/em&gt; file - all changes will be persistent across system reboots.&lt;/p&gt;</content><author><name></name></author></entry><entry><title type="html">FreeBSD securelevel</title><link href="http://log.48k.io/2016/11/25/freebsd-securelevel.html" rel="alternate" type="text/html" title="FreeBSD securelevel" /><published>2016-11-25T19:00:00+00:00</published><updated>2016-11-25T19:00:00+00:00</updated><id>http://log.48k.io/2016/11/25/freebsd-securelevel</id><content type="html" xml:base="http://log.48k.io/2016/11/25/freebsd-securelevel.html">&lt;p&gt;&lt;a href=&quot;https://www.freebsd.org/doc/faq/security.html#idp60097128&quot;&gt;Securelevel&lt;/a&gt; is a security mechanism implemented in the kernel.&lt;/p&gt;

&lt;p&gt;To check current ‘secure level’:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sysctl kern.securelevel
kern.securelevel: 2&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;To change / raise ‘secure level’:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sysctl kern.securelevel&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;2&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;To enable ‘secure level’ on boot:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sysrc &lt;span class=&quot;nv&quot;&gt;kern_securelevel_enable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;YES&quot;&lt;/span&gt;
kern_securelevel_enable:  -&amp;gt; YES

&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sysrc &lt;span class=&quot;nv&quot;&gt;kern_securelevel&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;2&quot;&lt;/span&gt;
kern_securelevel:  -&amp;gt; 2&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;&lt;a href=&quot;https://man.freebsd.org/security(7)#SECURING_THE_KERNEL_CORE,_RAW_DEVICES,_AND_FILE_SYSTEMS&quot;&gt;FreeBSD security levels&lt;/a&gt;&lt;/p&gt;</content><author><name></name></author></entry></feed>