<?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>Debian &#8211; Diary of an Emacs tragic</title>
	<atom:link href="https://emacstragic.net/category/debian-2/feed/" rel="self" type="application/rss+xml" />
	<link>https://emacstragic.net</link>
	<description>Jason Lewis</description>
	<lastBuildDate>Fri, 25 Jul 2025 00:54:12 +0000</lastBuildDate>
	<language>en-AU</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://emacstragic.net/wp-content/uploads/2018/12/cropped-jason-lewis-profile-picture-square-150x150.jpg</url>
	<title>Debian &#8211; Diary of an Emacs tragic</title>
	<link>https://emacstragic.net</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">38469313</site>	<item>
		<title>GDM won&#8217;t log into a Wayland session on Debian with NVIDIA? Here&#8217;s the Fix</title>
		<link>https://emacstragic.net/debian-2/gdm-wont-log-into-a-wayland-session-on-debian-with-nvidia-heres-the-fix/</link>
					<comments>https://emacstragic.net/debian-2/gdm-wont-log-into-a-wayland-session-on-debian-with-nvidia-heres-the-fix/#respond</comments>
		
		<dc:creator><![CDATA[Jason]]></dc:creator>
		<pubDate>Fri, 25 Jul 2025 00:54:12 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian Trixie]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[gdm]]></category>
		<category><![CDATA[nvidia]]></category>
		<category><![CDATA[wayland]]></category>
		<guid isPermaLink="false">https://emacstragic.net/?p=1884</guid>

					<description><![CDATA[Are you unable to log into wayland on debian in GDM? GDM doesn&#8217;t even give you the option? Turns out that GDM silently disables wayland if it detects the nvidia driver is installed. The solution is to override the upstream udev rule that prevents wayland starting: &#8220;gnome&#8221; should be an option now when logging in [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Are you unable to log into wayland on debian in GDM? GDM doesn&#8217;t even give you the option?</p>



<p>Turns out that GDM silently disables wayland if it detects the nvidia driver is installed.</p>



<p>The solution is to override the upstream udev rule that prevents wayland starting:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
# ln -s /dev/null /etc/udev/rules.d/61-gdm.rules
# reboot

</pre></div>


<p>&#8220;gnome&#8221; should be an option now when logging in from gdm (click the cog icon).</p>
]]></content:encoded>
					
					<wfw:commentRss>https://emacstragic.net/debian-2/gdm-wont-log-into-a-wayland-session-on-debian-with-nvidia-heres-the-fix/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1884</post-id>	</item>
		<item>
		<title>updating discord .deb one-liner</title>
		<link>https://emacstragic.net/debian-2/updating-discord-deb-one-liner/</link>
					<comments>https://emacstragic.net/debian-2/updating-discord-deb-one-liner/#respond</comments>
		
		<dc:creator><![CDATA[Jason]]></dc:creator>
		<pubDate>Tue, 28 Nov 2023 23:11:38 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[discord]]></category>
		<guid isPermaLink="false">https://emacstragic.net/?p=1766</guid>

					<description><![CDATA[Discord will often require you to install an update. When this happens it quits itself and auto downloads the latest .deb, but you end up with lots of sequentially numbered versions of the .deb so it&#8217;s fiddly to find and install the latest one. I came up with this approach to apt install the most [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Discord will often require you to install an update. When this happens it quits itself and auto downloads the latest .deb, but you end up with lots of sequentially numbered versions of the .deb so it&#8217;s fiddly to find and install the latest one.</p>



<p>I came up with this approach to apt install the most recent one:</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-bash" data-lang="Bash"><code>sudo apt install \
   $(find /home/jason/Downloads/ \
       -name &#39;discord*.deb&#39; -type f -printf &#39;%T+ %p\n&#39; | \
      sort -r | head -1 | cut -d&#39; &#39; -f2)</code></pre></div>



<p>or you can build it into a bash function:</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-bash" data-lang="Bash"><code>update-discord()
{
sudo apt install \
  $(find /home/jason/Downloads/ -name &#39;discord*.deb&#39; -type f -printf &#39;%T+ %p\n&#39; | \
  sort -r | head -1 | cut -d&#39; &#39; -f2)
}</code></pre></div>



<p>One could also consider deleting the .deb after successful install. That is an excercise left for the reader</p>



<p><a href="https://apan.org.au/" data-type="link" data-id="https://apan.org.au/">Free Palestine!</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://emacstragic.net/debian-2/updating-discord-deb-one-liner/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1766</post-id>	</item>
		<item>
		<title>Let&#8217;s Encrypt when your server is behind a firewall and you can&#8217;t use DNS Challenge</title>
		<link>https://emacstragic.net/debian-2/lets-encrypt-when-your-server-is-behind-a-firewall-and-you-cant-use-dns-challenge/</link>
					<comments>https://emacstragic.net/debian-2/lets-encrypt-when-your-server-is-behind-a-firewall-and-you-cant-use-dns-challenge/#respond</comments>
		
		<dc:creator><![CDATA[Jason]]></dc:creator>
		<pubDate>Fri, 12 Oct 2018 03:27:29 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">http://emacstragic.net/?p=1476</guid>

					<description><![CDATA[Sometimes you want to give a server that is  behind a firewall a valid SSL certificate. Let&#8217;s Encrypt provides a nice solution for this called DNS Challenge. The problem with DNS Challenge is it may require some manual configuring to on your server to set it up. That is all fine and good but sometimes [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Sometimes you want to give a server that is  behind a firewall a valid SSL certificate. Let&#8217;s Encrypt provides a nice solution for this called DNS Challenge. The problem with DNS Challenge is it may require some manual configuring to on your server to set it up. That is all fine and good but sometimes the server won&#8217;t allow you to do that configure. A classic example is the <a href="http://Hass.io">hass.io</a> (Home Assistant) appliance or FreePBX</p>


<p>I couldn&#8217;t find a coherent set of instructions for setting up Let&#8217;s Encrypt DNS Challenges with hassio, especially as my DNS provider requires custom scripts in order to achieve this.</p>


<p>However, I came up with a work around. First let&#8217;s think about how Let&#8217;s Encrypt (LE) usually works. Suppose you want to get a certificate for my.example.com (MEC), but my.example.com is NATed behind example.com&#8217;s (EC) IP address. When you run the LE client on MEC, it requests the LE servers to do a challenge request to MEC. MEC will have the same public IP as EC. the client on MEC will some information on the MEC server at the &lt;webroot>/.well-known/acme-challenge. The LE servers will try and query it. If they find what they are looking for, they issue you the certificate.</p>


<p>So I got to thinking, as this request takes place on port 80, it must contain the domain name header, and so, if you run an web server on port 80 of EC and A entry for  MEC the same public IP address as EC, EC could simply proxy that request to the MEC server.</p>


<p>I looked up how to do this and set it up on my server and low and behold, I was able to get a valid certificate.</p>


<p>In my case I did it with nginx , so the config looked like this:</p>


<p>On my server on port 80 (example.com) of the firewall in /etc/nginx/sites-available/my.example.com:</p>


<pre class="wp-block-code"><code>server {
       server_name my.example.com;
       location / {
       		proxy_pass http://192.168.1.9:80/;
		proxy_set_header Host $http_host;
	}
}</code></pre>


<p>Then symlink it to /etc/nginx/sites-enabled/my.example.com and test the nginx config:</p>


<pre class="wp-block-code"><code>$ sudo ln -s /etc/nginx/sites-available/my.example.com  /etc/nginx/sites-enabled/my.example.com
$ sudo nginx -t
[sudo] password for jason:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful</code></pre>


<p>Restart nginx:</p>


<pre class="wp-block-code"><code>sudo systemctl restart nginx.service</code></pre>


<p>Now start your Let&#8217;s Encrypt certificate request on your server and you should be good to go.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://emacstragic.net/debian-2/lets-encrypt-when-your-server-is-behind-a-firewall-and-you-cant-use-dns-challenge/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1476</post-id>	</item>
		<item>
		<title>MSSQL ODBC Client on Debian 9 Stretch</title>
		<link>https://emacstragic.net/debian-2/mssql-odbc-client-on-debian-9-stretch/</link>
					<comments>https://emacstragic.net/debian-2/mssql-odbc-client-on-debian-9-stretch/#comments</comments>
		
		<dc:creator><![CDATA[Jason]]></dc:creator>
		<pubDate>Mon, 06 Nov 2017 02:43:11 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian 9]]></category>
		<category><![CDATA[Debian Stretch]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">http://emacstragic.net/?p=1437</guid>

					<description><![CDATA[Many years ago fREW Schmidt wrote a very handy article on installing MSSQL ODBC drivers in debian. Since then Microsoft have improved their support of debian somewhat and things have changed making it easier to install, however they still (as at 2017-11-06) have not released proper drivers for Debian Stretch.Add the microsoft repo Add the [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Many years ago <a href="https://blog.afoolishmanifesto.com/">fREW</a> Schmidt wrote a <a href="https://blog.afoolishmanifesto.com/posts/install-and-configure-the-ms-odbc-driver-on-debian/">very handy article</a> on installing MSSQL ODBC drivers in debian. Since then Microsoft have improved their support of debian somewhat and things have changed making it easier to install, however they still (as at 2017-11-06) have not released proper drivers for Debian Stretch.<br>Add the microsoft repo</p>


<pre class="wp-block-code"><code lang="bash" class="language-bash">echo 'deb [arch=amd64] https://packages.microsoft.com/debian/8/prod jessie main' &gt; /etc/apt/sources.list.d/mssql-release.list</code></pre>



<p>Add the key</p>



<pre class="wp-block-preformatted">curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
</pre>



<p>then update and install</p>



<pre class="wp-block-preformatted">sudo apt update
sudo apt install msodbcsql mssql-tools
</pre>



<p>If you try and connect to sql now you get an obscure error like this:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">/opt/mssql-tools/bin/sqlcmd -S 10.0.2.13 -U xxx -P yyy
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Can't open lib '/opt/microsoft/msodbcsql/lib64/libmsodbcsql-13.1.so.9.1' : file not found.
</code></pre>



<p>But the file exists:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">$ file /opt/mssql-tools/bin/sqlcmd
/opt/mssql-tools/bin/sqlcmd: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=21a353af470e7849544daab892ec9b1bfc36dc87, not stripped</code></pre>



<p>This somewhat misleading error is actually due to the <code>libmsodbcsql</code> lib being linked against a very specific version of libssl. Check the output of ldd:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">$ ldd /opt/microsoft/msodbcsql/lib64/libmsodbcsql-13.1.so.9.1 | grep 'not found'
libcrypto.so.1.0.0 => not found
libssl.so.1.0.0 => not found</code></pre>



<p>But it turns out this can easily be solved by manually installing the libssl package from Debian Jessie:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">wget "http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.0.0_1.0.1t-1+deb8u7_amd64.deb"
sudo apt install ./libssl1.0.0_1.0.1t-1+deb8u7_amd64.deb</code></pre>



<p>then you should be back in business.</p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://emacstragic.net/debian-2/mssql-odbc-client-on-debian-9-stretch/feed/</wfw:commentRss>
			<slash:comments>14</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1437</post-id>	</item>
		<item>
		<title>convert mp3 to m4b on the linux command line</title>
		<link>https://emacstragic.net/debian-2/convert-mp3-to-m4b-on-the-linux-command-line/</link>
					<comments>https://emacstragic.net/debian-2/convert-mp3-to-m4b-on-the-linux-command-line/#comments</comments>
		
		<dc:creator><![CDATA[Jason]]></dc:creator>
		<pubDate>Thu, 02 Mar 2017 11:03:48 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">http://emacstragic.net/?p=1400</guid>

					<description><![CDATA[I quite often want to convert mp3 files to m4b, Apple&#8217;s proprietary nastiness. There is pacpl of course but that has issues these days, particularly with copying the id3 tags to the new file.FFmpeg can do it when you build from source (I just found a nice script&#160;that will build it from source for you). [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>I quite often want to convert mp3 files to m4b, Apple&#8217;s proprietary nastiness. There is <a href="http://vorzox.wixsite.com/pacpl">pacpl</a> of course but that has issues these days, particularly with copying the id3 tags to the new file.<br>FFmpeg can do it when you build from source (I just found a <a href="https://github.com/markus-perl/ffmpeg-build-script">nice script</a>&nbsp;that will build it from source for you). So I came up with&nbsp;this way to do&nbsp;it from the command line. It&nbsp;uses an awesome feature of xargs which will run it in parallel, so one for each core.</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">find -type f -name \*.mp3 \
| xargs -n 1 -P $(getconf _NPROCESSORS_ONLN || echo 1) -i \
  bash -c \
 'i="{}"; ffmpeg -y -i "$i" -map_metadata 0 \
        -c copy -c:a libfdk_aac -b:a 128k\
        -map_metadata:s:a 0:s:a -f ipod "${i%.*}.m4b"'</code></pre>



<p>What that does is:</p>



<ol class="wp-block-list"><li>find all the mp3 files and pipe their names into xargs</li><li>then get the number of cores available and pass that to the -P argument</li><li>and run ffmpeg and map all the metadata to the new file</li><li>and strip off the mp3 file extension and add m4b to it</li></ol>



<p>There! Nothing to it!<br>Update 2017-03-23: Added double quotes around the bash variable $i to cope with spaces. <a href="http://mywiki.wooledge.org/Quotes">You should always do this</a> (and so should I)<br>Update 2018-12-20: Added &#8220;-c copy&#8221; so ffmpeg can cope with album art in the file</p>
]]></content:encoded>
					
					<wfw:commentRss>https://emacstragic.net/debian-2/convert-mp3-to-m4b-on-the-linux-command-line/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1400</post-id>	</item>
		<item>
		<title>Build and install emacssnapshot packages on Debian Stable</title>
		<link>https://emacstragic.net/debian-2/build-and-install-emacssnapshot-packages-on-debian-stable/</link>
					<comments>https://emacstragic.net/debian-2/build-and-install-emacssnapshot-packages-on-debian-stable/#respond</comments>
		
		<dc:creator><![CDATA[Jason]]></dc:creator>
		<pubDate>Wed, 01 Mar 2017 03:15:03 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Emacs]]></category>
		<guid isPermaLink="false">http://emacstragic.net/?p=1393</guid>

					<description><![CDATA[Despite emacssnapshot only providing prebuilt packages for Debian unstable, building and installing the packages on stable is quite straight forward. I wrote a script to automate it. I&#8217;m sure there are better ways to do this, but it works for me. Thanks to twb for feedback on the script. Sorry I was too lazy to [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img fetchpriority="high" decoding="async" class="size-full wp-image-1395 aligncenter" src="https://emacstragic.net/wp-content/uploads/2017/03/emacs-logo.png" alt="the emacs logo" width="256" height="258" srcset="https://emacstragic.net/wp-content/uploads/2017/03/emacs-logo.png 256w, https://emacstragic.net/wp-content/uploads/2017/03/emacs-logo-150x150.png 150w" sizes="(max-width: 256px) 100vw, 256px" />Despite <a href="http://emacs.secretsauce.net/">emacssnapshot</a> only providing prebuilt packages for Debian unstable, building and installing the packages on stable is quite straight forward.<br />
I wrote a script to automate it. I&#8217;m sure there are better ways to do this, but it works for me. Thanks to twb for feedback on the script. Sorry I was too lazy to implement all of your suggestions twb.<br />
<script src="https://gist.github.com/jasonblewis/619a72eb77703b3036e512624c6673ce.js"></script></p>
]]></content:encoded>
					
					<wfw:commentRss>https://emacstragic.net/debian-2/build-and-install-emacssnapshot-packages-on-debian-stable/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1393</post-id>	</item>
		<item>
		<title>FreeTDS is a bag of razorblades use, Microsoft ODBC Driver for Linux instead</title>
		<link>https://emacstragic.net/uncategorized/freetds-is-a-bag-of-razorblades-use-microsoft-odbc-driver-for-linux-instead/</link>
					<comments>https://emacstragic.net/uncategorized/freetds-is-a-bag-of-razorblades-use-microsoft-odbc-driver-for-linux-instead/#respond</comments>
		
		<dc:creator><![CDATA[Jason]]></dc:creator>
		<pubDate>Fri, 04 Mar 2016 00:29:01 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[perl]]></category>
		<guid isPermaLink="false">https://emacstragic.net/?p=1253</guid>

					<description><![CDATA[According to @mst FreeTDS is a bag of razorblades. That&#8217;s right folks, don&#8217;t use it. The new way to go is Microsoft ODBC Driver for SQL Server on Linux. Unfortunately its a nightmare to install on debian. Luckily some very smart people wrote a lovely little howto: Install and Configure the MS ODBC Driver on [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>According to <a href="https://twitter.com/shadowcat_mst?lang=en">@mst</a> FreeTDS is a bag of razorblades.<br />
That&#8217;s right folks, don&#8217;t use it. The new way to go is <a href="https://msdn.microsoft.com/en-us/library/hh568451(v=sql.110).aspx">Microsoft ODBC Driver for SQL Server on Linux</a>.<br />
Unfortunately its a nightmare to install on debian. Luckily some very smart people wrote a lovely little howto: <a href="https://blog.afoolishmanifesto.com/posts/install-and-configure-the-ms-odbc-driver-on-debian/">Install and Configure the MS ODBC Driver on Debian</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://emacstragic.net/uncategorized/freetds-is-a-bag-of-razorblades-use-microsoft-odbc-driver-for-linux-instead/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1253</post-id>	</item>
		<item>
		<title>Using fail2ban to mitigate WordPress xmlrpc.php DDoS attacks</title>
		<link>https://emacstragic.net/uncategorized/wordpress-xmlrpc-php-ddos/</link>
					<comments>https://emacstragic.net/uncategorized/wordpress-xmlrpc-php-ddos/#comments</comments>
		
		<dc:creator><![CDATA[Jason]]></dc:creator>
		<pubDate>Mon, 11 Aug 2014 04:50:17 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://emacstragic.net/?p=1109</guid>

					<description><![CDATA[Use fail2ban with WordPress to prevent xlmrpc.php DDoS attacks]]></description>
										<content:encoded><![CDATA[
<p>The other day my WordPress network went down. Upon investigation it turned out it was receiving a massive amount of http posts&nbsp;to the xmlrpc.php file. Apparently there is a WordPress DDoS that uses this mechanism. It brings apache and mysql to their knees as they can&#8217;t process the posts fast enough. If you search google for WordPress xmlrpc.php DDoS you can find lot more info about this.<br>An temporary fix is to block all access to that file from your apache configs with something like:</p>



<pre class="wp-block-code"><code lang="apacheconf" class="language-apacheconf">&lt;Files xmlrpc.php>
  Order allow,deny
  Deny from all
&lt;/Files></code></pre>



<p>That brought the load back to normal so I could at least access the WordPress backend.<br>After googling around for a solution it appeared that fail2ban could help. Luckily there is a plugin for that. <a href="https://wordpress.org/plugins/wp-fail2ban/">WP fail2ban</a> has two parts. The first is a plugin that enables logging of xmlrpc events and authentication events to <code>/var/log/auth</code>. It is important to keep these events separate from the normal http access logs as the access log file can get very large and fail2ban can raise the load significantly just processing it.<br>You also need to add a few configuration options to wp-config.php</p>



<pre class="wp-block-code"><code lang="php" class="language-php">define('WP_FAIL2BAN_LOG_PINGBACKS',true);
# prevent user enumeration
define('WP_FAIL2BAN_BLOCK_USER_ENUMERATION',true);
# block some obviously invalid users
define('WP_FAIL2BAN_BLOCKED_USERS','^test</code></pre>



<p>See the readme for more details about what they do<br>The second part is enabling filters and gaols in fail2ban. Luckily this is also provided by the WP fail2ban plugin. Copy the wordpress.conf file from the wp-fail2ban directory to the fail2ban config directory:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">~# cp /var/www/wp-content/plugins/wp-fail2ban/wordpress.conf \
 /etc/fail2ban/filter.d
~#</code></pre>



<p>Then edit /etc/jail.local and insert:</p>



<pre class="wp-block-code"><code class="">[wordpress]
enabled = true
filter = wordpress
logpath = /var/log/auth.log
# set the ban time to 1 hour - probably could be even higher for good measure
bantime = 3600
# needed for debian wheezy otherwise fail2ban doesn't start and reports
#   errors with the config
port = http,https
</code></pre>



<p>Now restart fail2ban:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">~# /etc/init.d/fail2ban restart
[ ok ] Restarting authentication failure monitor: fail2ban.
~#
</code></pre>



<p>Remove the block on the xmlrpc.php file from your apache config and restart apache. Then you should see in your fail2ban logs something like:</p>



<pre class="wp-block-code"><code class="">2014-08-09 23:18:30,405 fail2ban.actions: WARNING [wordpress] Ban 117.195.37.14
2014-08-09 23:20:49,090 fail2ban.actions: WARNING [wordpress] Ban 78.97.220.237
2014-08-09 23:20:50,108 fail2ban.actions: WARNING [wordpress] Ban 46.108.226.105
2014-08-09 23:21:04,162 fail2ban.actions: WARNING [wordpress] Ban 120.28.140.93
2014-08-09 23:21:28,206 fail2ban.actions: WARNING [wordpress] Ban 175.142.187.77
2014-08-09 23:21:36,234 fail2ban.actions: WARNING [wordpress] Ban 88.240.97.76
2014-08-09 23:21:36,294 fail2ban.actions: WARNING [wordpress] Ban 122.177.229.110
2014-08-09 23:21:44,346 fail2ban.actions: WARNING [wordpress] Ban 89.106.102.15
2014-08-09 23:21:46,400 fail2ban.actions: WARNING [wordpress] Ban 2.122.219.188
2014-08-09 23:21:52,423 fail2ban.actions: WARNING [wordpress] Ban 95.69.53.13
2014-08-09 23:22:12,488 fail2ban.actions: WARNING [wordpress] Ban 5.12.12.66
2014-08-09 23:22:12,509 fail2ban.actions: WARNING [wordpress] Ban 182.182.89.23
2014-08-09 23:22:42,564 fail2ban.actions: WARNING [wordpress] Ban 178.36.126.249
2014-08-09 23:22:53,590 fail2ban.actions: WARNING [wordpress] Ban 36.83.125.10
2014-08-09 23:22:53,607 fail2ban.actions: WARNING [wordpress] Ban 95.231.59.185
</code></pre>



<p>I found however that I was being hit from over 1800 unique IP addresses and despite fail2ban successfully banning them, it was taking too long to ban enough that the load would return to normal so I re-blocked the xmlrpc.php file for 24 hours. After that, I enabled it and it seemed as though the DDoS had gone away. So far so good.</p>



<pre class="wp-block-code"><code class="">define('WP_FAIL2BAN_BLOCKED_USERS','^organictrader');</code></pre>



<p>See the readme for more details about what they do<br>The second part is enabling filters and gaols in fail2ban. Luckily this is also provided by the WP fail2ban plugin. Copy the wordpress.conf file from the wp-fail2ban directory to the fail2ban config directory:</p>



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



<p>Then edit /etc/jail.local and insert:</p>



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



<p>Now restart fail2ban:</p>



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



<p>Remove the block on the xmlrpc.php file from your apache config and restart apache. Then you should see in your fail2ban logs something like:</p>



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



<p>I found however that I was being hit from over 1800 unique IP addresses and despite fail2ban successfully banning them, it was taking too long to ban enough that the load would return to normal so I re-blocked the xmlrpc.php file for 24 hours. After that, I enabled it and it seemed as though the DDoS had gone away. So far so good.</p>



<pre class="wp-block-preformatted">);</pre>



<p>See the readme for more details about what they do<br>The second part is enabling filters and gaols in fail2ban. Luckily this is also provided by the WP fail2ban plugin. Copy the wordpress.conf file from the wp-fail2ban directory to the fail2ban config directory:</p>



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



<p>Then edit /etc/jail.local and insert:</p>



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



<p>Now restart fail2ban:</p>



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



<p>Remove the block on the xmlrpc.php file from your apache config and restart apache. Then you should see in your fail2ban logs something like:</p>



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



<p>I found however that I was being hit from over 1800 unique IP addresses and despite fail2ban successfully banning them, it was taking too long to ban enough that the load would return to normal so I re-blocked the xmlrpc.php file for 24 hours. After that, I enabled it and it seemed as though the DDoS had gone away. So far so good.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://emacstragic.net/uncategorized/wordpress-xmlrpc-php-ddos/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1109</post-id>	</item>
		<item>
		<title>Howto quickly find your Beaglebone Black&#8217;s IP address</title>
		<link>https://emacstragic.net/uncategorized/howto-quickly-find-beaglebone-blacks-ip-address/</link>
					<comments>https://emacstragic.net/uncategorized/howto-quickly-find-beaglebone-blacks-ip-address/#comments</comments>
		
		<dc:creator><![CDATA[Jason]]></dc:creator>
		<pubDate>Wed, 23 Jul 2014 02:46:01 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[BBB]]></category>
		<category><![CDATA[Beaglebone Black]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[dhcp]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[LED Clock]]></category>
		<guid isPermaLink="false">https://emacstragic.net/?p=1086</guid>

					<description><![CDATA[Whenever I connect my Beaglebone Black (BBB) to a network, I have to work out it&#8217;s IP address so I can ssh into it. This can be tricky. Some of your options are: connect to the serial terminal, or connect over the usb network interface which gives the BBB the address 192.168.7.2, log in and [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Whenever I connect my Beaglebone Black (BBB) to a network, I have to work out it&#8217;s IP address so I can ssh into it. This can be tricky. Some of your options are:</p>
<ol>
<li>connect to the serial terminal, or connect over the usb network interface which gives the BBB the address 192.168.7.2, log in and issue the command <code>ip addr</code>.</li>
<li>use <code>nmap</code> to try and search out its IP address on your subnet but this is time consuming and not very accurate I have found.</li>
<li>use <code>avahi-browse -rat</code> (thanks <a href="http://www.madox.net/blog/">Madox</a> for that tip.)</li>
</ol>
<p>Last night I came up with a Better Way<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2122.png" alt="™" class="wp-smiley" style="height: 1em; max-height: 1em;" />. Rather than trying to determine the BBB&#8217;s address, why not use a fully qualified domain name and a dynamic dns service? I could then just type <code>ssh myfqdn.com</code> or whatever and log in. Think how that would simplify one&#8217;s life!<br />
To implement this, set up a dynamic DNS somewhere with a FQDN for your BBB. If you happen to have your own domain name already you can use a sub-domain from that. I think its fairly common for DNS hosts to offer an API to update your IP address. I happen to use Rimu Hosting and they have their own simple web api.<br />
Then you just need to write a little script to update the IP address every time the DHCP client receives a new IP address, and drop it into <code>/etc/dhcp/dhclient-exit-hooks.d/</code><br />
Here is my script. This will only work with Rimu Hosting as they have their own privately developed API, and you&#8217;d need to insert your own KEY into the script.</p>
<pre lang="bash">#!/bin/bash
# update ip address with rimu hosting. See https://rimuhosting.com/dns/dyndns.jsp
if [[ ! -z ${new_ip_address} ]]
then
   echo $(date +"%F %T") ${new_ip_address} &gt;&gt; /root/ddns.txt
   curl "https://rimuhosting.com/dns/dyndns.jsp?action=SET&amp;name=clock.emacstragic.net&amp;value=${new_ip_address}&amp;type=A&amp;api_key=XXX"
else
    echo "got no ip"
fi
</pre>
<h2>Update:</h2>
<p>I discovered this didn&#8217;t work at home. Turns out that dnsmasq in OpenWRT is set to ignore this kind of dns request, due to potential security risks. There is a solution to that. Add a <code>list rebind_domain</code> line to your /etc/config/dhcp line on the router.</p>
<pre>config dnsmasq
	.
	.
	.
	list    rebind_domain 'clock.emacstragic.net'
</pre>
<p>Thanks to Michal Čihař for <a href="http://blog.cihar.com/archives/2011/01/31/openwrt-and-resolving-private-ranges/">the solution</a> to that.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://emacstragic.net/uncategorized/howto-quickly-find-beaglebone-blacks-ip-address/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1086</post-id>	</item>
		<item>
		<title>Printing from Windows to a samba shared CUPS-PDF printer sometimes fails</title>
		<link>https://emacstragic.net/debian-2/printing-windows-samba-shared-cups-pdf-printer-sometimes-fails/</link>
					<comments>https://emacstragic.net/debian-2/printing-windows-samba-shared-cups-pdf-printer-sometimes-fails/#respond</comments>
		
		<dc:creator><![CDATA[Jason]]></dc:creator>
		<pubDate>Thu, 01 May 2014 05:31:54 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[cups]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[printing]]></category>
		<guid isPermaLink="false">https://emacstragic.net/?p=1033</guid>

					<description><![CDATA[I had this problem where prints to our CUPS-PDF printer sometimes failed to be processed on the server. The job would disappear as though it has been printed but nothing else would happen. Printing from the same application to a Windows based PDF printer, and then printing the resulting PDF via Adobe Acrobat to the [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I had this problem where prints to our CUPS-PDF printer sometimes failed to be processed on the server. The job would disappear as though it has been printed but nothing else would happen. Printing from the same application to a Windows based PDF printer, and then printing the resulting PDF via Adobe Acrobat to the CUPS PDF printer would work fine. Printing the same PDF via Sumatra PDF to CUPS-PDF would also fail.<br />
Further investigation revealed that the resulting print job files would differ. The jobs that fail looked like they contained a lot of binary data but the ones that succeeded looked like normal PDF files.<br />
Then I discovered this entry in the Windows Event Viewer:<br />
<code><br />
The document XXXX, owned by jason, failed to print on printer \\server\PDF. Try to print the document again, or restart the print spooler.<br />
Data type: NT EMF 1.008. Size of the spool file in bytes: 2555904. Number of bytes printed: 0. Total number of pages in the document: 1. Number of pages printed: 0. Client computer: \\CLIENT. Win32 error code returned by the print processor: 0. The operation completed successfully.<br />
</code><br />
Googleing that error took me to this <a href="http://www.raspberrypi.org/forums/viewtopic.php?p=304015#p304015">RPi forum</a> which had a solution buried down near the bottom. Thanks to <a href="http://www.raspberrypi.org/forums/memberlist.php?mode=viewprofile&#038;u=60146">Chemirocha</a> for that tip. This bug has been plaguing me for a few years on and off!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://emacstragic.net/debian-2/printing-windows-samba-shared-cups-pdf-printer-sometimes-fails/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1033</post-id>	</item>
	</channel>
</rss>
