Jekyll2023-09-20T14:19:15+01:00https://dave.thwaites.org.uk/feed.xmldave.thwaites.org.ukMy meandering adventures with technology.Dave ThwaitesInstalling OLA on a Raspberry Pi2020-01-04T15:30:00+00:002020-01-04T15:30:00+00:00https://dave.thwaites.org.uk/raspberrypi/ola-on-raspberrypi<p>OLA is a software framework for interfacing with various DMX protocols - see <a href="https://www.openlighting.org/ola/">openlighting.org/ola</a>. The website/wiki seems to be a bit out of date, but <a href="https://github.com/OpenLightingProject/ola">the github repository</a> is still getting (occasional?) updates.</p>
<p>The tutorial for <a href="https://www.openlighting.org/ola/tutorials/ola-on-raspberry-pi/">getting started on a Raspberry Pi</a> suggests using their pre-built Raspbian images, but they are (at least) 5 years old - plus I want to install it on an existing Raspberry Pi. The general <a href="https://www.openlighting.org/ola/linuxinstall/">Linux Install guide</a> seems to imply that you’re likely to have to build OLA from the source code - there’s a link to some notes on <a href="http://opendmx.net/index.php/OLA_Debian_/_Ubuntu">installing a pre-packaged version for Debian / Ubuntu</a>, but the repositories for Raspbian seem to be 4 or 5 years old.</p>
<p>However, after all of that, it seems that OLA is available via the standard raspbian repository (v.0.10.7 as of Jan 2020)!.. So installation is easy:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span><span class="nb">sudo </span>apt update
~ <span class="nv">$ </span><span class="nb">sudo </span>apt <span class="nb">install </span>ola
</code></pre></div></div>
<p><em>(takes about a minute!)</em><br />
This installs the software, creates a user called <code class="language-plaintext highlighter-rouge">olad</code> (added to the <code class="language-plaintext highlighter-rouge">dialout</code> and <code class="language-plaintext highlighter-rouge">plugdev</code> groups), and sets up (and starts) OLAd as an <code class="language-plaintext highlighter-rouge">init.d</code> service.</p>
<p>So, the current status of OLAd can be checked with:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span>service olad status
</code></pre></div></div>
<p>The init.d script (<code class="language-plaintext highlighter-rouge">/etc/init.d/olad</code>) runs the daemon as the user <code class="language-plaintext highlighter-rouge">olad</code>, and with <code class="language-plaintext highlighter-rouge">/etc/ola</code> as the config dir.</p>
<p>By default, the Paspberry Pi has its SPI interface disabled, so enable it in Menu -> Preferences -> Raspberry Pi Configuration -> Interfaces (reboot not necessary?). Also, the <code class="language-plaintext highlighter-rouge">olad</code> user doesn’t have access to the SPI interface, so <a href="https://www.raspberrypi.org/forums/viewtopic.php?t=106814#p736114">give permission</a> with:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span><span class="nb">grep </span>spi: /etc/group
spi:x:999:pi
~ <span class="nv">$ </span><span class="nb">sudo </span>adduser olad spi
Adding user <span class="sb">`</span>olad<span class="s1">' to group `spi'</span> ...
Adding user olad to group spi
Done.
~ <span class="nv">$ </span><span class="nb">grep </span>spi: /etc/group
spi:x:999:pi,olad
</code></pre></div></div>
<p>Then restart the daemon:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span><span class="nb">sudo </span>service olad restart
</code></pre></div></div>
<p>To make life easier, <a href="http://opendmx.net/index.php/OLA_Debian_/_Ubuntu#Configuration">give yourself permission to edit the config files</a> (they are all owned by <code class="language-plaintext highlighter-rouge">olad</code>):</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span><span class="nb">sudo </span>adduser pi olad
</code></pre></div></div>
<p>(you’ll probably need to log out and back in again for this to take effect)</p>
<p>The StageProfi plugin seems to try to lock <code class="language-plaintext highlighter-rouge">/dev/ttyUSB0</code> every 5 seconds, which generates a lot of log entries - disable the plugin by editing <code class="language-plaintext highlighter-rouge">/etc/ola/ola-stageprofi.conf</code> - change the second line to <code class="language-plaintext highlighter-rouge">enabled = false</code> then restart olad:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span><span class="nb">sudo </span>service olad restart
</code></pre></div></div>
<p>At this point you should be able to access the OLA Admin page at (something like) http://192.168.1.75:9090/</p>Dave ThwaitesNotes on how to install and set-up OLA (Open Lighting Architecture) on a Raspberry Pi.Installing and seting-up GalliumOS from scratch2019-12-17T21:10:00+00:002020-03-08T14:50:00+00:00https://dave.thwaites.org.uk/galliumos/galliumos-install-and-setup<p>Following an <code class="language-plaintext highlighter-rouge">apt upgrade</code> on GalliumOS which updated GRUB, and it would seem I <a href="https://www.reddit.com/r/GalliumOS/comments/6dxqy5/galliumos_wont_boot/">selected the wrong location to install the bootloader</a> (<em>hint:</em> next time, select <code class="language-plaintext highlighter-rouge">/dev/sda</code>, not <code class="language-plaintext highlighter-rouge">/dev/sda7</code>!..), GalliumOS now won’t boot up. Unfortunately, <a href="https://www.reddit.com/r/GalliumOS/comments/5mhjd3/acer_14_wont_boot_after_grub_update/">this guide for fixing the problem</a> didn’t work for me, so I’m re-installing GalliumOS (again), and taking notes this time on what I do to get things the way I like it, just in case I need to do it all again sometime… :-)</p>
<h2 id="galliumos">GalliumOS</h2>
<p>First up, install GalliumOS with chrx! Following the <a href="https://chrx.org/#step-by-step">chrx install guide</a> I did the following:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>crosh> shell
chronos@localhost / <span class="nv">$ </span><span class="nb">cd</span> <span class="p">;</span> curl <span class="nt">-Os</span> https://chrx.org/go <span class="o">&&</span> sh go <span class="nt">-H</span> gallium <span class="nt">-U</span> dave <span class="nt">-L</span> en_GB.UTF-8 <span class="nt">-Z</span> Europe/London
</code></pre></div></div>
<p>Which installed GalliumOS, taking about 14mins. (note: Installation log files are preserved in <code class="language-plaintext highlighter-rouge">/var/cache/chrx</code>)</p>
<h2 id="keyboard">Keyboard</h2>
<p>Once logged in to GalliumOS, update keyboard settings:</p>
<ul>
<li>Menu -> Settings -> Settings Manager -> Keyboard -> Layout</li>
<li>Set “Keyboard model” to “Chromebook Falco/Pixel/Pixel2 / Search overlay / F keys mapped to media keys” (<a href="https://wiki.galliumos.org/Media_keys_and_default_keybindings">see here for more details</a> - Right alt as overlay doesn’t work with some programmes (eg. Chromium takes the Right-Alt press as a start to keyboard navigation of the browser toolbar…))</li>
<li>Also add “English (UK)” to “Keyboard layout”, and remove “English (US)”
Note: On the initial login screen, the Keyboard layout will (always?) be “English (US)” - therefore be wary of special characters / punctuation like <code class="language-plaintext highlighter-rouge">"£@#~\|¬</code> in passwords…</li>
</ul>
<h2 id="password">Password</h2>
<p>Don’t forget to change the default password - use <code class="language-plaintext highlighter-rouge">passwd</code> in a terminal window.</p>
<h2 id="login-screen">Login Screen</h2>
<p>Add the option to <a href="https://www.reddit.com/r/GalliumOS/comments/9awzdu/keyboard_layout_on_login_screen/">change the keybaord layout on the initial login screen</a>:</p>
<ul>
<li><code class="language-plaintext highlighter-rouge">dave@gallium:~$ sudo mousepad /etc/lxdm/lxdm.conf</code></li>
<li>Scroll down to the <code class="language-plaintext highlighter-rouge">[display]</code> section</li>
<li>set <code class="language-plaintext highlighter-rouge">bottom_pane=1</code> and <code class="language-plaintext highlighter-rouge">keyboard=1</code></li>
</ul>
<h2 id="desktop-preferences">Desktop preferences</h2>
<p>Change Window Manager theme, mainly to give thicker borders on windows:</p>
<ul>
<li>Menu -> Settings -> Settings Manager -> Window Manager -> Style</li>
<li>Set “Theme” to “Daloa” or “Kokodi” - some of the others have thick borders too.</li>
<li>More details <a href="https://mxlinux.org/wiki/xfce/changing-border-size-with-xfce4-window-manager/">here</a> and <a href="https://sevkeifert.blogspot.com/2014/12/increase-window-border-size-in-xubuntu.html">here</a></li>
</ul>
<h3 id="generally-tweak-various-settings">Generally tweak various settings:</h3>
<ul>
<li>File Manager settings:
<ul>
<li>On the Display tab:
<ul>
<li>Set “Date” format to “Today at 20:21:11”</li>
</ul>
</li>
</ul>
</li>
<li>Screen Saver settings:
<ul>
<li>install missing screensaver modules with <code class="language-plaintext highlighter-rouge">sudo apt install xscreensaver-data-extra xscreensaver-gl xscreensaver-gl-extra</code></li>
<li>On the Display Modes tab:
<ul>
<li>set “Mode” to “Random Screen Saver”</li>
<li>These are the screen savers I’ve got active at the moment: Abstractile, Anemone, Atlantis, Attraction, Atunnel, BinaryRing, Blaster, BlinkBox, BlockTube, Bouboule, Boxed, BoxFit, Braid, Bumps, Cage, CCurve, Celtic, Circuit, Cityflow, CloudLife, Coral, Crackberg, Cynosure, DecayScreen, Deco, Distort, Drift, Eurption, Euler2D, Fiberlamp, Fireworkx, FlipFlop, FlipText, FluidBalls, FlyingToasts, FontGlide, Galaxy, Gears, Geodesic, GeodesicGears, GLHanoi, GLKnots, GLMatrix, GLSchool, Goop, Grav, Halftone, Hilbert, Hypertorus, IFS, IMSMap, Interaggregate, Interference, Intermomentary, Jigsaw, Julia, Kumppa, Lavalite, Loop, Maze, MetaBalls, Mountain, Pacman, Penrose, Petri, Piecewise, Pipes, SlideScreen, Slip, SplitFlap, Sproingies, Squiral, StarWars, Surfaces, Wander, Wormhole, XMatrix</li>
<li>set “Blank After” to 10 minutes</li>
<li>set “Cycle After” to 1 minute</li>
<li>set “Lock Screen After” to 1 minute</li>
</ul>
</li>
<li>On the Advanced tab:
<ul>
<li>set “Image Manipulation” to “Grab Desktop Images”</li>
<li>set “Text Manipulation” to “URL” - “http://feeds.bbci.co.uk/news/rss.xml” (according to <a href="https://linux.die.net/man/1/xscreensaver-text">the man page</a> the URL can be HTML, RSS or Atom (or plain text))</li>
</ul>
</li>
</ul>
</li>
<li>Window Manager settings:
<ul>
<li>On the Keyboard tab:
<ul>
<li>set “Toggle Fullscreen” to F4 (the fullscreen button!)</li>
<li>set “Tile window to the left” to Ctrl-Alt-[</li>
<li>set “Tile window to the right” to Ctrl-Alt-]</li>
</ul>
</li>
<li>On the Focus tab:
<ul>
<li>turn on “Automatically raise windows when they receive focus”</li>
</ul>
</li>
<li>On the Advanced tab:
<ul>
<li>turn on “Window snapping - to other windows”</li>
</ul>
</li>
</ul>
</li>
</ul>
<h2 id="power-settings">Power settings</h2>
<p>My Chromebook seems to be developing a fault on the screen/lid, so it sometimes thinks that the lid has beeb closed (and opened again) when just moving the laptop around - with the default settings, this gives several seconds of black screen, and then you see the lock screen and have to type your password in, which rapidly gets annoying…</p>
<ul>
<li>To prevent the laptop going to sleep when the lid is closed: Power Manager settings -> General -> When laptop lid is closed: set to “Switch off display”, for both On Battery and Plugged In</li>
<li>To add a keyboard shortcut for “Suspend” (aka. “Go to Sleep”): Keyboard settings -> Application Shortcuts -> Add. Set <a href="https://askubuntu.com/a/164215">the command</a> to <code class="language-plaintext highlighter-rouge">xfce4-session-logout -s</code>, then click OK, then choose a keyboard shortcut (I went for <code class="language-plaintext highlighter-rouge">Ctrl+PowerOff</code>)</li>
</ul>
<h2 id="users-bin">User’s bin</h2>
<ul>
<li>make new directory <code class="language-plaintext highlighter-rouge">~/bin</code></li>
<li>copy <code class="language-plaintext highlighter-rouge">timer.sh</code> from Moneta into <code class="language-plaintext highlighter-rouge">bin</code>
<ul>
<li>rename to <code class="language-plaintext highlighter-rouge">timer</code></li>
<li>make executable with <code class="language-plaintext highlighter-rouge">chmod a+x ~/bin/timer</code></li>
</ul>
</li>
<li>I think you’ll then need to log out and in again to see <code class="language-plaintext highlighter-rouge">/home/dave/bin</code> appear in <code class="language-plaintext highlighter-rouge">$PATH</code>…</li>
</ul>
<h2 id="timezone">Timezone</h2>
<p>Check the current timezone settings:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dave@gallium:~<span class="nv">$ </span>timedatectl
Local <span class="nb">time</span>: Fri 2019-12-20 22:13:47 UTC
Universal <span class="nb">time</span>: Fri 2019-12-20 22:13:47 UTC
RTC <span class="nb">time</span>: Fri 2019-12-20 22:13:47
Time zone: Etc/UTC <span class="o">(</span>UTC, +0000<span class="o">)</span>
System clock synchronized: <span class="nb">yes
</span>systemd-timesyncd.service active: <span class="nb">yes
</span>RTC <span class="k">in </span><span class="nb">local </span>TZ: no
dave@gallium:~<span class="nv">$ </span><span class="nb">cat</span> /etc/timezone
Etc/UTC
dave@gallium:~<span class="nv">$ </span><span class="nb">ls</span> <span class="nt">-l</span> /etc/localtime
lrwxrwxrwx 1 root root 27 Dec 17 16:41 /etc/localtime -> /usr/share/zoneinfo/Etc/UTC
</code></pre></div></div>
<p><a href="https://www.tecmint.com/set-time-timezone-and-synchronize-time-using-timedatectl-command/">Set timezone</a> to Europe/London:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dave@gallium:~<span class="nv">$ </span>timedatectl set-timezone <span class="s2">"Europe/London"</span>
</code></pre></div></div>
<p>(or you can do it graphically - see below)</p>
<p>Check the new settings:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dave@gallium:~<span class="nv">$ </span>timedatectl
Local <span class="nb">time</span>: Fri 2019-12-20 22:16:48 GMT
Universal <span class="nb">time</span>: Fri 2019-12-20 22:16:48 UTC
RTC <span class="nb">time</span>: Fri 2019-12-20 22:16:48
Time zone: Europe/London <span class="o">(</span>GMT, +0000<span class="o">)</span>
System clock synchronized: <span class="nb">yes
</span>systemd-timesyncd.service active: <span class="nb">yes
</span>RTC <span class="k">in </span><span class="nb">local </span>TZ: no
dave@gallium:~<span class="nv">$ </span><span class="nb">cat</span> /etc/timezone
Europe/London
dave@gallium:~<span class="nv">$ </span><span class="nb">ls</span> <span class="nt">-l</span> /etc/localtime
lrwxrwxrwx 1 root root 35 Dec 20 22:16 /etc/localtime -> ../usr/share/zoneinfo/Europe/London
</code></pre></div></div>
<h2 id="clock-settings">Clock settings</h2>
<ul>
<li>Right-click on the clock, then choose Properites</li>
<li>Change Clock Options - Format to Custom Format</li>
<li><a href="https://docs.xfce.org/xfce/xfce4-panel/4.12/clock#label_and_tooltip_markup">Set the format</a> to <code class="language-plaintext highlighter-rouge">%-l:%M:%S %P</code> (or whatever…)</li>
</ul>
<p>If you haven’t set the timezone yet, you can do it by clicking on “Time and Date Settings…” (or Menu->Settings->Time and Date):</p>
<ul>
<li>Click “Unlock”</li>
<li>Click on the Time zone at the top</li>
<li>Click on London in the map, or pick “Europe/London” from the drop-down menu</li>
</ul>
<p>Note: The Time and Date Settings window shows Configuration as Manual, and if you try to change it to “Keep synchronised with Internet servers” it complains that “NTP support is not installed”. However timedatectl reports that <code class="language-plaintext highlighter-rouge">systemd-timesyncd.service active: yes</code>… Not sure what’s going on there…</p>
<h2 id="install-ntpd">Install NTPd</h2>
<p>As mentioned above, the Time and Date Settings window seems to think that the time configuation is manual, even with <code class="language-plaintext highlighter-rouge">timedatectl set-ntp on</code>. This seems to be similar to <a href="https://www.reddit.com/r/GalliumOS/comments/cx9b2n/time_server_ntp_support_is_not_installed/">the issue here</a>, although it’s maybe not described very well… Following the suggestion(s) there don’t seem to help (ie. time <strong>is</strong> synchronised by systemd-timesyncd, but the Time and Date Settings window doesn’t know it…).</p>
<p><a href="https://vitux.com/how-to-install-ntp-server-and-client-on-ubuntu/">Installing NTPd</a> (and turning off <code class="language-plaintext highlighter-rouge">timedatectl set-ntp</code>) seems to make Time and Date Settings happier!:</p>
<ul>
<li>Install the NTP daemon:
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dave@gallium:~<span class="nv">$ </span><span class="nb">sudo </span>apt update
dave@gallium:~<span class="nv">$ </span><span class="nb">sudo </span>apt <span class="nb">install </span>ntp
</code></pre></div> </div>
</li>
<li>Confirm it’s installed:
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dave@gallium:~<span class="nv">$ </span>sntp <span class="nt">--version</span>
sntp 4.2.8p10@1.3728-o <span class="o">(</span>1<span class="o">)</span>
</code></pre></div> </div>
</li>
<li>Update the config file:
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dave@gallium:~<span class="nv">$ </span><span class="nb">sudo </span>mousepad /etc/ntp.conf
</code></pre></div> </div>
<ul>
<li>Look for the details for nearest NTP Server pool here: https://support.ntp.org/bin/view/Servers/NTPPoolServers.</li>
<li>Fill out the details in the <code class="language-plaintext highlighter-rouge">ntp.conf</code> file - note, the support.ntp.org website suggests that the config file lines should be something like <code class="language-plaintext highlighter-rouge">server 0.uk.pool.ntp.org</code>, but the version of ntp I have installed <a href="https://www.freebsd.org/cgi/man.cgi?query=ntp.conf&sektion=5&manpath=freebsd-release-ports">seems to use</a> <code class="language-plaintext highlighter-rouge">pool 0.uk.pool.ntp.org iburst</code>.</li>
<li>Save <code class="language-plaintext highlighter-rouge">ntp.conf</code> when you’re done!</li>
</ul>
</li>
<li>Re-start the NTP server:
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dave@gallium:~<span class="nv">$ </span><span class="nb">sudo </span>service ntp restart
</code></pre></div> </div>
</li>
<li>And check that it’s running, if you want:
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dave@gallium:~<span class="nv">$ </span><span class="nb">sudo </span>service ntp status
</code></pre></div> </div>
</li>
<li>Turn off the systemd-timesyncd service:
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dave@gallium:~<span class="nv">$ </span><span class="nb">sudo </span>timedatectl set-ntp off
</code></pre></div> </div>
</li>
<li>Check if the local clock is synchronized with an NTP server:
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dave@gallium:~<span class="nv">$ </span>ntpdate <span class="nt">-qu</span> 0.uk.pool.ntp.org
</code></pre></div> </div>
</li>
<li>View the Time Synchronization Queue:
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dave@gallium:~<span class="nv">$ </span>ntpq <span class="nt">-p</span>
</code></pre></div> </div>
</li>
</ul>
<p>Now the Time and Date Settings window should show the Configuration as “Keep synchronised with Internet servers”! :-)</p>
<h2 id="remove-appgrid">Remove AppGrid</h2>
<p><a href="https://dave.thwaites.org.uk/galliumos/remove-apt-repository.html">Remove the AppGrid ppa repository</a>:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dave@gallium:~<span class="nv">$ </span><span class="nb">sudo rm</span> <span class="nt">-i</span> /etc/apt/sources.list.d/appgrid<span class="k">*</span>
dave@gallium:~<span class="nv">$ </span><span class="nb">sudo </span>apt update
</code></pre></div></div>
<p>I’ve also removed AppGrid, as I don’t use it, and I hope this might prevent the repository from reappearing…</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dave@gallium:~<span class="nv">$ </span><span class="nb">sudo </span>apt remove appgrid
dave@gallium:~<span class="nv">$ </span><span class="nb">sudo </span>apt autoremove
</code></pre></div></div>
<h2 id="install-additional-software">Install additional software</h2>
<h3 id="libre-office"><a href="https://www.libreoffice.org/">Libre Office</a></h3>
<ul>
<li>The main Gallium/Ubuntu repositories only have an older version available (v.6.0.7, as of time of writing) - a more up-to-date version (v.6.3.4) can be found at <a href="https://launchpad.net/~libreoffice/+archive/ubuntu/ppa">ppa:libreoffice/ppa</a></li>
<li>Add the repository:
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dave@gallium:~<span class="nv">$ </span><span class="nb">sudo </span>add-apt-repository ppa:libreoffice/ppa
</code></pre></div> </div>
</li>
<li>Install:
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dave@gallium:~<span class="nv">$ </span><span class="nb">sudo </span>apt <span class="nb">install </span>libreoffice
</code></pre></div> </div>
<p><em>(took a couple of minutes)</em></p>
</li>
</ul>
<h3 id="realvnc-viewer"><a href="https://www.realvnc.com/en/">RealVNC Viewer</a></h3>
<ul>
<li>Doesn’t seem to be available via apt repositories, so download and install from the website:</li>
<li>Download the Linux / DEB x64 version of the viewer from <a href="https://www.realvnc.com/en/connect/download/viewer/">the RealVNC website</a></li>
<li>Open the Downloads folder, right-click on the VNC-Viewer .deb file, and choose “Open With “GDebi Package Installer””</li>
<li>Click on “Install Package”</li>
<li>If that doesn’t seem to work, <a href="https://www.addictivetips.com/ubuntu-linux-tips/realvnc-on-linux/">try in a terminal instead</a>:
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dave@gallium:~<span class="nv">$ </span><span class="nb">cd</span> ~/Downloads
dave@gallium:~/Downloads<span class="nv">$ </span><span class="nb">sudo </span>dpkg <span class="nt">-i</span> VNC-Viewer-<span class="k">*</span><span class="nt">-Linux-x64</span>.deb
dave@gallium:~/Downloads<span class="nv">$ </span><span class="nb">sudo </span>apt <span class="nb">install</span> <span class="nt">-f</span>
</code></pre></div> </div>
<p>(the last line <a href="https://askubuntu.com/a/1039353">attempts to fix any broken dependancies</a>)</p>
</li>
<li>Open up VNC Viewer (in Menu->Internet) - sign in (needs Authy for an authentication code)</li>
</ul>
<h3 id="remmina"><a href="https://remmina.org/">Remmina</a></h3>
<ul>
<li>Following the <a href="https://remmina.org/how-to-install-remmina/#ubuntu">official instructions for Ubuntu</a>:
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dave@gallium:~<span class="nv">$ </span><span class="nb">sudo </span>apt-add-repository ppa:remmina-ppa-team/remmina-next
dave@gallium:~<span class="nv">$ </span><span class="nb">sudo </span>apt update
dave@gallium:~<span class="nv">$ </span><span class="nb">sudo </span>apt <span class="nb">install </span>remmina remmina-plugin-rdp remmina-plugin-secret
</code></pre></div> </div>
<p><em>(install took about 40s)</em><br />
(I’m not sure how essential the <code class="language-plaintext highlighter-rouge">sudo apt update</code> is - it looks like <code class="language-plaintext highlighter-rouge">apt-add-repository</code> does it too)</p>
</li>
</ul>
<h3 id="lxfree-for-java"><a href="https://www.claudeheintzdesign.com/lx/lxfree_about.html">LXFree for Java</a></h3>
<ul>
<li>Download the Linux 64bit dpkg from <a href="https://www.claudeheintzdesign.com/lx/lxfreejava_download.html">the downloads page</a></li>
<li>Then, in a terminal:
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dave@gallium:~<span class="nv">$ </span><span class="nb">cd</span> ~/Downloads
dave@gallium:~/Downloads<span class="nv">$ </span><span class="nb">sudo </span>dpkg <span class="nt">-i</span> lxfreeforjava_x64.deb
dave@gallium:~/Downloads<span class="nv">$ </span><span class="nb">sudo </span>apt <span class="nb">install</span> <span class="nt">-f</span>
</code></pre></div> </div>
<p>(LXFree for Java appears in the Menu->Other)</p>
</li>
</ul>
<h3 id="dropbox"><a href="https://www.dropbox.com/">Dropbox</a></h3>
<ul>
<li>Download the “Ubuntu 14.04 or higher (.deb) - 64-bit” file from <a href="https://www.dropbox.com/install">the installation page</a> - this installs a helper application, which in turn installs the main application!..</li>
<li>Then, in a terminal:
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dave@gallium:~<span class="nv">$ </span><span class="nb">cd</span> ~/Downloads
dave@gallium:~/Downloads<span class="nv">$ </span><span class="nb">sudo </span>dpkg <span class="nt">-i</span> dropbox_<span class="k">*</span>_amd64.deb
dave@gallium:~/Downloads<span class="nv">$ </span><span class="nb">sudo </span>apt <span class="nb">install</span> <span class="nt">-f</span>
dave@gallium:~/Downloads<span class="nv">$ </span><span class="nb">sudo </span>apt <span class="nb">install </span>python3-gpg
</code></pre></div> </div>
<p>(note: python3-gpg was needed for the helper app to verify signatures)<br />
(Dropbox appears in the Menu->Internet)<br />
Run the helper app to install the main application, then sign in to your Dropbox account when prompted.</p>
</li>
</ul>
<h3 id="qdirstat"><a href="https://github.com/shundhammer/qdirstat">QDirStat</a></h3>
<ul>
<li>Install:
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dave@gallium:~<span class="nv">$ </span><span class="nb">sudo </span>apt <span class="nb">install </span>qdirstat
</code></pre></div> </div>
</li>
</ul>
<h2 id="application-menu">Application Menu</h2>
<p>Change Favourites in the application menu - something like this:</p>
<ul>
<li>GalliumOS Update <em>(System)</em></li>
<li>Synaptic Package Manager <em>(System)</em></li>
<li>Settings Mamanger <em>(Settings)</em></li>
<li>Task Manager <em>(System)</em></li>
<li>Chromium Web Browser <em>(Internet)</em></li>
<li>Mousepad <em>(Accessories)</em></li>
<li>VNC Viewer <em>(Internet)</em></li>
<li>Remmina <em>(Internet)</em></li>
<li>Calculator <em>(Accessories)</em></li>
<li>LXFree for Java <em>(Other)</em></li>
<li>LibreOffice <em>(Office)</em></li>
</ul>Dave ThwaitesNotes on what I did to (re-)install GalliumOS on my Chromebook, and what additional steps I took to do the initial setting up.How to Remove an apt Repository2019-12-02T11:50:00+00:002019-12-02T11:50:00+00:00https://dave.thwaites.org.uk/galliumos/remove-apt-repository<p>It seems that <a href="https://www.reddit.com/r/GalliumOS/comments/b8rwes/appgrip_repository_is_not_signed_on_galliumos/">AppGrid installs it’s own repository</a> (but not a GPG public key…), so running <code class="language-plaintext highlighter-rouge">sudo apt update</code> gives the following error (on GalliumOS):</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dave@chrx:~<span class="nv">$ </span><span class="nb">sudo </span>apt update
<span class="o">[</span><span class="nb">sudo</span><span class="o">]</span> password <span class="k">for </span>dave:
Hit:1 http://apt.galliumos.org bismuth InRelease
Hit:2 http://archive.canonical.com/ubuntu bionic InRelease
Hit:3 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:4 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:5 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:6 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:8 http://ppa.launchpad.net/remmina-ppa-team/remmina-next/ubuntu bionic
InRelease
Get:7 http://ppa.launchpad.net/appgrid/stable/ubuntu bionic InRelease <span class="o">[</span>15.4 kB]
Err:7 http://ppa.launchpad.net/appgrid/stable/ubuntu bionic InRelease
The following signatures couldn<span class="s1">'t be verified because the public key is not
available: NO_PUBKEY 241FE6973B765FAE
Reading package lists... Done
W: GPG error: http://ppa.launchpad.net/appgrid/stable/ubuntu bionic InRelease:
The following signatures couldn'</span>t be verified because the public key is not
available: NO_PUBKEY 241FE6973B765FAE
E: The repository <span class="s1">'http://ppa.launchpad.net/appgrid/stable/ubuntu bionic
InRelease'</span> is not signed.
N: Updating from such a repository can<span class="s1">'t be done securely, and is therefore
disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration
details.
</span></code></pre></div></div>
<p>According to <a href="https://www.reddit.com/r/GalliumOS/comments/b8rwes/appgrip_repository_is_not_signed_on_galliumos/ek02k48/">this reply on Reddit</a>, “You can safely remove the ppa.launchpad.net entry from your APT config” - but it doesn’t say how!</p>
<p>This is a single-line shell command which will list all of the current apt repositories, <a href="https://askubuntu.com/a/741948">found on askubuntu</a>:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dave@chrx:~<span class="nv">$ </span><span class="nb">grep</span> <span class="nt">-r</span> <span class="nt">--include</span> <span class="s1">'*.list'</span> <span class="s1">'^deb '</span> /etc/apt/ | <span class="nb">sed</span> <span class="nt">-re</span> <span class="s1">'s/^\/etc\/apt\/sources\.list((\.d\/)?|(:)?)//'</span> <span class="nt">-e</span> <span class="s1">'s/(.*\.list):/\[\1\] /'</span> <span class="nt">-e</span> <span class="s1">'s/deb http:\/\/ppa.launchpad.net\/(.*?)\/ubuntu .*/ppa:\1/'</span>
deb http://archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu bionic partner
<span class="o">[</span>remmina-ppa-team-ubuntu-remmina-next-bionic.list] ppa:remmina-ppa-team/remmina-next
<span class="o">[</span>appgrid-stable.list] ppa:appgrid/stable
<span class="o">[</span>galliumos.list] deb http://apt.galliumos.org bismuth main
</code></pre></div></div>
<p>As for acutally removing the ppa, several of the <a href="https://askubuntu.com/questions/307/how-can-ppas-be-removed">answers to the question on askubuntu</a> didn’t work for me - specifically:</p>
<ul>
<li><code class="language-plaintext highlighter-rouge">sudo ppa-purge -o appgrid</code> (and <code class="language-plaintext highlighter-rouge">sudo ppa-purge -o appgrid -p stable</code>) failed, complaining that <code class="language-plaintext highlighter-rouge">E: The repository 'http://ppa.launchpad.net/appgrid/stable/ubuntu bionic InRelease' is not signed.</code></li>
<li><code class="language-plaintext highlighter-rouge">sudo add-apt-repository --remove ppa:appgrid/stable</code> looked like it might’ve worked, but <code class="language-plaintext highlighter-rouge">ppa:appgrid/stable</code> still appeared in the list of repositories given with the command above.</li>
</ul>
<p>So in the end, I resorted to just deleting the relevant files from <code class="language-plaintext highlighter-rouge">/etc/apt/sources.list.d/</code>:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dave@chrx:~<span class="nv">$ </span><span class="nb">ls</span> /etc/apt/sources.list.d
appgrid-stable.list galliumos.list
appgrid-stable.list.save galliumos.list.save
appgrid-ubuntu-stable-bionic.list remmina-ppa-team-ubuntu-remmina-next-bionic.list
appgrid-ubuntu-stable-bionic.list.save remmina-ppa-team-ubuntu-remmina-next-bionic.list.save
dave@chrx:~<span class="nv">$ </span><span class="nb">sudo rm</span> <span class="nt">-i</span> /etc/apt/sources.list.d/appgrid<span class="k">*</span>
<span class="nb">rm</span>: remove regular file <span class="s1">'/etc/apt/sources.list.d/appgrid-stable.list'</span>? y
<span class="nb">rm</span>: remove regular file <span class="s1">'/etc/apt/sources.list.d/appgrid-stable.list.save'</span>? y
<span class="nb">rm</span>: remove regular empty file <span class="s1">'/etc/apt/sources.list.d/appgrid-ubuntu-stable-bionic.list'</span>? y
<span class="nb">rm</span>: remove regular empty file <span class="s1">'/etc/apt/sources.list.d/appgrid-ubuntu-stable-bionic.list.save'</span>? y
dave@chrx:~<span class="nv">$ </span><span class="nb">grep</span> <span class="nt">-r</span> <span class="nt">--include</span> <span class="s1">'*.list'</span> <span class="s1">'^deb '</span> /etc/apt/ | <span class="nb">sed</span> <span class="nt">-re</span> <span class="s1">'s/^\/etc\/apt\/sources\.list((\.d\/)?|(:)?)//'</span> <span class="nt">-e</span> <span class="s1">'s/(.*\.list):/\[\1\] /'</span> <span class="nt">-e</span> <span class="s1">'s/deb http:\/\/ppa.launchpad.net\/(.*?)\/ubuntu .*/ppa:\1/'</span>
deb http://archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu bionic partner
<span class="o">[</span>remmina-ppa-team-ubuntu-remmina-next-bionic.list] ppa:remmina-ppa-team/remmina-next
<span class="o">[</span>galliumos.list] deb http://apt.galliumos.org bismuth main
dave@chrx:~<span class="nv">$ </span><span class="nb">sudo </span>apt update
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:4 http://apt.galliumos.org bismuth InRelease
Hit:5 http://ppa.launchpad.net/remmina-ppa-team/remmina-next/ubuntu bionic InRelease
Hit:6 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:7 http://archive.canonical.com/ubuntu bionic InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
44 packages can be upgraded. Run <span class="s1">'apt list --upgradable'</span> to see them.
</code></pre></div></div>
<p>Which seems to have worked, so far!..</p>Dave ThwaitesNotes on how to remove a repository from apt's lists, on LinuxShow Keyboard Layout Options on Login Screen2019-10-26T22:00:00+01:002019-10-26T22:00:00+01:00https://dave.thwaites.org.uk/galliumos/Keyboard-layout-on-login-screenDave ThwaitesA Reddit post about how to enable keyboard layout options when logging-in with LXDM on Linux (specifically on GalliumOS)Rename a User on Linux2019-09-25T20:30:00+01:002019-09-25T20:30:00+01:00https://dave.thwaites.org.uk/galliumos/galliumos-rename-user<p>It seems renaming a user on Linux isn’t quite a trivial affair! So, following guides found <a href="https://www.reddit.com/r/GalliumOS/comments/4ffzwh/chrx_username_change_not_working/">on Reddit</a>, and <a href="https://www.cyberciti.biz/faq/howto-change-rename-user-name-id/">on nixCraft</a> the following seemed to work for me.</p>
<hr />
<p>TL;DR: Here are the commands you need (to rename the user <code class="language-plaintext highlighter-rouge">chrx</code> to <code class="language-plaintext highlighter-rouge">dave</code>):</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span><span class="nb">sudo </span>adduser tmpuser
~ <span class="nv">$ </span><span class="nb">sudo </span>usermod <span class="nt">-a</span> <span class="nt">-G</span> <span class="nb">sudo </span>tmpuser
</code></pre></div></div>
<p>Log-out from the original user, then log in as tmpuser</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span>ps <span class="nt">-u</span> chrx
~ <span class="nv">$ </span><span class="nb">sudo </span>pkill <span class="nt">-u</span> chrx
~ <span class="nv">$ </span><span class="nb">sudo </span>pkill <span class="nt">-9</span> <span class="nt">-u</span> chrx
~ <span class="nv">$ </span>ps <span class="nt">-u</span> chrx
~ <span class="nv">$ </span><span class="nb">sudo </span>usermod <span class="nt">-l</span> dave chrx
~ <span class="nv">$ </span><span class="nb">sudo </span>groupmod <span class="nt">-n</span> dave chrx
~ <span class="nv">$ </span><span class="nb">sudo </span>usermod <span class="nt">-d</span> /home/dave <span class="nt">-m</span> dave
~ <span class="nv">$ </span><span class="nb">sudo </span>passwd dave
</code></pre></div></div>
<p>Log-out from tmpuser, then log in as the new user</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span><span class="nb">sudo </span>deluser <span class="nt">--remove-home</span> tmpuser
</code></pre></div></div>
<hr />
<p>First, create a new, temporary user, and give them sudo powers:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span><span class="nb">sudo </span>adduser tmpuser
<span class="o">[</span><span class="nb">sudo</span><span class="o">]</span> password <span class="k">for </span>chrx:
Adding user <span class="sb">`</span>tmpuser<span class="s1">' ...
Adding new group `tmpuser'</span> <span class="o">(</span>1001<span class="o">)</span> ...
Adding new user <span class="sb">`</span>tmpuser<span class="s1">' (1001) with group `tmpuser'</span> ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information <span class="k">for </span>tmpuser
Enter the new value, or press ENTER <span class="k">for </span>the default
Full Name <span class="o">[]</span>:
Room Number <span class="o">[]</span>:
Work Phone <span class="o">[]</span>:
Home Phone <span class="o">[]</span>:
Other <span class="o">[]</span>:
Is the information correct? <span class="o">[</span>Y/n] y
~ <span class="nv">$ </span><span class="nb">sudo </span>usermod <span class="nt">-a</span> <span class="nt">-G</span> <span class="nb">sudo </span>tmpuser
</code></pre></div></div>
<p>Then log-out from the original user, and log in as the temporary user <code class="language-plaintext highlighter-rouge">tmpuser</code>. First up, it’s probably worth checking the set-up for the original user (<code class="language-plaintext highlighter-rouge">chrx</code>):</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span><span class="nb">id </span>chrx
<span class="nv">uid</span><span class="o">=</span>1000<span class="o">(</span>chrx<span class="o">)</span> <span class="nv">gid</span><span class="o">=</span>1000<span class="o">(</span>chrx<span class="o">)</span> <span class="nb">groups</span><span class="o">=</span>1000<span class="o">(</span>chrx<span class="o">)</span>,4<span class="o">(</span>adm<span class="o">)</span>,24<span class="o">(</span>cdrom<span class="o">)</span>,27<span class="o">(</span><span class="nb">sudo</span><span class="o">)</span>,30<span class="o">(</span>dip<span class="o">)</span>,46<span class="o">(</span>plugdev<span class="o">)</span>,116<span class="o">(</span>lpadmin<span class="o">)</span>
~ <span class="nv">$ </span><span class="nb">grep</span> <span class="s1">'^chrx:'</span> /etc/passwd
chrx:x:1000:1000::/home/chrx:/bin/bash
~ <span class="nv">$ </span><span class="nb">grep</span> <span class="s1">'chrx'</span> /etc/group
adm:x:4:syslog,chrx
cdrom:x:24:chrx
<span class="nb">sudo</span>:x:27:chrx,tmpuser
dip:x:30:chrx
plugdev:x:46:chrx
lpadmin:x:116:chrx
chrx:x:1000:
~ <span class="nv">$ </span><span class="nb">groups </span>chrx
chrx : chrx adm cdrom <span class="nb">sudo </span>dip plugdev lpadmin
~ <span class="nv">$ </span><span class="nb">ls</span> <span class="nt">-ld</span> /home/chrx
drwxr-xr-x 16 chrx chrx 4096 Sep 24 18:43 /home/chrx
</code></pre></div></div>
<p>Confirm that the original user <code class="language-plaintext highlighter-rouge">chrx</code> doesn’t have any running processes:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span>ps aux | <span class="nb">grep </span>chrx
tmpuser 1411 0.0 0.0 23564 1080 pts/0 S+ 18:46 0:00 <span class="nb">grep</span> <span class="nt">--color</span><span class="o">=</span>auto chrx
~ <span class="nv">$ </span>ps <span class="nt">-u</span> chrx
PID TTY TIME CMD
</code></pre></div></div>
<p>If there are some, stop them with:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span><span class="nb">sudo </span>pkill <span class="nt">-u</span> chrx
~ <span class="nv">$ </span><span class="nb">sudo </span>pkill <span class="nt">-9</span> <span class="nt">-u</span> chrx
~ <span class="nv">$ </span>ps <span class="nt">-u</span> chrx
PID TTY TIME CMD
</code></pre></div></div>
<p>Use <code class="language-plaintext highlighter-rouge">usermod</code> to rename the user <code class="language-plaintext highlighter-rouge">chrx</code> to <code class="language-plaintext highlighter-rouge">dave</code>:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span><span class="nb">sudo </span>usermod <span class="nt">-l</span> dave chrx
<span class="o">[</span><span class="nb">sudo</span><span class="o">]</span> password <span class="k">for </span>tmpuser:
</code></pre></div></div>
<p>If you want to check that that’s worked:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span><span class="nb">id </span>chrx
<span class="nb">id</span>: ‘chrx’: no such user
~ <span class="nv">$ </span><span class="nb">id </span>dave
<span class="nv">uid</span><span class="o">=</span>1000<span class="o">(</span>dave<span class="o">)</span> <span class="nv">gid</span><span class="o">=</span>1000<span class="o">(</span>chrx<span class="o">)</span> <span class="nb">groups</span><span class="o">=</span>1000<span class="o">(</span>chrx<span class="o">)</span>,4<span class="o">(</span>adm<span class="o">)</span>,24<span class="o">(</span>cdrom<span class="o">)</span>,27<span class="o">(</span><span class="nb">sudo</span><span class="o">)</span>,30<span class="o">(</span>dip<span class="o">)</span>,46<span class="o">(</span>plugdev<span class="o">)</span>,116<span class="o">(</span>lpadmin<span class="o">)</span>
~ <span class="nv">$ </span><span class="nb">ls</span> <span class="nt">-ld</span> /home/chrx
drwxr-xr-x 16 dave chrx 4096 Sep 24 18:43 /home/chrx
</code></pre></div></div>
<p>Next, use <code class="language-plaintext highlighter-rouge">groupmod</code> to rename the group <code class="language-plaintext highlighter-rouge">chrx</code> to <code class="language-plaintext highlighter-rouge">dave</code>:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span><span class="nb">sudo </span>groupmod <span class="nt">-n</span> dave chrx
~ <span class="nv">$ </span><span class="nb">id </span>dave
<span class="nv">uid</span><span class="o">=</span>1000<span class="o">(</span>dave<span class="o">)</span> <span class="nv">gid</span><span class="o">=</span>1000<span class="o">(</span>dave<span class="o">)</span> <span class="nb">groups</span><span class="o">=</span>1000<span class="o">(</span>dave<span class="o">)</span>,4<span class="o">(</span>adm<span class="o">)</span>,24<span class="o">(</span>cdrom<span class="o">)</span>,27<span class="o">(</span><span class="nb">sudo</span><span class="o">)</span>,30<span class="o">(</span>dip<span class="o">)</span>,46<span class="o">(</span>plugdev<span class="o">)</span>,116<span class="o">(</span>lpadmin<span class="o">)</span>
~ <span class="nv">$ </span><span class="nb">ls</span> <span class="nt">-ld</span> /home/chrx
drwxr-xr-x 16 dave dave 4096 Sep 24 18:43 /home/chrx
</code></pre></div></div>
<p>Next, use <code class="language-plaintext highlighter-rouge">usermod</code> to move <code class="language-plaintext highlighter-rouge">dave</code>’s home directory (from <code class="language-plaintext highlighter-rouge">/home/chrx</code>) to <code class="language-plaintext highlighter-rouge">/home/dave</code>:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span><span class="nb">grep</span> <span class="s1">'^dave:'</span> /etc/passwd
dave:x:1000:1000::/home/chrx:/bin/bash
~ <span class="nv">$ </span><span class="nb">sudo </span>usermod <span class="nt">-d</span> /home/dave <span class="nt">-m</span> dave
~ <span class="nv">$ </span><span class="nb">grep</span> <span class="s1">'^dave:'</span> /etc/passwd
dave:x:1000:1000::/home/dave:/bin/bash
</code></pre></div></div>
<p>Check that everything looks good:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span><span class="nb">grep</span> <span class="s1">'dave'</span> /etc/group
adm:x:4:syslog,dave
cdrom:x:24:dave
<span class="nb">sudo</span>:x:27:tmpuser,dave
dip:x:30:dave
plugdev:x:46:dave
lpadmin:x:116:dave
dave:x:1000:
~ <span class="nv">$ </span><span class="nb">grep</span> <span class="s1">'chrx'</span> /etc/group
~ <span class="nv">$ </span><span class="nb">groups </span>chrx
<span class="nb">groups</span>: ‘chrx’: no such user
~ <span class="nv">$ </span><span class="nb">groups </span>dave
dave : dave adm cdrom <span class="nb">sudo </span>dip plugdev lpadmin
~ <span class="nv">$ </span><span class="nb">ls</span> <span class="nt">-ld</span> /home/chrx
<span class="nb">ls</span>: cannot access <span class="s1">'/home/chrx'</span>: No such file or directory
~ <span class="nv">$ </span><span class="nb">ls</span> <span class="nt">-ld</span> /home/dave
drwxr-xr-x 16 dave dave 4096 Sep 24 18:43 /home/dave
</code></pre></div></div>
<p>Finally, if necessary, change the password for <code class="language-plaintext highlighter-rouge">dave</code>:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span><span class="nb">sudo </span>passwd dave
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
~ <span class="nv">$ </span>
</code></pre></div></div>
<p>Then you can log out from <code class="language-plaintext highlighter-rouge">tmpuser</code>, and log in as <code class="language-plaintext highlighter-rouge">dave</code>! Once you are happy that everything has worked, you can delete <code class="language-plaintext highlighter-rouge">tmpuser</code>:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span><span class="nb">sudo </span>deluser <span class="nt">--remove-home</span> tmpuser
Looking <span class="k">for </span>files to backup/remove ...
Removing files ...
Removing user <span class="sb">`</span>tmpuser<span class="s1">' ...
Warning: group `tmpuser'</span> has no more members.
Done.
</code></pre></div></div>
<hr />
<p>When logging in as the new user for the first time on GalliumOS, I got a pop-up message saying that the <code class="language-plaintext highlighter-rouge">Configured directory for incoming files does not exist</code>. This seems to have been covered <a href="https://askubuntu.com/questions/837977/configured-directory-for-incoming-file-does-not-exist">on AskUbuntu</a>, solving the problem either <a href="https://askubuntu.com/a/874145">with a GUI window</a> or <a href="https://askubuntu.com/a/901111">in a terminal window</a>.</p>Dave ThwaitesNotes on how to rename a user on Linux (specifically on GalliumOS)Restarting Networking on GalliumOS2019-09-15T22:00:00+01:002019-09-15T22:00:00+01:00https://dave.thwaites.org.uk/galliumos/galliumos-restart-network<p>Sometimes after waking from sleep, networking seems to fail on GalliumOS on my laptop.</p>
<p>Check status of <code class="language-plaintext highlighter-rouge">network-manager</code> with:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span>service network-manager status
</code></pre></div></div>
<p>If at the top it says <code class="language-plaintext highlighter-rouge">failed</code> in red (or, basically anything other than <code class="language-plaintext highlighter-rouge">active (running)</code> in green!) then <code class="language-plaintext highlighter-rouge">network-manager</code> needs restarting. This should do the trick:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span><span class="nb">sudo </span>service network-manager restart
</code></pre></div></div>
<p>However, restarting <code class="language-plaintext highlighter-rouge">network-manager</code> seems to (sometimes?) crash the networking applet that sits in the Notification Area. (<a href="https://bugs.launchpad.net/ubuntu/+source/network-manager-applet/+bug/1404324">See bug report</a>) If so, the network status icon will disappear from the Notificaiton Area. <code class="language-plaintext highlighter-rouge">nm-applet</code> can be restarted as follows:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span>killall nm-applet<span class="p">;</span> nm-applet & <span class="nb">disown</span>
</code></pre></div></div>
<p>(based on comment #5 on the bug report above, and <a href="https://superuser.com/a/513503">other ideas from SuperUser.com</a>)</p>Dave ThwaitesNotes on how to restart networking on GalliumOSInstalling Jekyll on a Raspberry Pi2019-03-04T10:00:00+00:002019-03-04T20:35:00+00:00https://dave.thwaites.org.uk/website/installing-jekyll<p>Mainly following (some of) the steps from <a href="https://help.github.com/en/articles/setting-up-your-github-pages-site-locally-with-jekyll">Setting up your GitHub Pages site locally with Jekyll</a>:</p>
<h2 id="install-ruby">Install Ruby</h2>
<p>Check which version of Ruby is installed:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/websites <span class="nv">$ </span>ruby <span class="nt">--version</span>
ruby 2.1.5p273 <span class="o">(</span>2014-11-13<span class="o">)</span> <span class="o">[</span>arm-linux-gnueabihf]
~/websites <span class="nv">$ </span>which ruby
/usr/bin/ruby
</code></pre></div></div>
<p>The GitHub guide above says that you need Ruby 2.1.0 or higher installed, but it seems that you need at least 2.3 to install one (or more) of the dependancies of the <code class="language-plaintext highlighter-rouge">github-pages</code> gem. The latest version which seems to be avilable via <code class="language-plaintext highlighter-rouge">apt</code> on Raspbian Jessie (as of March 2019) is 2.1.5. I was able to install 2.3.1 on my Chromebook via Crouton, but the <code class="language-plaintext highlighter-rouge">bundle install</code> command (later on) failed on <code class="language-plaintext highlighter-rouge">Installing commonmarker 0.17.13 with native extensions</code>. So in the end I installed Ruby 2.6 using <a href="https://gist.github.com/blacktm/8302741">this gist, by blacktm</a> (2.6 seems to be the <a href="https://www.ruby-lang.org/en/downloads/">latest version</a> at the moment):</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/websites <span class="nv">$ </span>wget https://gist.githubusercontent.com/blacktm/8302741/raw/installuby_rpi.sh
~/websites <span class="nv">$ </span>bash install_ruby_rpi.sh
</code></pre></div></div>
<p><em>(which took about 34 mins on my Raspberry Pi 2)</em></p>
<p>Then:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/websites <span class="nv">$ </span><span class="nb">source</span> ~/.bashrc
~/websites <span class="nv">$ </span>which ruby
/home/pi/.rbenv/shims/ruby
~/websites <span class="nv">$ </span>ruby <span class="nt">--version</span>
ruby 2.6.1p33 <span class="o">(</span>2019-01-30 revision 66950<span class="o">)</span> <span class="o">[</span>armv7l-linux-eabihf]
</code></pre></div></div>
<h2 id="install-bundler">Install Bundler</h2>
<p>Back to the <a href="https://help.github.com/en/articles/setting-up-your-github-pages-site-locally-with-jekyll#requirements">GitHub guide</a> - next step is to install <code class="language-plaintext highlighter-rouge">bundler</code>:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/websites <span class="nv">$ </span>gem <span class="nb">install </span>bundler
</code></pre></div></div>
<p><em>(took about 10s!)</em></p>
<h2 id="set-up-local-repository">Set up local repository</h2>
<p>Next we need to set up a local repository to work from - if you already have a (basic) website repository on GitHub, then:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/websites <span class="nv">$ </span>git clone https://github.com/DaveThw/davethw.github.io.git
</code></pre></div></div>
<p>If the repository doesn’t yet have a <code class="language-plaintext highlighter-rouge">Gemfile</code>, then create one in the root directory containing:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>source 'https://rubygems.org'
gem 'github-pages', group: :jekyll_plugins
</code></pre></div></div>
<h2 id="install-jekyll-and-other-dependencies">Install Jekyll and other dependencies</h2>
<p>Install Jekyll and other dependencies from the GitHub Pages gem:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/websites/davethw.github.io <span class="nv">$ </span>bundle <span class="nb">install
</span>Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...............................................
Fetching concurrent-ruby 1.1.4
Installing concurrent-ruby 1.1.4
.....
Fetching github-pages 197
Installing github-pages 197
Bundle <span class="nb">complete</span><span class="o">!</span> 1 Gemfile dependency, 85 gems now installed.
Use <span class="sb">`</span>bundle info <span class="o">[</span>gemname]<span class="sb">`</span> to see where a bundled gem is installed.
Post-install message from dnsruby:
Installing dnsruby...
For issues and <span class="nb">source </span>code: https://github.com/alexdalitz/dnsruby
For general discussion <span class="o">(</span>please tell us how you use dnsruby<span class="o">)</span>: https://groups.google.com/forum/#!forum/dnsruby
Post-install message from sass:
Ruby Sass is deprecated and will be unmaintained as of 26 March 2019.
<span class="k">*</span> If you use Sass as a command-line tool, we recommend using Dart Sass, the new
primary implementation: https://sass-lang.com/install
<span class="k">*</span> If you use Sass as a plug-in <span class="k">for </span>a Ruby web framework, we recommend using the
sassc gem: https://github.com/sass/sassc-ruby#readme
<span class="k">*</span> For more details, please refer to the Sass blog:
http://sass.logdown.com/posts/7081811
Post-install message from html-pipeline:
<span class="nt">-------------------------------------------------</span>
Thank you <span class="k">for </span>installing html-pipeline!
You must bundle Filter gem dependencies.
See html-pipeline README.md <span class="k">for </span>more details.
https://github.com/jch/html-pipeline#dependencies
<span class="nt">-------------------------------------------------</span>
</code></pre></div></div>
<p><em>(took about 19 mins)</em></p>
<h2 id="run-jekyll">Run Jekyll</h2>
<p>Now you should be able to run your Jekyll site locally with:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/websites/davethw.github.io <span class="nv">$ </span>bundle <span class="nb">exec </span>jekyll serve
</code></pre></div></div>
<p>However: this will only be available on the local computer - the Raspberry Pi in this case. If you want Jekyll to serve the webpage to other computers/mobile phones/devices on the network, <a href="https://zarino.co.uk/post/jekyll-local-network/#solution-tell-jekyll-which-hostname-to-respond-to">this post</a> told me about the <a href="https://jekyllrb.com/docs/configuration/options/#serve-command-options">Jekyll serve command options</a> - in particular, setting <code class="language-plaintext highlighter-rouge">--host 0.0.0.0</code> will serve the Jekyll site on all available IP addresses for the machine. So:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/websites/davethw.github.io <span class="nv">$ </span>bundle <span class="nb">exec </span>jekyll serve <span class="nt">--host</span> 0.0.0.0
</code></pre></div></div>
<p><del>Seems to work nicely, magic!</del></p>
<h2 id="run-jekyll-better">Run Jekyll better</h2>
<p>…Actually, it doesn’t always work totally nicely - if your Jekyll site makes use of the <code class="language-plaintext highlighter-rouge">site.url</code> variable or the <code class="language-plaintext highlighter-rouge">absolute_url</code> filter, then it’ll look weird - Jekyll is running (by default) in a development environment, so is replacing <code class="language-plaintext highlighter-rouge">site.url</code> (from _config.yml) with <host>:<port> from the command line / config file (see the <a href="https://jekyllrb.com/docs/variables/#site-variables">Jekyll docs about the site.url variable</a> and <a href="https://jekyllrb.com/docs/liquid/filters/">the absolute_url filter</a> and <a href="https://github.com/mmistakes/minimal-mistakes/issues/1588">this issue on minimal-mistakes</a>). Therefore any links using either <code class="language-plaintext highlighter-rouge">site.url</code> or <code class="language-plaintext highlighter-rouge">absolute_url</code> (including any pointing to resources like css and js files) will be targetting http(s)://0.0.0.0:4000/… - which doesn’t work from a remote device!..</p>
<p>(Note: If you try to get around this by telling Jekyll that it’s running in a production environment, then it’ll use the <code class="language-plaintext highlighter-rouge">site.url</code> value given in the _config.yml file, so your local site will link to the ‘live’ version on the internet…)</p>
<p>Therefore your options seem to be: Either to run Jekyll with something like:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/websites/davethw.github.io <span class="nv">$ </span>bundle <span class="nb">exec </span>jekyll serve <span class="nt">--host</span> 192.168.1.70
</code></pre></div></div>
<p>Or set up a ‘development’ config file, as suggested as <a href="https://github.com/mmistakes/minimal-mistakes/issues/1588#issuecomment-373937514">a solution to the issue on minimal-mistakes</a>, and pass that to Jekyll on the command line (see also the info box at the bottom of the <a href="https://jekyllrb.com/docs/configuration/environments/">Jekyll page about environments</a>, and/or the <a href="https://jekyllrb.com/docs/configuration/options/#build-command-options">Jekyll Build Command options list</a> (note: <code class="language-plaintext highlighter-rouge">jekyll serve</code> <a href="https://jekyllrb.com/docs/configuration/options/#serve-command-options">can accept any of the</a> <code class="language-plaintext highlighter-rouge">build</code> options)).</p>
<h2 id="keeping-up-to-date">Keeping up-to-date</h2>
<p>See the <a href="https://help.github.com/en/articles/setting-up-your-github-pages-site-locally-with-jekyll#keeping-your-site-up-to-date-with-the-github-pages-gem">GitHub guide, here</a>, but basically you need to periodically do:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/websites/davethw.github.io <span class="nv">$ </span>bundle update
</code></pre></div></div>Dave ThwaitesStep-by-step through installing Jekyll, for local GitHub Pages, on a Raspberry PiGit Quick Reference2018-04-21T21:00:00+01:002018-06-20T21:00:00+01:00https://dave.thwaites.org.uk/programming/git-quick-reference<h2 style="text-align: center" id="setting-up">Setting up</h2>
<h3 id="initialise-a-new-project">Initialise a new project:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span>git init project
~ <span class="nv">$ </span><span class="nb">cd </span>project
</code></pre></div></div>
<p>or</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span><span class="nb">mkdir </span>project
~ <span class="nv">$ </span><span class="nb">cd </span>project
~/project <span class="nv">$ </span>git init
</code></pre></div></div>
<p>Ref: <a href="https://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository#_initializing_a_repository_in_an_existing_directory">Git Pro</a></p>
<h3 id="clone-a-repo-from-github-or-elsewhere">Clone a repo from GitHub (or elsewhere):</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~ <span class="nv">$ </span>git clone https://github.com/User/project.git
</code></pre></div></div>
<p><em><strong>Note:</strong> can also be done with SSH, or from elsewhere on local filesystem</em>
<br />Ref: <a href="https://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository#_git_cloning">Git Pro</a></p>
<h3 id="set-user-details-for-git">Set user details for git:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git config <span class="nt">--global</span> user.email <span class="s2">"you@example.com"</span>
~/project <span class="nv">$ </span>git config <span class="nt">--global</span> user.name <span class="s2">"Your Name"</span>
</code></pre></div></div>
<p><em>Omit</em> <code class="language-plaintext highlighter-rouge">--global</code> <em>to set the identity only in this repository.</em>
<br /><em><strong>Note:</strong> If you don’t set these options, git will ask you to do so the first time you try to commit anything!</em>
<br />Ref: <a href="https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup#_your_identity">Git Pro</a></p>
<h3 id="tell-git-to-cache-https-credentials">Tell git to cache (HTTPS) credentials:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git config <span class="nt">--global</span> credential.helper cache
</code></pre></div></div>
<p><em>Omit</em> <code class="language-plaintext highlighter-rouge">--global</code> <em>to set the credential helper only in this repository.</em>
<em><strong>Note:</strong> Defaults to caching your credentials for 15 minutes</em>
<br />Refs: <a href="https://git-scm.com/docs/git-credential-cache#_examples">Git Reference</a> | <a href="https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage#_credential_caching">Git Pro</a></p>
<h3 id="check-your-settings">Check your settings:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git config <span class="nt">--list</span>
~/project <span class="nv">$ </span>git config user.name
</code></pre></div></div>
<p>Ref: <a href="https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup#_checking_your_settings">Git Pro</a>
<br />See also: <a href="https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration">Git Configuration</a></p>
<h2 style="text-align: center" id="basic-use">Basic use</h2>
<h3 id="show-status-of-project">Show status of project:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git status
</code></pre></div></div>
<p><em>This shows you which branch you are on and which files are ready to commit, unstaged yet, or untracked</em>
<br />Ref: <a href="https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#_checking_status">Git Pro</a></p>
<h3 id="stage-changes-in-file--directory-ready-for-the-next-commit">Stage changes in file / directory ready for the next commit:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git add <file|directory>
</code></pre></div></div>
<p>ie. this will add all changed files in the current directory:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git add <span class="nb">.</span>
</code></pre></div></div>
<p>Refs: Git Pro - <a href="https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#_tracking_files">Tracking new files</a> | <a href="https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#_staging_modified_files">Staging modified files</a></p>
<h3 id="remove-a-file">Remove a file:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git <span class="nb">rm </span>file
</code></pre></div></div>
<p><em><strong>Note:</strong> as well as removing the file from git’s index of tracked files, this will also delete the file.</em>
<br />If you just want remove the file from version control, but not actually delete the file, use:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git <span class="nb">rm</span> <span class="nt">--cached</span> file
</code></pre></div></div>
<p>Ref: <a href="https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#_removing_files">Git Pro</a></p>
<h3 id="rename-a-file">Rename a file:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git <span class="nb">mv </span>file_from file_to
</code></pre></div></div>
<p><em><strong>Note:</strong> if you move a file manually, git should work out that you’ve moved it - although you’ll have to run</em> <code class="language-plaintext highlighter-rouge">git rm file_from</code> <em>and</em> <code class="language-plaintext highlighter-rouge">git add file_to</code><em>, so therefore</em> <code class="language-plaintext highlighter-rouge">git mv</code> <em>saves one or two commands!</em>
<br />Ref: <a href="https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#_git_mv">Git Pro</a></p>
<h3 id="commit-the-staged-files">Commit the staged files:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git commit <span class="nt">-m</span> <span class="s2">"<message - try to keep to less than 50 chars!..>"</span>
</code></pre></div></div>
<p><em>If you omit</em> <code class="language-plaintext highlighter-rouge">-m "message"</code> <em>then a text editor will launch with a default commit message - this gives you the chance to add more lines of detail after the main commit message (I think…)</em>
<br />Ref: <a href="https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#_committing_changes">Git Pro</a></p>
<h3 id="commit-all-modified-tracked-files-without-needing-to-stage-them-first">Commit all modified, tracked files, without needing to stage them first:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git commit <span class="nt">-a</span> <span class="nt">-m</span> <span class="s2">"<message>"</span>
</code></pre></div></div>
<p>Ref: <a href="https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#_skipping_the_staging_area">Git Pro</a></p>
<h2 style="text-align: center" id="working-with-branches">Working with Branches</h2>
<h3 id="list-all-local-branches">List all local branches:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git branch
</code></pre></div></div>
<p>Ref: <a href="https://git-scm.com/book/en/v2/Git-Branching-Branch-Management#_branch_management">Git Pro</a></p>
<h3 id="list-the-last-commit-on-all-local-branches">List the last commit on all local branches:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git branch <span class="nt">-v</span>
</code></pre></div></div>
<p>Ref: <a href="https://git-scm.com/book/en/v2/Git-Branching-Branch-Management#_branch_management">Git Pro</a></p>
<h3 id="create-a-new-branch-at-the-current-head">Create a new branch (at the current HEAD):</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git branch new-branch
</code></pre></div></div>
<p><em><strong>Note:</strong> This will create the new branch, but it will not switch the working tree to it; use</em> <code class="language-plaintext highlighter-rouge">git checkout new-branch</code> <em>to switch to the new branch.</em></p>
<h3 id="create-and-checkout-a-new-branch-at-the-current-head">Create and checkout a new branch (at the current HEAD):</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git checkout <span class="nt">-b</span> new-branch
</code></pre></div></div>
<h3 id="switch-to-checkout-a-branch">Switch to (‘checkout’) a branch:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git checkout branch-name
</code></pre></div></div>
<h3 id="move-a-branch-to-point-to-a-different-commit">Move a branch to point to a different commit:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git branch <span class="nt">-f</span> branch-name new-target
</code></pre></div></div>
<p><code class="language-plaintext highlighter-rouge">new-target</code> can be another branch name, or a commit ref.
<br /><em><strong>Note:</strong> This will update the branch, but it will not switch the working tree to it; use</em> <code class="language-plaintext highlighter-rouge">git checkout branch-name</code> <em>to switch to the branch.</em>
<br />Ref: <a href="https://git-scm.com/docs/git-branch#git-branch--f">Git Reference</a></p>
<h2 style="text-align: center" id="view-commit-history">View Commit History</h2>
<h3 id="history-for-current-branch">History for current branch:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git log
</code></pre></div></div>
<p>Ref: <a href="https://git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-History">Git Pro</a></p>
<h3 id="condense-graphed-history-of-current-commit">Condense, graphed history of current commit:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git log <span class="nt">--oneline</span> <span class="nt">--graph</span> <span class="nt">--decorate</span>
</code></pre></div></div>
<p><code class="language-plaintext highlighter-rouge">--oneline</code> shows each commit on a single line
<br /><code class="language-plaintext highlighter-rouge">--graph</code> draws an ASCII graph of the branch and merge history
<br /><code class="language-plaintext highlighter-rouge">--decorate</code> add names of branches or tags to the commits shown
<br />Ref: <a href="https://git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-History#log_options">Git Pro</a></p>
<h3 id="summary-details-of-one-specific-commit">Summary details of one specific commit:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git log <span class="nt">--stat</span> 44e07a3^!
</code></pre></div></div>
<p><code class="language-plaintext highlighter-rouge">--stat</code> <em>gives you a summary of which files were changed in a specific commit (</em><code class="language-plaintext highlighter-rouge">44e07a3</code><em>), and by how much (a ‘diffstat’) - omit the option to see the full diff for the commit</em>
<br />Ref: <a href="https://git-scm.com/docs/git-log#git-log---statltwidthgtltname-widthgtltcountgt">Git Reference - git log –stat</a>
<br /><em><strong>Note:</strong></em> <code class="language-plaintext highlighter-rouge"><commit-ref>^!</code> <em>means the range that starts and ends with the specified commit (if you just pass a simple commit</em> <code class="language-plaintext highlighter-rouge"><commit-ref></code> <em>to</em> <code class="language-plaintext highlighter-rouge">git log</code> <em>then it’ll return that commit and all its ancenstors - see <a href="https://git-scm.com/docs/gitrevisions#_specifying_ranges">Git Reference - Specifying Ranges</a>)</em>
<br />Ref: <a href="https://git-scm.com/docs/gitrevisions#_other_rev_parent_shorthand_notations">Git Reference - Parent Shorthand Notations</a></p>
<h3 id="condense-graphed-history-for-specific-branch">Condense, graphed history for specific branch:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git log <span class="nt">--oneline</span> <span class="nt">--graph</span> <span class="nt">--decorate</span> branch-name
</code></pre></div></div>
<p>Ref: <a href="https://git-scm.com/docs/gitrevisions#gitrevisions-emltrefnamegtemegemmasterememheadsmasterememrefsheadsmasterem">Git Reference</a></p>
<h3 id="condense-graphed-history-for-specific-branch-for-files-in-a-specific-directory">Condense, graphed history for specific branch, for files in a specific directory:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git log <span class="nt">--oneline</span> <span class="nt">--graph</span> <span class="nt">--decorate</span> branch-name <span class="nt">--</span> dir-name
</code></pre></div></div>
<p>Ref: <a href="https://git-scm.com/docs/git-log#git-log---ltpathgt82308203">Git Reference</a></p>
<h2 style="text-align: center" id="remote-branches">Remote Branches</h2>
<p>See: <a href="https://git-scm.com/book/en/v2/Git-Branching-Remote-Branches">Git Pro: Git Branching - Remote Branches</a></p>
<h3 id="list-all-remote-repositoriy-references">List all remote repositoriy references:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git remote show
</code></pre></div></div>
<h3 id="add-a-remote-repository">Add a remote repository:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git remote add upstream https://github.com/User/project.git
</code></pre></div></div>
<p>Ref: <a href="https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes#_adding_remote_repositories">Git Pro</a></p>
<h3 id="show-details-of-remote-repository">Show details of remote repository:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git remote show origin
</code></pre></div></div>
<p><em>Change</em> <code class="language-plaintext highlighter-rouge">origin</code> <em>for the reference name of the remote repositiory!</em>
<br />Ref: <a href="https://git-scm.com/book/en/v2/Git-Branching-Remote-Branches#_remote_branches">Git Pro</a></p>
<h3 id="list-local-branches-with-details-of-what-remote-branches-they-are-tracking">List local branches, with details of what remote branches they are tracking:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git branch <span class="nt">-vv</span>
</code></pre></div></div>
<h3 id="fetch-status-and-contents-of-remote-branches-but-dont-merge-with-any-local-branches">Fetch status and contents of remote branches (but don’t merge with any local branches):</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git fetch origin
</code></pre></div></div>
<h3 id="merge-a-remote-branch-with-the-current-local-branch">Merge a remote branch with the current local branch:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git fetch origin
~/project <span class="nv">$ </span>git merge origin/remote-branch
</code></pre></div></div>
<p>or</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git pull origin remote-branch
</code></pre></div></div>
<h3 id="add-an-existing-remote-branch-to-local-repository">Add an existing remote branch to local repository:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git checkout <span class="nt">-b</span> new-branch origin/new-branch
</code></pre></div></div>
<p>or</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git checkout <span class="nt">--track</span> origin/new-branch
</code></pre></div></div>
<p>or</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git checkout new-branch
</code></pre></div></div>
<p>Ref: <a href="https://git-scm.com/book/en/v2/Git-Branching-Remote-Branches#_tracking_branches">Git Pro</a></p>
<h3 id="push-a-local-branch-up-to-a-remote-server-first-time">Push a local branch up to a remote server (first time):</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git push origin new-branch
</code></pre></div></div>
<p><em><strong>Note:</strong> you don’t have to have</em> <code class="language-plaintext highlighter-rouge">new-branch</code> <em>currently checked out for this to work.</em>
<br /><em>This will push the named local branch up to the remote repository, and configure it to do so again, along with other branches, when you do a</em> <code class="language-plaintext highlighter-rouge">git push --all</code> <em>- but not to pull back with a</em> <code class="language-plaintext highlighter-rouge">git pull</code>.
<br />Ref: <a href="https://git-scm.com/book/en/v2/Git-Branching-Remote-Branches#_pushing_branches">Git Pro</a></p>
<h3 id="push-current-local-branch-up-to-a-remote-server">Push current local branch up to a remote server:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git push
</code></pre></div></div>
<p><em>This will push the current local branch up to its configured remote repository.</em>
<br /><em>If the current branch doesn’t have a remote repository configured for pushing, it will push to</em> <code class="language-plaintext highlighter-rouge">origin</code> <em>(and configure it to do so again when you do a</em> <code class="language-plaintext highlighter-rouge">git push --all</code><em>..?).</em>
<br />Ref: <a href="https://git-scm.com/docs/git-push#git-push-codegitpushcode">Git Reference</a></p>
<h3 id="push-all-local-branches-up-to-remote-server">Push all local branches up to remote server:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git push <span class="nt">--all</span>
</code></pre></div></div>
<p><em>This will push all the local branches (that are configured to do so?) up to their respective remote repositories.</em>
<br />Ref: <a href="https://git-scm.com/docs/git-push#git-push---all">Git Reference</a></p>
<h3 id="set-current-local-branch-to-track-a-remote-branch">Set current local branch to track a remote branch:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git branch <span class="nt">--set-upstream-to</span> origin/new-branch
</code></pre></div></div>
<p>or</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git branch <span class="nt">-u</span> origin/new-branch
</code></pre></div></div>
<p><em>This will configure the current local branch to pull from the remote repository when you do a simple</em> <code class="language-plaintext highlighter-rouge">git pull</code>.</p>
<h3 id="pull-branches-from-the-remote-server">Pull branches from the remote server:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git pull
</code></pre></div></div>
<p><em>Exactly what this does depends somewhat on your repository and how things have been configured.</em></p>
<ul>
<li><em>If the current branch has been set to track a remote branch, then the default behaviour is to pull that remote branch from it’s server and merge with the current branch - ie. it is equivalent to something like</em> <code class="language-plaintext highlighter-rouge">git fetch origin; git merge origin/this-branch</code>.</li>
<li><em>If the current branch isn’t currently set to track a remote branch, then I think the</em> <code class="language-plaintext highlighter-rouge">FETCH_HEAD</code> <em>from the (default?</em> <code class="language-plaintext highlighter-rouge">origin</code><em>?) remote repository is merged with the current branch, but I’m not sure (nor entirely certain what that means in relation to GitHub… it probably fetches and merges in the</em> <code class="language-plaintext highlighter-rouge">origin/master</code> <em>branch..?)</em></li>
<li><em>It appears that by default, if the current branch doesn’t have any tracking information, then</em> <code class="language-plaintext highlighter-rouge">git pull</code> <em>will throw an error and ask you to either specifiy which (remote) branch you wish to merge with, or set tracking information for the local branch (and tell you how!)</em></li>
</ul>
<p><em><strong>Note:</strong> It isn’t possible to pull multiple branches from their remote repositories with a single git command - <a href="https://stackoverflow.com/questions/4318161/can-git-pull-all-update-all-my-local-branches">see here</a></em>
<br />Refs: <a href="https://git-scm.com/docs/git-pull#_default_behaviour">Git Reference</a> | <a href="https://git-scm.com/book/en/v2/Git-Branching-Remote-Branches#_pulling">Git Pro</a></p>
<h3 id="stop-current-branch-from-tracking-a-remote-branch">Stop current branch from tracking a remote branch:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git branch <span class="nt">--unset-upstream</span>
</code></pre></div></div>
<p><em>This will stop the current local branch from pulling from the remote repositoriy when you do a simple</em> <code class="language-plaintext highlighter-rouge">git pull</code><em>, but it will continue to push to the remote repository, along with other branches, when you do a</em> <code class="language-plaintext highlighter-rouge">git push --all</code>.</p>
<h3 id="delete-a-remote-branch-from-the-remote-repository">Delete a remote branch (from the remote repository):</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git push origin <span class="nt">--delete</span> old-branch
</code></pre></div></div>
<p>Ref: <a href="https://git-scm.com/book/en/v2/Git-Branching-Remote-Branches#_delete_branches">Git Pro</a></p>
<h2 style="text-align: center" id="modify-your-history">Modify your history</h2>
<p>See: <a href="https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History">Git Pro: Git Tools - Rewriting History</a></p>
<p><strong>Note:</strong> Be very cautious of doing any of this if you have already pushed your project up to a remote server (eg GitHub) - and you should probably <strong>never</strong> do it if there’s a chance someone else has already pulled your work down from the remote server to their own computer!..</p>
<p><strong>Note:</strong> Amending a commit kinda of forgets about the previous version of the commit, and creates a new one to replace it in the history / log. If anything refers to that previous version (you’ve branched off it, or you’ve pushed up to a server and someone else has branched off it) then those commits will effectivley be orphaned and its potentially a (big) headache to sort it out again.</p>
<h3 id="amend-the-previous-commit">Amend the previous commit:</h3>
<p><em>If you need to tweak any files, do that first, then</em> <code class="language-plaintext highlighter-rouge">git add</code> <em>the relevant files</em></p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git commit <span class="nt">--amend</span>
</code></pre></div></div>
<p><em>You’ll then be dropped into a text editor to update the commit message</em>
<br />Ref: <a href="https://git-scm.com/docs/git-commit#git-commit---amend">Git Reference</a> | <a href="https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History#_git_amend">Git Pro</a></p>
<h3 id="amend-the-previous-commit-without-editing-the-commit-message">Amend the previous commit, without editing the commit message:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git commit <span class="nt">--amend</span> <span class="nt">--no-edit</span>
</code></pre></div></div>
<h3 id="amend-the-date-of-the-previous-commit">Amend the date of the previous commit:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git commit <span class="nt">--amend</span> <span class="nt">--date</span><span class="o">=</span><span class="s2">"Wed, 18 Apr 2018 13:00:00 +0100"</span>
</code></pre></div></div>
<p>Ref: <a href="https://git-scm.com/docs/git-commit#_date_formats">Git Reference - Date Formats</a></p>
<h3 id="amend-the-previous-three-commits---interactive-rebase">Amend the previous three commits - interactive rebase:</h3>
<p>See: <a href="https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History#_changing_multiple">Git Pro: Changing Multiple Commit Messages</a></p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git rebase <span class="nt">-i</span> HEAD~3
</code></pre></div></div>
<p>*<strong>Note:</strong> The commit ref that you pass will be the one that everything is rebased onto - that specific commit will not get changed.</p>
<h3 id="amend-all-commits-on-this-branch">Amend all commits on this branch:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git rebase <span class="nt">-i</span> <span class="nt">--root</span>
</code></pre></div></div>
<p>*<strong>Note:</strong> If you modify any commit then it and all of its decendents will get new SHA-1s - so if you modify the initial commit then all the commits will get re-written. If there are any branches off any of the decendents then they won’t get updated and will still refer to the original commit history.</p>
<h3 id="remove-a-file-from-all-commits">Remove a file from all commits:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git filter-branch <span class="nt">--tree-filter</span> <span class="s1">'rm -f passwords.txt'</span> HEAD
</code></pre></div></div>
<p>Ref: <a href="https://git-scm.com/docs/git-filter-branch#git-filter-branch---tree-filterltcommandgt">Git Reference</a> | <a href="https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History#_removing_file_every_commit">Git Pro</a></p>
<h3 id="make-a-subdirectory-the-new-root">Make a subdirectory the new root:</h3>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/project <span class="nv">$ </span>git filter-branch <span class="nt">--subdirectory-filter</span> subdirname HEAD
</code></pre></div></div>
<p>Ref: <a href="https://git-scm.com/docs/git-filter-branch#git-filter-branch---subdirectory-filterltdirectorygt">Git Reference</a> | <a href="https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History#_making_a_subdirectory_the_new_root">Git Pro</a></p>
<h2 style="text-align: center" id="references">References</h2>
<p>Based on various Git References and Git Cheat Sheets, and other resources around the web!..</p>
<ul>
<li id="ref_gitref">Git Reference / Man Pages:
<a href="https://git-scm.com/docs">https://git-scm.com/docs</a></li>
<li id="ref_gitpro">Git Pro book:<br />
<a href="https://git-scm.com/book/en/v2">https://git-scm.com/book/en/v2</a></li>
<li id="ref_github_gcs">GitHub’s Git Cheat Sheet:<br />
<a href="https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf">https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf</a></li>
<li id="ref_atlassian_gcs">Atlassian’s Git Cheat Sheet:<br />
<a href="https://www.atlassian.com/git/tutorials/atlassian-git-cheatsheet">https://www.atlassian.com/git/tutorials/atlassian-git-cheatsheet</a></li>
<li id="ref_tower_gcs">Tower’s Git Cheat Sheet:<br />
<a href="https://www.git-tower.com/blog/git-cheat-sheet/">https://www.git-tower.com/blog/git-cheat-sheet/</a></li>
</ul>Dave ThwaitesVarious reminders of how to do things in git!Flashing an OS image for Raspberry Pi2018-03-19T00:00:00+00:002018-03-19T00:00:00+00:00https://dave.thwaites.org.uk/theatre-royal/eos-remote/Flashing-RaspberryPi-Image<p>First, download an OS image from https://www.raspberrypi.org/downloads/ - I’ve been using Raspbian (March 2018 version, released on 2018-03-13).</p>
<p>Then we need to flash the image onto an SD card. This isn’t directly possible on a Chromebook (as far as I’m aware), but is possible using <a href="https://etcher.io/">Etcher</a> under Crouton!</p>
<p>Before starting Crouton, it’s worth inserting the SD card into your Chromebook, and then ejecting any removable drives that appear in the ChromeOS File app (I struggled a bit when I did this later in the process!) - there may be several if it’s an SD card that you’ve previously used on a Raspberry Pi. And obviously this process will wipe anything that’s currently on the SD card, so backup anything that you want to keep!..</p>
<p>So, (install and) start up Crouton:
<code class="language-plaintext highlighter-rouge">Ctrl-Alt-T</code> to open a new terminal on ChromeOS, then:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>crosh> shell
</code></pre></div></div>
<p>If you haven’t updated the Crouton chroot for a while, might be worth doing so:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>chronos@localhost / <span class="nv">$ </span><span class="nb">sudo </span>sh ~/Downloads/crouton <span class="nt">-u</span> <span class="nt">-n</span> xenial
</code></pre></div></div>
<p>(Replace <code class="language-plaintext highlighter-rouge">xenial</code> with whatever your chroot is called - use <code class="language-plaintext highlighter-rouge">sudo edit-chroot -a</code> to list all installed chroot names - see the <a href="https://github.com/dnschneid/crouton/wiki/Crouton-Command-Cheat-Sheet">Crouton Command Cheet Sheet</a> for other useful commands!) Then start up your chroot:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>chronos@localhost / <span class="nv">$ </span><span class="nb">sudo </span>startxfce4
</code></pre></div></div>
<p>(Or whatever is the appropriate <code class="language-plaintext highlighter-rouge">start????</code> command for your Crouton install)</p>
<p>I didn’t have much success with the AppImage download from the <a href="https://etcher.io/">Etcher website</a>, so went for the <a href="https://github.com/resin-io/etcher#installers">Package Repository method</a> described on <a href="https://github.com/resin-io/etcher">their GitHub page</a> instead. So, within the Crouton chroot, open a terminal window, then:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">(</span>xenial<span class="o">)</span>dave@localhost:~<span class="nv">$ </span><span class="nb">echo</span> <span class="s2">"deb https://dl.bintray.com/resin-io/debian stable etcher"</span> | <span class="nb">sudo tee</span> /etc/apt/sources.list.d/etcher.list
<span class="o">(</span>xenial<span class="o">)</span>dave@localhost:~<span class="nv">$ </span><span class="nb">sudo </span>apt-key adv <span class="nt">--keyserver</span> hkp://pgp.mit.edu:80 <span class="nt">--recv-keys</span> 379CE192D401AB61
<span class="o">(</span>xenial<span class="o">)</span>dave@localhost:~<span class="nv">$ </span><span class="nb">sudo </span>apt-get update
<span class="o">(</span>xenial<span class="o">)</span>dave@localhost:~<span class="nv">$ </span><span class="nb">sudo </span>apt-get <span class="nb">install </span>etcher-electron
</code></pre></div></div>
<p>Once installed, you should be able to find Etcher in the Applications menu, probably under Accessories. However, running it from there runs into an issue when you try to actually flash the image to an SD card - an error box pops up saying “No polkit authentication agent found”. I didn’t try to install a polkit authentication agent, instead I ran Etcher with sudo (might be bad practice..?):</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">(</span>xenial<span class="o">)</span>dave@localhost:~<span class="nv">$ </span><span class="nb">sudo </span>etcher-electron
</code></pre></div></div>
<p>Then in Etcher select the OS image file (you should be able to select it directly from the Downloads folder (which is shared with ChromeOS) - no need to unzip it! :-), check that Etcher has selected the correct SD card (probably only one listed - double check it’s the right size!), then click on “Flash!” Flashing the 2018-03-13 release of Raspbian onto a SanDisk 8GB Class 4 SDHC card took about 17mins, plus another 6 mins for Etcher to verify the image - don’t swap from the chroot back into ChromeOS during the process as it may throw up an error when you return to the chroot!</p>
<p>Once it’s finished flashing the SD card, Etcher will unmount it. Logout of your chroot, and try to eject any removable drives that have appeared in ChromeOS (didn’t work for me - ChromeOS claimed they were still in use…), remove your SD card, and you’re good to go!</p>Dave ThwaitesStep-by-step notes on how to flash a (fresh!) OS image for a Raspberry Pi, on an (old) SD card, using (my) ChromebookVideo conversion using ffmpeg on Windows2018-02-01T11:00:00+00:002021-05-22T20:25:00+01:00https://dave.thwaites.org.uk/theatre-royal/video-conversion<p>Our video camera records as MPEG-2 Program Stream files, which are a little bulky and are capped at just under 2GB (about 49mins long) - longer recordings are therefore split into multiple files. Fortunately, according to the <a href="http://www.ffmpeg.org/faq.html#Concatenating-using-the-concat-protocol-_0028file-level_0029">ffmpeg faq</a>, MPEG-2 PS files can just be concatenated together using the humble <code class="language-plaintext highlighter-rouge">copy</code> command!..</p>
<p>On the other hand, the DSLR records as QuickTime .mov files, which are capped at 30mins (about 2.5GB) - longer recordings again get split into multiple files, but I don’t think the files can just be concatenated together - however <code class="language-plaintext highlighter-rouge">ffmpeg</code> can do it for us with the <a href="http://www.ffmpeg.org/ffmpeg-filters.html#concat"><code class="language-plaintext highlighter-rouge">concat</code> filter</a>…</p>
<h2 id="download-ffmpeg">Download ffmpeg</h2>
<p>First, if not yet done, download ffmpeg from one of the sites listed on the <a href="https://www.ffmpeg.org/download.html#build-windows">ffmpeg downloads page</a>:</p>
<ul>
<li><del><a href="https://ffmpeg.zeranoe.com/builds/">zeranoe.com</a> - I went for the latest Release Build (3.4.1), Windows 64-bit, Static.</del></li>
<li><a href="https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-github">gyan.dev</a> - I downloaded the <code class="language-plaintext highlighter-rouge">...essentials_build.zip</code> version</li>
<li><a href="https://github.com/BtbN/FFmpeg-Builds/releases">BtbN</a></li>
</ul>
<p>Once the zip files has downloaded, extract the contents somewhere (Downloads folder works) - note the zip folder contains a directory, which contains everything else, so it’s less confusing if you extract directly into Downloads, rather than the subdirectory that the extractor will suggest!..</p>
<h2 id="format-check">Format Check</h2>
<p>If you want to, confirm the format that a file is with:</p>
<div class="language-terminal highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gp">C:\Users\Dave></span><span class="nb">cd </span>Downloads<span class="se">\f</span>fmpeg-<span class="k">*</span><span class="se">\b</span><span class="k">in</span>
<span class="gp">C:\....\bin></span>ffprobe <span class="nt">-hide_banner</span> <span class="nt">-show_format</span> <span class="s2">"C:</span><span class="se">\U</span><span class="s2">sers</span><span class="se">\D</span><span class="s2">ave</span><span class="se">\D</span><span class="s2">esktop</span><span class="se">\B</span><span class="s2">irdsong</span><span class="se">\1</span><span class="s2">st Dress</span><span class="se">\M</span><span class="s2">2U00032.MPG"</span>
</code></pre></div></div>
<p>In the <code class="language-plaintext highlighter-rouge">[FORMAT]</code> section, look for <code class="language-plaintext highlighter-rouge">format_long_name</code> - MPEG-PS files can be concatenated with <code class="language-plaintext highlighter-rouge">copy</code>, QuickTime / MOV (and other format) files can be concatenated with the <code class="language-plaintext highlighter-rouge">concat</code> filter.</p>
<p>Note: complete filenames can be easily inserted into the Command Prompt by dragging the file from a Directory window and dropping on the Command window!..</p>
<h2 id="concatenate-files">Concatenate Files</h2>
<p>If necessary, concatenate files with (file paths abbreviated for clarity!):</p>
<div class="language-terminal highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gp">C:\Users\Dave></span>copy /b <span class="s2">"....</span><span class="se">\M</span><span class="s2">2U00032.MPG"</span> + <span class="s2">"....</span><span class="se">\M</span><span class="s2">2U00033.MPG"</span> <span class="s2">"....</span><span class="se">\F</span><span class="s2">irst Half.MPG"</span>
</code></pre></div></div>
<p>Note the <code class="language-plaintext highlighter-rouge">+</code> between the files that should be concatenated together - more that two files is possible at once - the last parameter is the output file name. And note the /b at the beginning - this tells <code class="language-plaintext highlighter-rouge">copy</code> that its copying binary files, and therefore shouldn’t stop when it finds a CTRL-Z character (which <code class="language-plaintext highlighter-rouge">copy</code> considers an end-of-file character in an ASCII file - <a href="https://technet.microsoft.com/en-gb/library/bb490886.aspx#ECAA">see here</a>)</p>
<p>Note: complete filenames can be easily inserted into the Command Prompt by dragging the file from a Directory window and dropping on the Command window!..</p>
<h2 id="basic-conversion">Basic Conversion</h2>
<p>Finally, convert MPG files to mp4 files with:</p>
<div class="language-terminal highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gp">C:\Users\Dave></span><span class="nb">cd </span>Downloads<span class="se">\f</span>fmpeg-<span class="k">*</span><span class="se">\b</span><span class="k">in</span>
<span class="gp">C:\....\bin></span>ffmpeg.exe <span class="nt">-hide_banner</span> <span class="nt">-i</span> <span class="s2">"....</span><span class="se">\F</span><span class="s2">irst Half.MPG"</span> <span class="s2">"....</span><span class="se">\F</span><span class="s2">irst Half.mp4"</span>
</code></pre></div></div>
<p>Note: ffmpeg will guess file types from the extensions, and the <a href="http://www.bugcodemaster.com/article/convert-videos-mp4-format-using-ffmpeg">default settings for outputting mp4</a> are: video stream as h264 (High), audio stream as AAC - which generally works well! Video conversion seems to run at about 3x speed on my work desktop.</p>
<h2 id="de-interlacing">De-Interlacing</h2>
<p>If it looks like the videos might need de-interlacing (our camera does!), try this instead (found in the <a href="http://www.ffmpeg.org/faq.html#Interlaced-video-looks-very-bad-when-encoded-with-ffmpeg_002c-what-is-wrong_003f">ffmpeg FAQ, here</a>) - note the additional flags between the input and output file names:</p>
<div class="language-terminal highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gp">C:\Users\Dave></span><span class="nb">cd </span>Downloads<span class="se">\f</span>fmpeg-<span class="k">*</span><span class="se">\b</span><span class="k">in</span>
<span class="gp">C:\....\bin></span>ffmpeg.exe <span class="nt">-hide_banner</span> <span class="nt">-i</span> <span class="s2">"....</span><span class="se">\F</span><span class="s2">irst Half.MPG"</span> <span class="nt">-flags</span> +ilme+ildct <span class="s2">"....</span><span class="se">\F</span><span class="s2">irst Half.mp4"</span>
</code></pre></div></div>
<h2 id="trimming">Trimming</h2>
<p>You can set a start time and a duration with the <code class="language-plaintext highlighter-rouge">-ss</code> and <code class="language-plaintext highlighter-rouge">-t</code> flags, before the <code class="language-plaintext highlighter-rouge">-i</code> input file, like so:</p>
<div class="language-terminal highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gp">C:\Users\Dave></span><span class="nb">cd </span>Downloads<span class="se">\f</span>fmpeg-<span class="k">*</span><span class="se">\b</span><span class="k">in</span>
<span class="gp">C:\....\bin></span>ffmpeg.exe <span class="nt">-hide_banner</span> <span class="nt">-ss</span> 0:01:00 <span class="nt">-t</span> 1:06:00 <span class="nt">-i</span> <span class="s2">"....</span><span class="se">\F</span><span class="s2">irst Half.MPG"</span> <span class="nt">-flags</span> +ilme+ildct <span class="s2">"....</span><span class="se">\F</span><span class="s2">irst Night - First Half.mp4"</span>
</code></pre></div></div>
<h2 id="concat-filter">Concat Filter</h2>
<p>If the files arean’t MPEG-PS, you can use a filter in ffmpeg to concanenate the video streams together - might cause a slight jump if the files don’t link up perfectly.</p>
<div class="language-terminal highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gp">C:\Users\Dave></span><span class="nb">cd </span>Downloads<span class="se">\f</span>fmpeg-<span class="k">*</span><span class="se">\b</span><span class="k">in</span>
<span class="gp">C:\....\bin></span>ffmpeg <span class="nt">-hide_banner</span> <span class="nt">-i</span> <span class="s2">"....</span><span class="se">\D</span><span class="s2">SC_0001.MOV"</span> <span class="nt">-i</span> <span class="s2">"....</span><span class="se">\D</span><span class="s2">SC_0002.MOV"</span> <span class="nt">-filter_complex</span> <span class="nv">concat</span><span class="o">=</span><span class="nv">n</span><span class="o">=</span>2:v<span class="o">=</span>1:a<span class="o">=</span>1 <span class="s2">"....</span><span class="se">\F</span><span class="s2">irst Half.mp4"</span>
</code></pre></div></div>
<p>Only runs at about 0.7x speed on my work desktop. The above works for two input files into one output file - I think if you want three inputs you just add another <code class="language-plaintext highlighter-rouge">-i "....\xxxxx.MOV"</code> input, and change the filter settings to <code class="language-plaintext highlighter-rouge">concat=n=3:v=1:a=1</code>…</p>
<h2 id="multiple-conversions">Multiple Conversions</h2>
<p>The command prompt will let you run multiple commands on one line using <code class="language-plaintext highlighter-rouge">&</code> to link them together (or <code class="language-plaintext highlighter-rouge">&&</code> if you only want to do the second command if the first one exits sucessfully) - <a href="https://stackoverflow.com/questions/8055371/how-do-i-run-two-commands-in-one-line-in-windows-cmd#answer-8055390">see here</a> - like this:</p>
<div class="language-terminal highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gp">C:\Users\Dave></span><span class="nb">cd </span>Downloads<span class="se">\f</span>fmpeg-<span class="k">*</span><span class="se">\b</span><span class="k">in</span>
<span class="gp">C:\....\bin></span>ffmpeg.exe <span class="nt">-hide_banner</span> <span class="nt">-ss</span> 0:01:00 <span class="nt">-t</span> 1:06:00 <span class="nt">-i</span> <span class="s2">"...</span><span class="se">\F</span><span class="s2">irst Half.MPG"</span> <span class="nt">-flags</span> +ilme+ildct <span class="s2">"....</span><span class="se">\F</span><span class="s2">irst Night - First Half.mp4"</span> & ffmpeg.exe <span class="nt">-hide_banner</span> <span class="nt">-ss</span> 1:27:00 <span class="nt">-t</span> 0:48:00 <span class="nt">-i</span> <span class="s2">"....</span><span class="se">\S</span><span class="s2">econd Half.MPG"</span> <span class="nt">-flags</span> +ilme+ildct <span class="s2">"....</span><span class="se">\F</span><span class="s2">irst Night - Second Half.mp4"</span>
</code></pre></div></div>Dave ThwaitesStep-by-step through using ffmpeg to convert video files (from our video camera) to mp4's