trentdocs_website/site/misc_tips_troubleshooting/index.html

341 lines
12 KiB
HTML

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="../img/favicon.ico">
<title>Misc Tips, Trouble Shooting - Trent Docs</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="../css/theme.css" type="text/css" />
<link rel="stylesheet" href="../css/theme_extra.css" type="text/css" />
<link rel="stylesheet" href="../css/highlight.css">
<script>
// Current page data
var mkdocs_page_name = "Misc Tips, Trouble Shooting";
var mkdocs_page_input_path = "misc_tips_troubleshooting.md";
var mkdocs_page_url = "/misc_tips_troubleshooting/";
</script>
<script src="../js/jquery-2.1.1.min.js"></script>
<script src="../js/modernizr-2.8.3.min.js"></script>
<script type="text/javascript" src="../js/highlight.pack.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
<div class="wy-side-nav-search">
<a href=".." class="icon icon-home"> Trent Docs</a>
<div role="search">
<form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1">
<a class="" href="..">Home</a>
</li>
<li class="toctree-l1">
<a class="" href="../apt_pinning_artful_aardvark_packages_in_xenial_xerus/">Apt Pinning Artful Aardvark Packages in Xenial Xerus</a>
</li>
<li class="toctree-l1">
<a class="" href="../lxd_container_home_server_networking_for_dummies/">LXD Container Home Server Networking For Dummies</a>
</li>
<li class="toctree-l1">
<a class="" href="../lxd_container_foo/">LXD Container Foo</a>
</li>
<li class="toctree-l1">
<a class="" href="../how_to_reassign_a_static_ip_address_with_dnsmasq/">How To Reassign A Static Ip Address with dnsmasq</a>
</li>
<li class="toctree-l1">
<a class="" href="../serve_and_share_apps_from_your_phone_with_fdroid/">Serve And Share Apps From Your Phone With Fdroid</a>
</li>
<li class="toctree-l1">
<a class="" href="../nspawn/">Nspawn</a>
</li>
<li class="toctree-l1">
<a class="" href="../gentoo_lxd_container/">Gentoo LXD Container</a>
</li>
<li class="toctree-l1">
<a class="" href="../mastodon_on_arch/">Mastodon on Arch</a>
</li>
<li class="toctree-l1">
<a class="" href="../debian_nspawn_container_on_arch_for_testing_apache_configurations/">Debian Nspawn Container On Arch For Testing Apache Configurations</a>
</li>
<li class="toctree-l1">
<a class="" href="../dynamic_cacheing_nginx_reverse_proxy_for_pacman/">Dynamic Cacheing Nginx Reverse Proxy For Pacman</a>
</li>
<li class="toctree-l1">
<a class="" href="../freebsd_jails_on_freenas/">FreeBSD Jails on FreeNAS</a>
</li>
<li class="toctree-l1">
<a class="" href="../arch_redis_nspawn/">Quick Dirty Redis Nspawn Container on Arch Linux</a>
</li>
<li class="toctree-l1">
<a class="" href="../arch_postgresql_nspawn/">Quick Dirty Postgresql Nspawn Container on Arch Linux</a>
</li>
<li class="toctree-l1 current">
<a class="current" href="./">Misc Tips, Trouble Shooting</a>
<ul class="subnav">
<li class="toctree-l2"><a href="#misc-tips-troubleshooting">Misc Tips, TroubleShooting</a></li>
<ul>
<li><a class="toctree-l3" href="#sending-commands-to-lxd-containers">Sending commands to LXD containers</a></li>
<li><a class="toctree-l3" href="#move-lxd-container-to-another-server">Move LXD container to another Server</a></li>
<li><a class="toctree-l3" href="#ubuntu-mate-welcome-center-doesnt-work-for-some-repos">Ubuntu-Mate-Welcome-Center doesn't work for some repos</a></li>
<li><a class="toctree-l3" href="#quitting-mosh">Quitting Mosh</a></li>
<li><a class="toctree-l3" href="#updating-caddy-server">Updating Caddy Server</a></li>
<li><a class="toctree-l3" href="#zfs-disc-error-disc-identification">ZFS Disc Error Disc Identification</a></li>
<li><a class="toctree-l3" href="#byobutmux-copy-mode">Byobu/Tmux copy mode</a></li>
</ul>
</ul>
</li>
<li class="toctree-l1">
<a class="" href="../self_signed_certs/">Self Signed Certs</a>
</li>
<li class="toctree-l1">
<a class="" href="../selfoss_on_centos7/">Selfoss on Centos7</a>
</li>
<li class="toctree-l1">
<a class="" href="../stupid_package_manager_tricks/">Stupid Package Manager Tricks</a>
</li>
<li class="toctree-l1">
<a class="" href="../stupid_kvm_tricks/">Stupid KVM Tricks</a>
</li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="..">Trent Docs</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="..">Docs</a> &raquo;</li>
<li>Misc Tips, Trouble Shooting</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main">
<div class="section">
<h1 id="misc-tips-troubleshooting">Misc Tips, TroubleShooting</h1>
<h2 id="sending-commands-to-lxd-containers">Sending commands to LXD containers</h2>
<p>Use <code>bash -c "&lt;command&gt;"</code> for commands with wildcards. i.e.</p>
<pre><code class="bash">for machine in $(lxc list | grep RUNNING | awk '{print $2}') ;\
do lxc exec &quot;${machine}&quot; -- bash -c &quot;cat /etc/apt/apt.conf.d/02*&quot; ; done
</code></pre>
<p>fish shell is actually a little bit cleaner</p>
<pre><code class="fish">for machine in (lxc list | grep RUNNING | awk '{print $2}') ; \
lxc exec $machine -- bash -c &quot;cat /etc/apt/apt.conf.d/02*&quot; ; end
</code></pre>
<pre><code class="fish"># change all their time zones
for machine in (lxc list | grep RUNNING | awk '{print $2}') ; \
lxc exec $machine -- bash -c &quot;timedatectl set-timezone America/Los_Angeles&quot; ; end
# check to see if anyone is logged in before rebooting
for machine in (lxc list | grep RUNNING | awk '{print $2}') ; echo ; \
echo $machine ; lxc exec $machine -- bash -c &quot;who&quot; ; end
</code></pre>
<h2 id="move-lxd-container-to-another-server">Move LXD container to another Server</h2>
<pre><code class="bash"># stop the container
lxc stop &lt;container name&gt;
# publish image of container to local *storage*
lxc publish &lt;container name&gt; --alias &lt;image name&gt;
# export the new image to tarball
lxc image export &lt;image name&gt;
# scp tarball to other box
scp a4762b114fecee2e2bc227b9032405642c5286c02009babef7953e011e597bfe.tar.gz server:
# on other box import the image
lxc image import &lt;tarball file name&gt; --alias &lt;image name&gt;
# launch container
lxc launch &lt;image name&gt; &lt;container name&gt;
# assign profile to container
lxc profile assign &lt;container name&gt; &lt;profile name&gt;
</code></pre>
<p>Shell into the new running container, update any network interface
configurations that you need to, and then restart the container.</p>
<p>See also
<a href="../lxd_container_home_server_networking_for_dummies/">LXD Container Home Server Networking For Dummies</a></p>
<h2 id="ubuntu-mate-welcome-center-doesnt-work-for-some-repos">Ubuntu-Mate-Welcome-Center doesn't work for some repos</h2>
<p>Perhaps your apt-cacher-ng proxy server isn't configured to allow
traffic through from https sources. Make sure the following is
uncommented. This applies for all PPA's that use https.</p>
<pre><code class="conf"># /etc/apt-cacher-ng/acng.conf
PassThroughPattern: .*
</code></pre>
<h2 id="quitting-mosh">Quitting Mosh</h2>
<p>The key combination to quit mosh it <code>ctrl+6+.</code>
Also, WTF?</p>
<h2 id="updating-caddy-server">Updating Caddy Server</h2>
<p>You update Caddy Server with a new Go Binary, try to restart caddy.service, and it fails.
Maybe you get an error message such as the following <code>listen tcp :80: bind: permission denied</code> and/or
<code>listen tcp :443: bind: permission denied</code>.<br />
Fix this error with the following command <code>sudo setcap CAP_NET_BIND_SERVICE=+eip /path/to/caddy</code></p>
<h2 id="zfs-disc-error-disc-identification">ZFS Disc Error Disc Identification</h2>
<p>You created a zpool using /dev/disk-by-id to specify the devices, and now you want to figure out
which disks are causing you trouble. For instance, your system log, <code>journalctl | grep -i fail</code>
shows read error on /dev/sdc. </p>
<p>You can use <code>lsblk -o MODEL,SERIAL</code> to match the information generated by <code>zpool status</code>.</p>
<h2 id="byobutmux-copy-mode">Byobu/Tmux copy mode</h2>
<ol>
<li>
<p>Enter Copy Mode </p>
<ul>
<li>in byobu use key <code>F7</code></li>
<li>in tmux use <code>&lt;prefix&gt; [</code></li>
</ul>
</li>
<li>
<p>Navigate around less/copy buffer using <code>h,j,k,l</code></p>
</li>
<li>
<p>Select text</p>
<ul>
<li><code>&lt;space&gt;</code> begins text selection</li>
<li>move cursor around using <code>h,j,k,l</code></li>
<li><code>&lt;enter&gt;</code> ends text selection</li>
</ul>
</li>
<li>
<p>Paste selection in any tmux/byobu window</p>
<ul>
<li>in byobu use <code>alt+insert</code></li>
<li>in tmux use <code>&lt;prefix&gt; ]</code></li>
</ul>
</li>
</ol>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../self_signed_certs/" class="btn btn-neutral float-right" title="Self Signed Certs">Next <span class="icon icon-circle-arrow-right"></span></a>
<a href="../arch_postgresql_nspawn/" class="btn btn-neutral" title="Quick Dirty Postgresql Nspawn Container on Arch Linux"><span class="icon icon-circle-arrow-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<!-- Copyright etc -->
</div>
Built with <a href="http://www.mkdocs.org">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<div class="rst-versions" role="note" style="cursor: pointer">
<span class="rst-current-version" data-toggle="rst-current-version">
<span><a href="../arch_postgresql_nspawn/" style="color: #fcfcfc;">&laquo; Previous</a></span>
<span style="margin-left: 15px"><a href="../self_signed_certs/" style="color: #fcfcfc">Next &raquo;</a></span>
</span>
</div>
<script>var base_url = '..';</script>
<script src="../js/theme.js"></script>
<script src="../search/require.js"></script>
<script src="../search/search.js"></script>
</body>
</html>