    <?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>perkinstuff.com</title>
	<atom:link href="https://perkinstuff.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://perkinstuff.com/</link>
	<description>I Do IT My Way</description>
	<lastBuildDate>Fri, 30 Jul 2021 10:24:10 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.9.13</generator>

<image>
	<url>https://perkinstuff.com/wp-content/uploads/2020/06/profile-pic-round-300-150x150.png</url>
	<title>perkinstuff.com</title>
	<link>https://perkinstuff.com/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>OneDrive Server Backup</title>
		<link>https://perkinstuff.com/onedrive-server-backup/</link>
					<comments>https://perkinstuff.com/onedrive-server-backup/#respond</comments>
		
		<dc:creator><![CDATA[Steve]]></dc:creator>
		<pubDate>Tue, 12 May 2020 21:01:00 +0000</pubDate>
				<category><![CDATA[Backup]]></category>
		<category><![CDATA[Servers]]></category>
		<guid isPermaLink="false">https://www.perkinstuff.com/?p=284</guid>

					<description><![CDATA[<p>As I mentioned in a previous post, I&#8217;ve been using SpiderOak for encrypted backups for both servers and my work/personal data. The Re-test I&#8217;ve gradually been storing more and more data on there, and while I&#8217;ve happily recovered the odd file or two from it, it had been a while since I tested a full-sized...</p>
<p>The post <a rel="nofollow" href="https://perkinstuff.com/onedrive-server-backup/">OneDrive Server Backup</a> appeared first on <a rel="nofollow" href="https://perkinstuff.com">perkinstuff.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>As I mentioned in a <a href="https://perkinstuff.com/spideroak-server-backup/">previous post</a>, I&#8217;ve been using SpiderOak for encrypted backups for both servers and my work/personal data.</p>



<h2>The Re-test</h2>



<p>I&#8217;ve gradually been storing more and more data on there, and while I&#8217;ve happily recovered the odd file or two from it, it had been a while since I tested a full-sized recovery job. </p>



<p>To re-test this I decided to download a fairly typical development folder, with around 20,000 mostly quite small files in it.</p>



<h2>The Problem</h2>



<p>This is where I discovered a problem. I started the recovery one evening when I&#8217;d finished for the night, and left the system busily restoring overnight. </p>



<p>I returned the following morning fully expected everything to be sat there waiting for me. I was therefore rather surprised to discover that only about 12% of the files had been restored.</p>



<h2>Finding An Alternative</h2>



<p>So I decided that I had to find a better faster alternative.</p>



<p>After a lot of research, I decided that OneDrive looked like a good option. It natively integrates with Windows and while (unlike with SpiderOak) the data stored on OneDrive isn&#8217;t encrypted at rest, Microsoft does seem to take data privacy and protection seriously which I feel is fine for most of the personal documents I have. </p>



<p>So I simply added these to the OneDrive folder and bingo, the syncing began and has worked pretty much flawlessly since.</p>



<p>However, I&#8217;m not happy to leave either client data or server backups unencrypted at rest. This meant I had to find yet another option, preferably one that worked with OneDrive.</p>



<h2>Encrypting Important Data</h2>



<p>After doing the research, I found the perfect solution. It&#8217;s easy to implement, utilises the OneDrive datastore and encrypts the entire backup even at rest. It&#8217;s also lightning fast to restore an entire backup, not just one directory of 20,000 files. Perfect!</p>



<p><strong>No</strong><em><strong>te: </strong>while Microsoft does offer an encrypted vault facility, it&#8217;s not really practical to use regularly at this time as it automatically locks every few minutes which can become very frustrating!</em></p>



<h2>Restic Backup With Rclone And OneDrive</h2>



<p>The following guide will show you how to install Restic and Rclone, configure Rclone to connect to OneDrive and create a simple backup script to backup MySQL databases and other files to OneDrive that can be used with cron for regularly scheduled backups.</p>



<p>Part of this process needs you to connect rclone to OneDrive and create a remote (connection) for it to use. The easiest way to do this requires that you can access your localhost with a web browser but you can also do this on <a href="https://rclone.org/remote_setup/">a machine with no Internet browser available</a>.</p>



<p>In this guide, I have used Windows 10 with its Subsystem for Linux (Debian) but the basic steps should work for any suitable platform.</p>



<h2>Let&#8217;s Begin</h2>



<p>To get started, open up the WSL command prompt and create a new folder for your backup files and scripts. </p>



<pre class="wp-block-code"><code>mkdir backup
cd backup</code></pre>



<p>All of the steps below will assume that this is your current working directory and you have root-level access.</p>



<p>Now, you will need to install the latest version of rclone and restic backup. </p>



<h3>Installing rclone</h3>



<p>I strongly recommend installing this directly from the rclone website instead of your Linux distro&#8217;s repository. This is just to ensure you get the latest version.</p>



<pre class="wp-block-code"><code>curl https://rclone.org/install.sh | sudo bash</code></pre>



<h3>Installing restic</h3>



<p>Again, I recommend downloading the <a href="https://restic.readthedocs.io/en/stable/020_installation.html">precompiled binary</a> from the restic website instead of using your Linux distro&#8217;s repository.</p>



<p>Once downloaded, extract and copy the executable file to the WSL folder you created above. </p>



<pre class="wp-block-code"><code>chmod 755 restic</code></pre>



<p><em><strong>Tip: </strong>you can access the root WSL file system from Windows Explorer by entering \\wsl$ in Explorer&#8217;s address bar.</em></p>



<p>Now rename the executable to &#8216;restic&#8217; and make sure the file is executable.</p>



<pre class="wp-block-code"><code>cd backup
mv restic_0.9.6_linux_amd64 restic
chmod 755 restic</code></pre>



<h3>Connect To OneDrive</h3>



<p>Now you can connect rclone to OneDrive and create a connection (remote) for the backup.</p>



<pre class="wp-block-code"><code>rclone config</code></pre>



<p>This will start the rclone interactive configuration dialog that will walk you through configuring the remote.</p>



<p>First, you need to choose an option from the list of options. Select &#8216;New Remote&#8217; by entering &#8216;n&#8217;.</p>



<p>It will then prompt you for a name for the new remote. In this example, I will use &#8216;backup&#8217; but it could be anything of your choosing. You will use this remote name in later steps.</p>



<p>Next rclone will ask for the type of storage you want to configure and display a list of available options. You will need to find the &#8216;Microsoft OneDrive&#8217; option and enter that number. At the time of writing, this was &#8217;23&#8217;.</p>



<p>After that it will ask for your &#8216;Microsoft App Client ID&#8217; followed by your &#8216;Microsoft App Client Secret&#8217;. You can normally just accept the (blank) default for these.</p>



<p>The next question is whether you want to &#8216;Edit The Advanced Setup&#8217;. Answer &#8216;n&#8217; to this and continue to the next step.</p>



<p>Now it will ask if you want to &#8216;Use Auto Config&#8217;. This is where you will need an internet browser available to access the localhost (127.0.0.1). Answering &#8216;n&#8217; to this will cause rclone to display a URL something like:</p>



<pre class="wp-block-code"><code>http:&#47;&#47;127.0.0.1:53682/auth?state=xxxxxxxxxxxxxxxxxxxxxxx</code></pre>



<p>At this point rclone will pause and be &#8216;Waiting For Auth Code&#8217;. To get the code, you need to copy the link and paste it into your browser. This will take you to Microsoft&#8217;s website where you can log in with your OneDrive account.</p>



<p>Once you&#8217;ve completed this step, rclone will automatically receive the authorisation code and continue to the next step.</p>



<p>You now need to confirm your account type from the list rclone will display.  You need to choose the &#8216;OneDrive Personal Or Business&#8217; option. At the time of writing, this was option &#8216;1&#8217;.</p>



<p>After confirming this, rclone will display a list of available drives. In most cases, there will only be one listed, and you can select option &#8216;0&#8217; (zero). Confirm this is OK by entering &#8216;y&#8217;.</p>



<p>Finally, rclone will display the configuration details. Confirm this is also OK by entering &#8216;y&#8217; again.</p>



<p>This will take you back to the initial options menu. As you have now completed the configuration, you can select the &#8216;Quit Config&#8217; option here by entering &#8216;q&#8217;.</p>



<h3>Testing Your Rclone Configuration</h3>



<p>The easiest way to test the configuration is to print a remote file listing. You can do this by using the ls command:</p>



<pre class="wp-block-code"><code>rclone ls backup:</code></pre>



<p>Where &#8216;backup&#8217; is the name that you entered earlier for the rclone remote. Don&#8217;t forget the colon (:) after the name!</p>



<p>This will print a list of any files you already have stored on OneDrive. If you want to see a list of directories (folders) instead, use &#8216;lsd&#8217; instead of &#8216;ls&#8217;.</p>



<h3>Restic Backup</h3>



<p>OK, so if you&#8217;ve got this far you must have installed rclone and created a working remote. Well done!</p>



<p>The next thing to do is to create a new repository for the restic backup.  You can do this by entering the command below:</p>



<pre class="wp-block-code"><code>./restic -r rclone:&lt;remote name>:&lt;remote path> init</code></pre>



<p>The &lt;remote name&gt; is the name of the rclone remote you created above, and the &lt;remote path&gt; is the path on OneDrive where you want the repository files to be stored. So for this example, I could use:</p>



<pre class="wp-block-code"><code>./restic -r rclone:backups:mybackupfolder/mypc init</code></pre>



<p>If the remote folder doesn&#8217;t exist, it will be created for you. </p>



<p>The first time you run this, you will be prompted for a backup password. This will be used to encrypt the remote backup.</p>



<p>Before you can start backing up, you will now need to create a password file that contains a single line with your chosen password. You can do this using your favourite editor, for example:</p>



<pre class="wp-block-code"><code>vi backup-pwd</code></pre>



<p>You can name this file anything you like, but for the purposes of this article and the script below, I have called it &#8216;backup-pwd&#8217;.</p>



<p>Once you&#8217;ve created the password file, you can start backing up using the command below:</p>



<pre class="wp-block-code"><code>./restic -p &lt;password file> -r rclone:&lt;remote name>:&lt;remote folder> backup &lt;folder to backup></code></pre>



<p>So as an example:</p>



<pre class="wp-block-code"><code>./restic -p "backup-pwd" -r rclone:backup:mybackupfolder/mypc backup "/mnt/c/Users/Steve/Documents"</code></pre>



<p>This would backup everything from my Documents folder on my local C: drive by creating what restic calls a snapshot. If I run the same command a second time, then restic will create a new snapshot and backup any changes.</p>



<p>You can also backup a list of folders by creating a simple text file that contains a list of the folders. For example:</p>



<pre class="wp-block-code"><code>/mnt/c/Users/Steve/Documents
/mnt/c/Users/Steve/Picture</code></pre>



<p>You can save this under any name you like, but in this article and the script below I&#8217;ve used the file name of  &#8216;backup-file-list&#8217;.</p>



<p>To backup using this file, change the backup command to use the &#8211;files-from option instead of the &lt;folder to backup&gt;. As an example:</p>



<pre class="wp-block-code"><code>./restic -p "backup-pwd"-r rclone:backup:backup/dev backup --files-from "backup-file-list"</code></pre>



<p>This would backup both my Documents and Pictures folders from my local C: drive.</p>



<h4>View Snapshots</h4>



<p>Use the following command to view existing snapshots:</p>



<pre class="wp-block-code"><code>./restic -p backup-pwd -r rclone:backup:mybackupfolder/mypc snapshots</code></pre>



<h4>Restore Snapshots</h4>



<p>Use the following command to restore snapshots:</p>



<pre class="wp-block-code"><code>./restic -p "backup-pwd" -r rclone:backup:mybackupfolder/mypc restore latest --target &lt;destination folder></code></pre>



<p>Where &lt;destination folder&gt; is the local folder you would like the backup restored into. So for example:</p>



<pre class="wp-block-code"><code>./restic -p "backup-pwd" -r rclone:backup:mybackupfolder/mypc restore latest --target ./myrestoredbackup</code></pre>



<h2>Scheduling A Backup</h2>



<p>You can take things a step further by creating a backup shell script in the WSL system and adding it as a Windows Task Scheduler job. You can also include database and crontab backups in this script, or anything else you need.  For example:</p>



<pre class="wp-block-code"><code>bash ~/scripts/backup.sh</code></pre>



<p>The example bash script below might be useful as a starting point:</p>



<pre class="wp-block-preformatted">#!/bin/bash

# setup config
# where to put the db backups
BK_DEST="/root/data"
# mysql database backup login
BK_MYSQLSERVER="localhost"
BK_MYSQLUSER="&lt;backup user&gt;"
BK_MYSQLPASSWORD="&lt;backup user password&gt;"

# array of mysql databases to backup
BK_MYSQLDBS=( "db1" "db2" "etc" )
# if no databases 
# BK_MYSQLDBS=( )
echo "Starting backup"

# prepare for backup and create db backup folder if it doesn't already exist
if [ ! -d "$BK_DEST" ]; then
  # check that list of databases is not empty
  if [ -n "$BK_MYSQLDBS" ]; then
    echo " Creating local backup folder $BK_DEST"
    if ! mkdir -p $BK_DEST; then
      echo " PROBLEM CREATING BACKUP FOLDER"
      exit 1;
    fi
    echo " Creating backup folders"
    mkdir $BK_DEST/mysql
    mkdir $BK_DEST/crontabs
  fi
fi

# backup mysql databases listed in BK_MYSQLDBS
echo "Backing up databases"
for BK_DB in ${BK_MYSQLDBS[@]}; do
  echo " Processing $BK_DB"
  if ! eval "mysqldump -u$BK_MYSQLUSER -p$BK_MYSQLPASSWORD --triggers --routines --single-transaction --flush-logs $BK_DB |gzip -c &gt; $BK_DEST/mysql/$BK_DB.sql.gz"; then
    echo " PROBLEM DUMPING DATABASE"
  fi
done

echo "Running Off-site Backup"
echo " -&gt; OneDrive"
./restic -p "backup-pwd" -r rclone:backup:mybackupfolder/mypc backup --files-from "backup-file-list"
echo "Done"</pre>



<p>You will notice that the MySQL database backup just overwrites the backup file each time. This is because the restic snapshots take care of the versioning and store progressive incremental backups on the OneDrive folder until you delete them.</p>



<p><em><strong>Tip:</strong> Remember also, you can also create a log by using the Linux >> operator at the end of the scheduler action to append the script output to a log file. For example:</em></p>



<pre class="wp-block-code"><code>bash ~/scripts/backup.sh >> ~/scripts/backup.log</code></pre>



<h3>Other Useful Commands</h3>



<h4>Remove A Single Snapshot</h4>



<pre class="wp-block-code"><code>restic -p backup-pwd -r rclone:backup:mybackupfolder/mypc forget &lt;snapshot id></code></pre>



<h4>Remove older snapshots</h4>



<p>For example, delete all but the last 10 snapshots:</p>



<pre class="wp-block-code"><code>restic -p backup-pwd -r rclone:backup:mybackupfolder/mypc forget --keep-last 10</code></pre>



<h2>See Also</h2>



<p><a href="https://rclone.org">Rclone project</a></p>



<p><a href="https://restic.net/">Restic backup project</a></p>



<p><a href="https://rclone.org/onedrive/">Configuring rclone for OneDrive</a></p>



<p><a href="https://perkinstuff.com/spideroak-server-backup/">SpiderOAK Server Backup</a></p>



<hr class="wp-block-separator has-text-color has-background has-very-light-gray-background-color has-very-light-gray-color"/>



<div class="wp-block-columns">
<div class="wp-block-column" style="flex-basis:15%">
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img src="https://perkinstuff.com/wp-content/uploads/2020/06/contribute.png" alt="Buy me a coffee" class="wp-image-256" width="50" height="70"/></figure></div>
</div>



<div class="wp-block-column" style="flex-basis:85%">
<h2>Found This Useful?</h2>



<p>If you have found this useful, why not help to support the site and <a href="/buy-me-a-coffee">buy me a coffee or perhaps a cheeky beer</a>? Thanks!</p>
</div>
</div>



<p></p>



<div class="wp-block-columns">
<div class="wp-block-column" style="flex-basis:15%">
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" src="https://perkinstuff.com/wp-content/uploads/2020/10/logo-v2-90.png" alt="" class="wp-image-337" width="50" height="50"/></figure></div>
</div>



<div class="wp-block-column" style="flex-basis:85%">
<h2>Websites Built For You</h2>



<p>You may also like <a href="https://websitesbuiltforyou.com">Websites Built For You </a>which focuses on web design and development in WordPress, PHP and Javascript.</p>
</div>
</div>



<p></p>
<p>The post <a rel="nofollow" href="https://perkinstuff.com/onedrive-server-backup/">OneDrive Server Backup</a> appeared first on <a rel="nofollow" href="https://perkinstuff.com">perkinstuff.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://perkinstuff.com/onedrive-server-backup/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Gutenberg Conversion &#8211; It&#8217;s Easy!</title>
		<link>https://perkinstuff.com/gutenberg-conversion/</link>
					<comments>https://perkinstuff.com/gutenberg-conversion/#respond</comments>
		
		<dc:creator><![CDATA[Steve]]></dc:creator>
		<pubDate>Thu, 09 May 2019 09:40:51 +0000</pubDate>
				<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://www.perkinstuff.com/?p=163</guid>

					<description><![CDATA[<p>I&#8217;ve been converting sites to use the Gutenberg block editor and removing the classic editor. Unfortunately there&#8217;s no way to automatically do it to all posts / pages at once but this could be a good thing as it does mean I can check each one as I do it. Fortunately, none of my sites...</p>
<p>The post <a rel="nofollow" href="https://perkinstuff.com/gutenberg-conversion/">Gutenberg Conversion &#8211; It&#8217;s Easy!</a> appeared first on <a rel="nofollow" href="https://perkinstuff.com">perkinstuff.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>I&#8217;ve been converting sites to use the Gutenberg block editor and removing the classic editor.</p>



<p>Unfortunately there&#8217;s no way to automatically do it to all posts / pages at once but this could be a good thing as it does mean I can check each one as I do it. Fortunately, none of my sites are particularly massive!</p>



<p>It&#8217;s easy to do:</p>



<ol><li>Disable the classic editor plugin, or at least ensure you have the option &#8216;Allow User To Choose Editor&#8217; switched on.</li><li>Open up the post or page. This will add the existing content into a new &#8216;classic&#8217; block.</li><li>Select the classic block, and go to the &#8216;burger&#8217; menu in its toolbar.</li><li>From there select &#8216;Convert to blocks&#8217; and bingo!</li></ol>



<p>It really is that easy!</p>



<hr class="wp-block-separator has-text-color has-background has-very-light-gray-background-color has-very-light-gray-color"/>



<div class="wp-block-columns">
<div class="wp-block-column" style="flex-basis:15%">
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" src="https://perkinstuff.com/wp-content/uploads/2020/06/contribute.png" alt="Buy me a coffee" class="wp-image-256" width="50" height="70"/></figure></div>
</div>



<div class="wp-block-column" style="flex-basis:85%">
<h2>Found This Useful?</h2>



<p>If you have found this useful, why not help to support the site and <a href="/buy-me-a-coffee">buy me a coffee or perhaps a cheeky beer</a>? Thanks!</p>
</div>
</div>



<p></p>



<div class="wp-block-columns">
<div class="wp-block-column" style="flex-basis:15%">
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" src="https://perkinstuff.com/wp-content/uploads/2020/10/logo-v2-90.png" alt="" class="wp-image-337" width="50" height="50"/></figure></div>
</div>



<div class="wp-block-column" style="flex-basis:85%">
<h2>Websites Built For You</h2>



<p>You may also like <a href="https://websitesbuiltforyou.com">Websites Built For You </a>which focuses on web design and development in WordPress, PHP and Javascript.</p>
</div>
</div>



<p></p>
<p>The post <a rel="nofollow" href="https://perkinstuff.com/gutenberg-conversion/">Gutenberg Conversion &#8211; It&#8217;s Easy!</a> appeared first on <a rel="nofollow" href="https://perkinstuff.com">perkinstuff.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://perkinstuff.com/gutenberg-conversion/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Gutenberg &#8211; Great Stuff</title>
		<link>https://perkinstuff.com/gutenberg-great-stuff/</link>
					<comments>https://perkinstuff.com/gutenberg-great-stuff/#comments</comments>
		
		<dc:creator><![CDATA[Steve]]></dc:creator>
		<pubDate>Wed, 09 Jan 2019 09:51:34 +0000</pubDate>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://www.perkinstuff.com/?p=154</guid>

					<description><![CDATA[<p>I&#8217;ve built many WordPress sites over the years and I have to say one of my least favourite features has always been the text editor. In a nutshell, it was slow and kind of sucked and made it difficult to do much other than, well, edit text. Excited To Try I&#8217;ve played around a little...</p>
<p>The post <a rel="nofollow" href="https://perkinstuff.com/gutenberg-great-stuff/">Gutenberg &#8211; Great Stuff</a> appeared first on <a rel="nofollow" href="https://perkinstuff.com">perkinstuff.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>I&#8217;ve built many WordPress sites over the years and I have to say one of my least favourite features has always been the text editor. In a nutshell, it was slow and kind of sucked and made it difficult to do much other than, well, edit text.</p>



<h2>Excited To Try</h2>



<p>I&#8217;ve played around a little with the new Gutenberg editor as it progressed from Alpha to Beta to Live. Honestly though, I&#8217;ve always been too busy to really spend enough time on it.</p>



<p>It had great promise right from the start, and so I was excited to finally get to build a new site from scratch using it.</p>



<h2>First Outing And Already Impressed</h2>



<p>And I have to say, I am impressed. It&#8217;s much faster than the old text &#8216;classic&#8217; editor and much much more flexible. While it doesn&#8217;t go everything that the likes of Elementor and Visual Composer do (yet), it certainly gives them a run for their money for fairly basic sites.</p>



<p>The new layout also means much less scrolling up and down which I have always hated.</p>



<p>And did I mention it&#8217;s fast! Even when saving it seems almost instant!</p>



<p>Six out of five stars WordPress!</p>



<hr class="wp-block-separator has-text-color has-background has-very-light-gray-background-color has-very-light-gray-color"/>



<div class="wp-block-columns">
<div class="wp-block-column" style="flex-basis:15%">
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" src="https://perkinstuff.com/wp-content/uploads/2020/06/contribute.png" alt="Buy me a coffee" class="wp-image-256" width="50" height="70"/></figure></div>
</div>



<div class="wp-block-column" style="flex-basis:85%">
<h2>Found This Useful?</h2>



<p>If you have found this useful, why not help to support the site and <a href="/buy-me-a-coffee">buy me a coffee or perhaps a cheeky beer</a>? Thanks!</p>
</div>
</div>



<p></p>



<div class="wp-block-columns">
<div class="wp-block-column" style="flex-basis:15%">
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" src="https://perkinstuff.com/wp-content/uploads/2020/10/logo-v2-90.png" alt="" class="wp-image-337" width="50" height="50"/></figure></div>
</div>



<div class="wp-block-column" style="flex-basis:85%">
<h2>Websites Built For You</h2>



<p>You may also like <a href="https://websitesbuiltforyou.com">Websites Built For You </a>which focuses on web design and development in WordPress, PHP and Javascript.</p>
</div>
</div>



<p></p>
<p>The post <a rel="nofollow" href="https://perkinstuff.com/gutenberg-great-stuff/">Gutenberg &#8211; Great Stuff</a> appeared first on <a rel="nofollow" href="https://perkinstuff.com">perkinstuff.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://perkinstuff.com/gutenberg-great-stuff/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Download Floreant POS Receipt Reports For Epson TM-U220 Printer</title>
		<link>https://perkinstuff.com/floreant-pos-receipt-reports-for-epson-u220-printer-free-download/</link>
					<comments>https://perkinstuff.com/floreant-pos-receipt-reports-for-epson-u220-printer-free-download/#comments</comments>
		
		<dc:creator><![CDATA[Steve]]></dc:creator>
		<pubDate>Sat, 08 Dec 2018 01:02:43 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<guid isPermaLink="false">https://www.perkinstuff.com/?p=124</guid>

					<description><![CDATA[<p>I spent a few days recently helping a local restaurant install a new POS system. Firstly, I had to identify which system to use. To do this, I started by looking at the available open source solutions and was pleasantly surprised by what I found. There are quite a few out there, but the system...</p>
<p>The post <a rel="nofollow" href="https://perkinstuff.com/floreant-pos-receipt-reports-for-epson-u220-printer-free-download/">Download Floreant POS Receipt Reports For Epson TM-U220 Printer</a> appeared first on <a rel="nofollow" href="https://perkinstuff.com">perkinstuff.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>I spent a few days recently helping a local restaurant install a new POS system.</p>



<p>Firstly, I had to identify which system to use. To do this, I started by looking at the available open source solutions and was pleasantly surprised by what I found. There are quite a few out there, but the system that stood out by a long way was <a href="http://floreant.org">Floreant POS</a>.</p>



<p><a href="http://floreant.org">Floreant POS</a> is a completely free and very capable open source POS system produced by a company called Oro Cube. They make their money by providing paid support and development services. Floreant also has a big brother called ORO POS which is available for a very reasonable monthly subscription.</p>



<p>After evaluating the differences between the two systems, we concluded that Floreant delivered everything that was required for smooth day to day operations at the restaurant.</p>



<h2>Reformatting The Receipt Reports</h2>



<p>One &#8216;problem&#8217; that we hit was that the default receipt reports were formatted for a wider printer than the Epson TM-U220 printers already installed at the restaurant. Fortunately, Floreant allows the possibility of modifying the receipt reports.</p>



<p>There isn&#8217;t a huge amount of information about how to do it available though, so it took a bit of effort to work it out based on numerous snippets found through Google. It&#8217;s actually very simple, although technically a little awkward as it requires an older version of the Java JDK and Jasper Reports.</p>



<p>There&#8217;s a video on setting up the environment here: <a href="https://www.youtube.com/watch?v=ppQl_VPs4BQ">https://www.youtube.com/watch?v=ppQl_VPs4BQ</a></p>



<p>So, off I went and set up a virtual machine just for the job.</p>



<p>Once set up, it didn&#8217;t take long to reformat the reports to the required width. We also made some other changes such as larger text for the kitchen printer.</p>



<h2>Download</h2>



<p>I thought it would be useful to provide the modified reports for anyone else out there who wants to use Floreant with Epson U220 or similar receipt printers. So without more ado, you can download them below:</p>



<p><a href="https://perkinstuff.com/wp-content/uploads/2018/12/floreant-1.4-1770-receipt-reports-for-epson-u220.zip">Download floreant-1.4-1770-receipt-reports-for-epson-u220.zip</a></p>



<p>They&#8217;re provided &#8216;as is&#8217; and have been tested with Floreant 1.4 build 1707 although they may well work with other versions.</p>



<h2>Installation</h2>



<p>To install the modified reports, first extract the files from the ZIP file you downloaded above. This will create a folder with the same name as the ZIP archive. Copy the contents of this folder into the &#8216;config/printerlayouts&#8217; folder in your Floreant installation folder overwriting the existing files there. Shutdown and restart Floreant and you are be good to go!</p>



<p>If you have any questions about this or Floreant in general, please make a comment below and I will try to answer as best you can.</p>



<hr class="wp-block-separator has-text-color has-background has-very-light-gray-background-color has-very-light-gray-color"/>



<div class="wp-block-columns">
<div class="wp-block-column" style="flex-basis:15%">
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" src="https://perkinstuff.com/wp-content/uploads/2020/06/contribute.png" alt="Buy me a coffee" class="wp-image-256" width="50" height="70"/></figure></div>
</div>



<div class="wp-block-column" style="flex-basis:85%">
<h2>Found This Useful?</h2>



<p>If you have found this useful, why not help to support the site and <a href="/buy-me-a-coffee">buy me a coffee or perhaps a cheeky beer</a>? Thanks!</p>
</div>
</div>



<p></p>



<div class="wp-block-columns">
<div class="wp-block-column" style="flex-basis:15%">
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" src="https://perkinstuff.com/wp-content/uploads/2020/10/logo-v2-90.png" alt="" class="wp-image-337" width="50" height="50"/></figure></div>
</div>



<div class="wp-block-column" style="flex-basis:85%">
<h2>Websites Built For You</h2>



<p>You may also like <a href="https://websitesbuiltforyou.com">Websites Built For You </a>which focuses on web design and development in WordPress, PHP and Javascript.</p>
</div>
</div>



<p></p>
<p>The post <a rel="nofollow" href="https://perkinstuff.com/floreant-pos-receipt-reports-for-epson-u220-printer-free-download/">Download Floreant POS Receipt Reports For Epson TM-U220 Printer</a> appeared first on <a rel="nofollow" href="https://perkinstuff.com">perkinstuff.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://perkinstuff.com/floreant-pos-receipt-reports-for-epson-u220-printer-free-download/feed/</wfw:commentRss>
			<slash:comments>9</slash:comments>
		
		
			</item>
		<item>
		<title>Run A Cron Job With A &#8216;Random&#8217; Time Interval</title>
		<link>https://perkinstuff.com/run-a-cron-job-with-a-random-time-interval/</link>
					<comments>https://perkinstuff.com/run-a-cron-job-with-a-random-time-interval/#respond</comments>
		
		<dc:creator><![CDATA[Steve]]></dc:creator>
		<pubDate>Wed, 05 Dec 2018 15:29:42 +0000</pubDate>
				<category><![CDATA[Email]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Servers]]></category>
		<guid isPermaLink="false">https://www.perkinstuff.com/?p=116</guid>

					<description><![CDATA[<p>Here&#8217;s an interesting little Linux cron timing trick I found. For one reason and another, I had a requirement to run a test cron job but with irregular timing to simulate the real scenario of users connecting irregularly. The trick is to run the cron job on a normal regular interval, but then introduce a...</p>
<p>The post <a rel="nofollow" href="https://perkinstuff.com/run-a-cron-job-with-a-random-time-interval/">Run A Cron Job With A &#8216;Random&#8217; Time Interval</a> appeared first on <a rel="nofollow" href="https://perkinstuff.com">perkinstuff.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Here&#8217;s an interesting little Linux cron timing trick I found.</p>



<p>For one reason and another, I had a requirement to run a test cron job but with irregular timing to simulate the real scenario of users connecting irregularly.</p>



<p>The trick is to run the cron job on a normal regular interval, but then introduce a pause before it delivers the payload. So in the example below, the job runs every 10 minutes but pauses between 0 and 590 seconds. Thus making it appear semi-random.</p>



<p>First create a simple bash shell script, in say /home/me/demo.sh:</p>



<pre class="wp-block-code"><code>#!/bin/bash
sleep $(($RANDOM%590))s
echo "Hi this email was sent at ${CURRENTDATE}"</code></pre>



<p>The second line tells the script to wait for a random amount of time between 0 and 590 seconds.</p>



<p>It&#8217;s important to note that 590 seconds is slightly less than the 10 minute (600 seconds) interval we use in the crontab below which gives a maximum of 10 seconds before the next job starts. Unless you specifically want overlapping jobs, then it&#8217;s a good idea to adjust this to allow enough time for each job to complete before the next one!</p>



<p>Next, edit your crontab file:</p>



<pre class="wp-block-code"><code>crontab -e</code></pre>



<p>And add the lines:</p>



<pre class="wp-block-code"><code>MAILTO="&lt;email@domain.tld>"
10 * * * * * bash /home/me/demo.sh</code></pre>



<p>This will run the script and send an email at a random time every 10 minutes or so.</p>



<p>Obviously, you can add your own commands as required.</p>



<p>And as a Brucie bonus, note the MAILTO= setting on the first line. If you ever wondered how to get email notifications from your cron jobs, this is one simple way that will send all of the output created by the job to the email address configured!</p>



<p>Or you can suppress any emails by setting it to MAILTO=&#8221;&#8221;.</p>



<p>And anyway that&#8217;s it! Happy cron-ing!</p>



<hr class="wp-block-separator has-text-color has-background has-very-light-gray-background-color has-very-light-gray-color"/>



<div class="wp-block-columns">
<div class="wp-block-column" style="flex-basis:15%">
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" src="https://perkinstuff.com/wp-content/uploads/2020/06/contribute.png" alt="Buy me a coffee" class="wp-image-256" width="50" height="70"/></figure></div>
</div>



<div class="wp-block-column" style="flex-basis:85%">
<h2>Found This Useful?</h2>



<p>If you have found this useful, why not help to support the site and <a href="/buy-me-a-coffee">buy me a coffee or perhaps a cheeky beer</a>? Thanks!</p>
</div>
</div>



<p></p>



<div class="wp-block-columns">
<div class="wp-block-column" style="flex-basis:15%">
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" src="https://perkinstuff.com/wp-content/uploads/2020/10/logo-v2-90.png" alt="" class="wp-image-337" width="50" height="50"/></figure></div>
</div>



<div class="wp-block-column" style="flex-basis:85%">
<h2>Websites Built For You</h2>



<p>You may also like <a href="https://websitesbuiltforyou.com">Websites Built For You </a>which focuses on web design and development in WordPress, PHP and Javascript.</p>
</div>
</div>



<p></p>
<p>The post <a rel="nofollow" href="https://perkinstuff.com/run-a-cron-job-with-a-random-time-interval/">Run A Cron Job With A &#8216;Random&#8217; Time Interval</a> appeared first on <a rel="nofollow" href="https://perkinstuff.com">perkinstuff.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://perkinstuff.com/run-a-cron-job-with-a-random-time-interval/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Post To A Facebook Group As A Facebook Page</title>
		<link>https://perkinstuff.com/how-to-post-to-a-facebook-group-as-a-facebook-page/</link>
					<comments>https://perkinstuff.com/how-to-post-to-a-facebook-group-as-a-facebook-page/#respond</comments>
		
		<dc:creator><![CDATA[Steve]]></dc:creator>
		<pubDate>Fri, 01 Jun 2018 13:22:24 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<guid isPermaLink="false">https://www.perkinstuff.com/?p=109</guid>

					<description><![CDATA[<p>If you manage a Facebook page, you can post either as yourself or as the page. This can be very useful in some cases. Unfortunately for a long time this little trick hasn&#8217;t been possible in a Facebook group. The only way seemed to be to set up a separate Facebook acccount in the name...</p>
<p>The post <a rel="nofollow" href="https://perkinstuff.com/how-to-post-to-a-facebook-group-as-a-facebook-page/">How To Post To A Facebook Group As A Facebook Page</a> appeared first on <a rel="nofollow" href="https://perkinstuff.com">perkinstuff.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>If you manage a Facebook page, you can post either as yourself or as the page. This can be very useful in some cases. Unfortunately for a long time this little trick hasn&#8217;t been possible in a Facebook group.</p>



<p>The only way seemed to be to set up a separate Facebook acccount in the name of the group.</p>



<p>Messy, inconvenient and probably technically also against Facebook rules.</p>



<h2>The Facebook Page Way</h2>



<p>Then I found this post. Not perfect but a lot simpler than logging in and out all the time if you also have a page alongside your group, or want to set one up:</p>



<p><a href="https://thedigiterati.com/link-facebook-group-to-page/">How To Link A Facebook Group To A  Page</a></p>



<p>Anyway, hope someone finds it useful! Enjoy posting!</p>



<hr class="wp-block-separator has-text-color has-background has-very-light-gray-background-color has-very-light-gray-color"/>



<div class="wp-block-columns">
<div class="wp-block-column" style="flex-basis:15%">
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" src="https://perkinstuff.com/wp-content/uploads/2020/06/contribute.png" alt="Buy me a coffee" class="wp-image-256" width="50" height="70"/></figure></div>
</div>



<div class="wp-block-column" style="flex-basis:85%">
<h2>Found This Useful?</h2>



<p>If you have found this useful, why not help to support the site and <a href="/buy-me-a-coffee">buy me a coffee or perhaps a cheeky beer</a>? Thanks!</p>
</div>
</div>



<p></p>



<div class="wp-block-columns">
<div class="wp-block-column" style="flex-basis:15%">
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" src="https://perkinstuff.com/wp-content/uploads/2020/10/logo-v2-90.png" alt="" class="wp-image-337" width="50" height="50"/></figure></div>
</div>



<div class="wp-block-column" style="flex-basis:85%">
<h2>Websites Built For You</h2>



<p>You may also like <a href="https://websitesbuiltforyou.com">Websites Built For You </a>which focuses on web design and development in WordPress, PHP and Javascript.</p>
</div>
</div>



<p></p>
<p>The post <a rel="nofollow" href="https://perkinstuff.com/how-to-post-to-a-facebook-group-as-a-facebook-page/">How To Post To A Facebook Group As A Facebook Page</a> appeared first on <a rel="nofollow" href="https://perkinstuff.com">perkinstuff.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://perkinstuff.com/how-to-post-to-a-facebook-group-as-a-facebook-page/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Completely Disable ClamAV In iRedMail</title>
		<link>https://perkinstuff.com/completely-disable-clamav-iredmail/</link>
					<comments>https://perkinstuff.com/completely-disable-clamav-iredmail/#comments</comments>
		
		<dc:creator><![CDATA[Steve]]></dc:creator>
		<pubDate>Tue, 22 May 2018 16:30:13 +0000</pubDate>
				<category><![CDATA[Email]]></category>
		<category><![CDATA[Servers]]></category>
		<guid isPermaLink="false">https://www.perkinstuff.com/?p=98</guid>

					<description><![CDATA[<p>ClamAV can be a memory hog at the best of times. If your mail server is feeling the pinch then there is a useful article in iRedMail&#8217;s own documentation on disabling it: Completely Disable ClamAV In iRedMail However, I have found that whilst the steps work, they don&#8217;t go quite far enough. The problem is...</p>
<p>The post <a rel="nofollow" href="https://perkinstuff.com/completely-disable-clamav-iredmail/">Completely Disable ClamAV In iRedMail</a> appeared first on <a rel="nofollow" href="https://perkinstuff.com">perkinstuff.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>ClamAV can be a memory hog at the best of times. If your mail server is feeling the pinch then there is a useful article in iRedMail&#8217;s own documentation on disabling it:</p>



<p><a href="https://docs.iredmail.org/completely.disable.amavisd.clamav.spamassassin.html">Completely Disable ClamAV In iRedMail</a></p>



<p>However, I have found that whilst the steps work, they don&#8217;t go quite far enough. The problem is that although the changes stop iRedMail from scanning mails for viruses, they leave ClamAV running in the background.</p>



<p>This means it can still eat up excessive amounts of memory getting ready to do, well nothing!</p>



<h2>Completely Disable ClamAV</h2>



<p>Just one extra step can completely stop the unwanted service and free up all that precious memory:</p>



<pre class="wp-block-preformatted">sudo update-rc.d clamav-daemon disable
sudo update-rc.d clamav-freshclam disable</pre>



<p>Thanks for reading, only a short article but I spent a lot of time working it out so hope it&#8217;s useful to some people!</p>



<hr class="wp-block-separator has-text-color has-background has-very-light-gray-background-color has-very-light-gray-color"/>



<div class="wp-block-columns">
<div class="wp-block-column" style="flex-basis:15%">
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" src="https://perkinstuff.com/wp-content/uploads/2020/06/contribute.png" alt="Buy me a coffee" class="wp-image-256" width="50" height="70"/></figure></div>
</div>



<div class="wp-block-column" style="flex-basis:85%">
<h2>Found This Useful?</h2>



<p>If you have found this useful, why not help to support the site and <a href="/buy-me-a-coffee">buy me a coffee or perhaps a cheeky beer</a>? Thanks!</p>
</div>
</div>



<p></p>



<div class="wp-block-columns">
<div class="wp-block-column" style="flex-basis:15%">
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" src="https://perkinstuff.com/wp-content/uploads/2020/10/logo-v2-90.png" alt="" class="wp-image-337" width="50" height="50"/></figure></div>
</div>



<div class="wp-block-column" style="flex-basis:85%">
<h2>Websites Built For You</h2>



<p>You may also like <a href="https://websitesbuiltforyou.com">Websites Built For You </a>which focuses on web design and development in WordPress, PHP and Javascript.</p>
</div>
</div>



<p></p>
<p>The post <a rel="nofollow" href="https://perkinstuff.com/completely-disable-clamav-iredmail/">Completely Disable ClamAV In iRedMail</a> appeared first on <a rel="nofollow" href="https://perkinstuff.com">perkinstuff.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://perkinstuff.com/completely-disable-clamav-iredmail/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title>Nullmailer: A Simple Mail Transfer Agent</title>
		<link>https://perkinstuff.com/nullmailer-simple-mail-transfer-agent/</link>
					<comments>https://perkinstuff.com/nullmailer-simple-mail-transfer-agent/#respond</comments>
		
		<dc:creator><![CDATA[Steve]]></dc:creator>
		<pubDate>Fri, 18 May 2018 06:20:21 +0000</pubDate>
				<category><![CDATA[Email]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Servers]]></category>
		<guid isPermaLink="false">https://www.perkinstuff.com/?p=72</guid>

					<description><![CDATA[<p>Sometimes all you want to do is to allow your server to send emails. Postfix, exim and sendmail can all be configured to do this but they are complex to configure and relatively heavy-weight just to be used as a simple outgoing message transfer agent (MTA). This is where nullmailer comes in handy. Nullmailer is...</p>
<p>The post <a rel="nofollow" href="https://perkinstuff.com/nullmailer-simple-mail-transfer-agent/">Nullmailer: A Simple Mail Transfer Agent</a> appeared first on <a rel="nofollow" href="https://perkinstuff.com">perkinstuff.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Sometimes all you want to do is to allow your server to send emails. Postfix, exim and sendmail can all be configured to do this but they are complex to configure and relatively heavy-weight just to be used as a simple outgoing message transfer agent (MTA). This is where nullmailer comes in handy.</p>



<p>Nullmailer is a tiny MTA that is a drop in replacement for the more complex mailers mentioned above. All that it does is accept outgoing mails and forward them via your normal SMTP mail relay server. The examples in this article are based on Debian Linux but should be helpful with other distros as well.</p>



<p>It&#8217;s easy to install:</p>



<pre class="wp-block-preformatted">sudo apt-get install nullmailer</pre>



<p>Any other mail transfer agent you have installed will be removed as part of the install process.</p>



<h2>Configuration (/etc/nullmailer)</h2>



<p>Once installed you can modify the configuration files in /etc/nullmailer.</p>



<h3>/etc/nullmailer/remotes</h3>



<p>This is where you configure the remote mail relay server that your outgoing emails are forwarded through:</p>



<pre class="wp-block-preformatted">&lt;your relay mailserver&gt; smtp --starttls --insecure --port=&lt;portno&gt; --user=&lt;username&gt; --pass=&lt;password&gt;</pre>



<p>If you have control over the relay server then I find it easier to leave off the &#8211;user and &#8211;pass options and instead whitelist the sender IP address.</p>



<h3>/etc/nullmailer/helohost</h3>



<p>This is where you configure how your server will identify itself when connecting to the remote relay host. This is used when connecting to the remote relay server and literally controls the name used in the SMTP HELO command:</p>



<pre class="wp-block-preformatted">myserver.domain.tld</pre>



<p>Will connect to the remote relay server using:</p>



<pre class="wp-block-preformatted">HELO myserver.domain.tld</pre>



<p>It&#8217;s best to use the fully qualified domain name of the server here, as defined in DNS. Ideally also add a PTR (reverse lookup) record that resolves to the same.</p>



<p>And that&#8217;s all! Just a little bit easier than postfix, sendmail or exim!</p>



<p>There are other configuration options as well, but I&#8217;ve never found them necessary. There is a link to more information about that at the end of this article.</p>



<h2>Testing</h2>



<p>You can send a simple test email from the command prompt using the following:</p>



<pre class="wp-block-preformatted">mail -s "Some subject" -a "From: &lt;your from email address&gt;" &lt;your to email address&gt;</pre>



<p>so as an example</p>



<pre class="wp-block-preformatted">mail -s "Some subject" -a "From: &lt;steve@senderaddress.tld&gt;" &lt;test@receipientaddress.tld&gt;</pre>



<p>You will then be prompted to enter a Cc: address (use ENTER to leave blank) and the email content (use CTRL+D to finish). Hopefully if you have everything set up correctly, the email will arrive in your inbox. It&#8217;s a good idea to also test using an external recipient mailbox located on another server just to ensure that the emails are being relayed correctly.</p>



<h2>Mail Queue</h2>



<p>All mails sent through nullmailer are processed into the mail queue directory. On Debian this is in /etc/spool/nullmailer/queue.</p>



<p>There is no timeout on sending mails, so if there is a problem with delivery it will keep retrying forever. The simple solution to this is a daily cron job such as below which will delete all emails in the queue older than 24 hours:</p>



<pre class="wp-block-preformatted">find /var/spool/nullmailer/queue -mindepth 1 -mtime +1 -delete</pre>



<p>You could also modify this to just copy the mails somewhere else for your perusal. In my experience&nbsp;it&#8217;s not necessary though as it&#8217;s only occasional system alerts using email address such as root@localhost that get stuck.</p>



<h2>Need More?</h2>



<p>There are some great articles on using nullmailer that go into a lot more technical detail at&nbsp;<a href="http://troubleshooters.com/linux/nullmailer/#_Configuring_Nullmailer">http://troubleshooters.com/linux/nullmailer/#_Configuring_Nullmailer</a></p>



<hr class="wp-block-separator has-text-color has-background has-very-light-gray-background-color has-very-light-gray-color"/>



<div class="wp-block-columns">
<div class="wp-block-column" style="flex-basis:15%">
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" src="https://perkinstuff.com/wp-content/uploads/2020/06/contribute.png" alt="Buy me a coffee" class="wp-image-256" width="50" height="70"/></figure></div>
</div>



<div class="wp-block-column" style="flex-basis:85%">
<h2>Found This Useful?</h2>



<p>If you have found this useful, why not help to support the site and <a href="/buy-me-a-coffee">buy me a coffee or perhaps a cheeky beer</a>? Thanks!</p>
</div>
</div>



<p></p>



<div class="wp-block-columns">
<div class="wp-block-column" style="flex-basis:15%">
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" src="https://perkinstuff.com/wp-content/uploads/2020/10/logo-v2-90.png" alt="" class="wp-image-337" width="50" height="50"/></figure></div>
</div>



<div class="wp-block-column" style="flex-basis:85%">
<h2>Websites Built For You</h2>



<p>You may also like <a href="https://websitesbuiltforyou.com">Websites Built For You </a>which focuses on web design and development in WordPress, PHP and Javascript.</p>
</div>
</div>



<p></p>
<p>The post <a rel="nofollow" href="https://perkinstuff.com/nullmailer-simple-mail-transfer-agent/">Nullmailer: A Simple Mail Transfer Agent</a> appeared first on <a rel="nofollow" href="https://perkinstuff.com">perkinstuff.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://perkinstuff.com/nullmailer-simple-mail-transfer-agent/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SpiderOAK Server Backup</title>
		<link>https://perkinstuff.com/spideroak-server-backup/</link>
					<comments>https://perkinstuff.com/spideroak-server-backup/#respond</comments>
		
		<dc:creator><![CDATA[Steve]]></dc:creator>
		<pubDate>Wed, 09 May 2018 05:46:59 +0000</pubDate>
				<category><![CDATA[Backup]]></category>
		<category><![CDATA[Servers]]></category>
		<guid isPermaLink="false">https://www.perkinstuff.com/?p=33</guid>

					<description><![CDATA[<p>I manage quite a few servers for various clients. Most of them are fairly small in size and backup is done via a bash script I wrote many years ago. For anyone who&#8217;s interested, I will publish the full script in a separate post soon. The script assembles files, exports databases and crontabs and compresses...</p>
<p>The post <a rel="nofollow" href="https://perkinstuff.com/spideroak-server-backup/">SpiderOAK Server Backup</a> appeared first on <a rel="nofollow" href="https://perkinstuff.com">perkinstuff.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>I manage quite a few servers for various clients. Most of them are fairly small in size and backup is done via a bash script I wrote many years ago. For anyone who&#8217;s interested, I will publish the full script in a separate post soon.</p>



<p>The script assembles files, exports databases and crontabs and compresses everything into a single gzipped tar archive.&nbsp;It then encrypts the archive and uploads the encrypted data via ncftp to an offsite backup host.</p>



<p>This works great for a while but as the data grows so does the size of the backup.</p>



<p>As an aside to this if anyone is looking for a great FTP backup service I can thoroughly recommend <a href="https://www.adrive.com">ADrive</a>&nbsp;as being very reliable and excellent value for money.</p>



<h2>Simple Incremental Encrypted Backups</h2>



<p>As they do, servers tend to grow and the one big file approach ends up with&nbsp;bigger and bigger backup archives that fail to upload more and more frequently.</p>



<p>So I started looking for a better way. For me it had to be 1) simple 2) incremental 3) encrypted and 4) (if possible) have a nice desktop client that I could access it through.</p>



<p>I&#8217;d recently started using SpiderOAK as a replacement for Dropbox due to privacy concerns.&nbsp;While searching for a simple server backup solution I came across their command line documentation.</p>



<p>So I thought I&#8217;d give it a go. Bingo! It was the server backup solution I&#8217;d been looking for.</p>



<p>So here it is my quick guide to setting up simple server backup using the SpiderOakONE command line utility on the Debian Linux operating system.</p>



<h2>Installation</h2>



<p>This guide assumes you already have a SpiderOakONE account configured and ready to go.</p>



<p>The client is easy to install, you just need to add in the SpiderOak repository, their gpg key and apt-get away:</p>



<pre class="wp-block-preformatted">echo 'deb http://apt.spideroak.com/debian/ stable non-free' &gt;&gt; /etc/apt/sources.list
gpg --keyserver pgpkeys.mit.edu --recv-key 573E3D1C51AE1B3D
gpg -a --export 573E3D1C51AE1B3D | sudo apt-key add -
apt-get update
apt-get install spideroakone</pre>



<p>Now that you have the client installed, you need to connect it to your SpiderOak account. Enter the following and follow the on-screen prompts:</p>



<pre class="wp-block-preformatted">SpiderOakONE --setup=-</pre>



<p>Once you&#8217;ve entered the requested information, it will start to synchronise with the SpiderOak servers. This can take a few minutes so probably a good time to get yourself a coffee!</p>



<p>Talking about coffee, if you find this or any of the other posts on my site helpful, perhaps you&#8217;d like to (shameless plug coming up) buy me one as well! There&#8217;s a link at the bottom of the post.</p>



<h2>Running A Backup</h2>



<p>Ok, so now that you have everything installed and ready to go, how do you run a backup. The simplest way is via the comamnd line, so for example:</p>



<pre class="wp-block-preformatted">SpiderOakONE --backup=/var/www</pre>



<p>Would back up the contents of /var/www directory to SpiderOak&#8217;s encrypted backup servers.</p>



<h2>Scheduling A Backup</h2>



<p>You can take things a step further by creating a backup script and scheduling it as a cron job. You can also include database and crontab backups in this script, or anything else you need. The example bash script below might be useful as a starting point:</p>



<pre class="wp-block-preformatted">#!/bin/bash

# setup config
# where to put the db backups
BK_DEST="/root/data"
# mysql database backup login
BK_MYSQLSERVER="localhost"
BK_MYSQLUSER="&lt;backup user&gt;"
BK_MYSQLPASSWORD="&lt;backup user password&gt;"

# array of mysql databases to backup
BK_MYSQLDBS=( "db1" "db2" "etc" )
# if no databases 
# BK_MYSQLDBS=( )
echo "Starting backup"

# prepare for backup and create db backup folder if it doesn't already exist
if [ ! -d "$BK_DEST" ]; then
  # check that list of databases is not empty
  if [ -n "$BK_MYSQLDBS" ]; then
    echo " Creating local backup folder $BK_DEST"
    if ! mkdir -p $BK_DEST; then
      echo " PROBLEM CREATING BACKUP FOLDER"
      exit 1;
    fi
    echo " Creating backup folders"
    mkdir $BK_DEST/mysql
    mkdir $BK_DEST/crontabs
  fi
fi

# backup mysql databases listed in BK_MYSQLDBS
echo "Backing up databases"
for BK_DB in ${BK_MYSQLDBS[@]}; do
  echo " Processing $BK_DB"
  if ! eval "mysqldump -u$BK_MYSQLUSER -p$BK_MYSQLPASSWORD --triggers --routines --single-transaction --flush-logs $BK_DB |gzip -c &gt; $BK_DEST/mysql/$BK_DB.sql.gz"; then
    echo " PROBLEM DUMPING DATABASE"
  fi
done

# spideroak
SpiderOakONE --backup=$BK_DEST
SpiderOakONE --backup=/var/www
SpiderOakONE --backup=/etc</pre>



<p>You will notice that the MySQL database backup just overwrites the backup file each time. This is because the SpiderOak client takes care of the versioning and stores progressive incremental backups on their servers until you delete them.</p>



<h2>Email Notifications</h2>



<p>You can set up cron to email you the results of the backup. Nullmailer is my favourite and you can find more information that <a href="/nullmailer-simple-mail-transfer-agent/">here</a>.</p>



<p>The SpiderOak client also comes with all kinds of advanced backup commands including their own scheduling system but those are way beyond the scope of this article. Keeping it simple works for me, but you can find more by visiting the SpiderOak&nbsp;<a href="https://support.spideroak.com/hc/en-us/sections/115000565766-Command-Line">Command Line Reference</a>&nbsp;documention.</p>



<p>Thanks for reading!</p>



<hr class="wp-block-separator has-text-color has-background has-very-light-gray-background-color has-very-light-gray-color"/>



<div class="wp-block-columns">
<div class="wp-block-column" style="flex-basis:15%">
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" src="https://perkinstuff.com/wp-content/uploads/2020/06/contribute.png" alt="Buy me a coffee" class="wp-image-256" width="50" height="70"/></figure></div>
</div>



<div class="wp-block-column" style="flex-basis:85%">
<h2>Found This Useful?</h2>



<p>If you have found this useful, why not help to support the site and <a href="/buy-me-a-coffee">buy me a coffee or perhaps a cheeky beer</a>? Thanks!</p>
</div>
</div>



<p></p>



<div class="wp-block-columns">
<div class="wp-block-column" style="flex-basis:15%">
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" src="https://perkinstuff.com/wp-content/uploads/2020/10/logo-v2-90.png" alt="" class="wp-image-337" width="50" height="50"/></figure></div>
</div>



<div class="wp-block-column" style="flex-basis:85%">
<h2>Websites Built For You</h2>



<p>You may also like <a href="https://websitesbuiltforyou.com">Websites Built For You </a>which focuses on web design and development in WordPress, PHP and Javascript.</p>
</div>
</div>



<p></p>
<p>The post <a rel="nofollow" href="https://perkinstuff.com/spideroak-server-backup/">SpiderOAK Server Backup</a> appeared first on <a rel="nofollow" href="https://perkinstuff.com">perkinstuff.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://perkinstuff.com/spideroak-server-backup/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Mostly Adequate Functional Programming Guide</title>
		<link>https://perkinstuff.com/mostly-adequate-functional-programming-guide/</link>
					<comments>https://perkinstuff.com/mostly-adequate-functional-programming-guide/#comments</comments>
		
		<dc:creator><![CDATA[Steve]]></dc:creator>
		<pubDate>Tue, 08 May 2018 02:38:25 +0000</pubDate>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://www.perkinstuff.com/?p=19</guid>

					<description><![CDATA[<p>Here&#8217;s a useful link for you. If it&#8217;s got seagulls it&#8217;s got to be good, right? Let&#8217;s start with a touch of insanity. Here is a seagull application. When flocks conjoin they become a larger flock, and when they breed, they increase by the number of seagulls with whom they&#8217;re breeding. Now, this is not...</p>
<p>The post <a rel="nofollow" href="https://perkinstuff.com/mostly-adequate-functional-programming-guide/">Mostly Adequate Functional Programming Guide</a> appeared first on <a rel="nofollow" href="https://perkinstuff.com">perkinstuff.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Here&#8217;s a useful link for you. If it&#8217;s got seagulls it&#8217;s got to be good, right?</p>



<blockquote class="wp-block-quote"><p>Let&#8217;s start with a touch of insanity. Here is a seagull application. When flocks conjoin they become a larger flock, and when they breed, they increase by the number of seagulls with whom they&#8217;re breeding. Now, this is not intended to be good Object-Oriented code, mind you, it is here to highlight the perils of our modern, assignment based approach.&#8221;<br>&#8211; Professor Franklin Frisby</p></blockquote>



<p>A recommended read for anyone interested in learning about function programming.</p>



<p><a href="https://mostly-adequate.gitbooks.io/mostly-adequate-guide/">Professor Frisby&#8217;s Most Adequate Guide To Functional Programming</a></p>



<p>Thanks for reading!</p>



<hr class="wp-block-separator has-text-color has-background has-very-light-gray-background-color has-very-light-gray-color"/>



<div class="wp-block-columns">
<div class="wp-block-column" style="flex-basis:15%">
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" src="https://perkinstuff.com/wp-content/uploads/2020/06/contribute.png" alt="Buy me a coffee" class="wp-image-256" width="50" height="70"/></figure></div>
</div>



<div class="wp-block-column" style="flex-basis:85%">
<h2>Found This Useful?</h2>



<p>If you have found this useful, why not help to support the site and <a href="/buy-me-a-coffee">buy me a coffee or perhaps a cheeky beer</a>? Thanks!</p>
</div>
</div>



<p></p>



<div class="wp-block-columns">
<div class="wp-block-column" style="flex-basis:15%">
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" src="https://perkinstuff.com/wp-content/uploads/2020/10/logo-v2-90.png" alt="" class="wp-image-337" width="50" height="50"/></figure></div>
</div>



<div class="wp-block-column" style="flex-basis:85%">
<h2>Websites Built For You</h2>



<p>You may also like <a href="https://websitesbuiltforyou.com">Websites Built For You </a>which focuses on web design and development in WordPress, PHP and Javascript.</p>
</div>
</div>



<p></p>
<p>The post <a rel="nofollow" href="https://perkinstuff.com/mostly-adequate-functional-programming-guide/">Mostly Adequate Functional Programming Guide</a> appeared first on <a rel="nofollow" href="https://perkinstuff.com">perkinstuff.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://perkinstuff.com/mostly-adequate-functional-programming-guide/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
