2023-11-12_15-57-56Z_Sunday database changed

This commit is contained in:
ken_fallon committed 2023-11-12 16:57:56 +01:00
1 parent c0bbc0b3da
commit f339673c27
3 files changed
+16 -8

No files matched your search

+5 -5
View File
@@ -485,7 +485,11 @@ INSERT INTO `eps` (`id`, `date`, `title`, `duration`, `summary`, `notes`, `hosti
(3985,'2023-11-10','Bash snippet - be careful when feeding data to loops',1644,'A loop in a pipeline runs in a subshell','<article>\n<h2 id=\"overview\">Overview</h2>\n<p>Recently Ken Fallon did a show on HPR, <a\nhref=\"https://hackerpublicradio.org/eps/hpr3962/index.html\">number\n3962</a>, in which he used a <a\nhref=\"https://www.gnu.org/software/bash/manual/html_node/Pipelines.html\">Bash\npipeline</a> of multiple commands feeding their output into a\n<code>while</code> loop. In the loop he processed the lines produced by\nthe pipeline and used what he found to download audio files belonging to\na series with <code>wget</code>.</p>\n<p>This was a great show and contained some excellent advice, but the\nuse of the format:</p>\n<pre><code>pipeline | while read variable; do ...</code></pre>\n<p>reminded me of the \"gotcha\" I mentioned in my own <a\nhref=\"https://hackerpublicradio.org/eps/hpr2699/index.html\">show\n2699</a>.</p>\n<p>I thought it might be a good time to revisit this subject.</p>\n<h2 id=\"so-whats-the-problem\">So, what\'s the problem?</h2>\n<p>The problem can be summarised as a side effect of pipelines.</p>\n<h3 id=\"what-are-pipelines\">What are pipelines?</h3>\n<p>Pipelines are an amazingly useful feature of Bash (and other shells).\nThe general format is:</p>\n<pre><code>command1 | command2 ...</code></pre>\n<p>Here <code>command1</code> runs in a subshell and produces output (on\nits <em>standard output</em>) which is connected via the pipe symbol\n(<code>|</code>) to <code>command2</code> where it becomes its\n<em>standard input</em>. Many commands can be linked together in this\nway to achieve some powerful combined effects.</p>\n<p>A very simple example of a pipeline might be:</p>\n<pre><code>$ printf &#39;World&bsol;nHello&bsol;n&#39; | sort\nHello\nWorld</code></pre>\n<p>The <code>printf</code> command (≡<code>\'command1\'</code>) writes two\nlines (separated by newlines) on <em>standard output</em> and this is\npassed to the <code>sort</code> command\'s <em>standard input</em>\n(≡<code>\'command2\'</code>) which then sorts these lines\nalphabetically.</p>\n<p>Commands in the pipeline can be more complex than this, and in the\ncase we are discussing we can include a loop command such as\n<code>while</code>.</p>\n<p>For example:</p>\n<pre><code>$ printf &#39;World&bsol;nHello&bsol;n&#39; | sort | while read line; do echo &quot;($line)&quot;; done\n(Hello)\n(World)</code></pre>\n<p>Here, each line output by the <code>sort</code> command is read into\nthe variable <code>line</code> in the <code>while</code> loop and is\nwritten out enclosed in parentheses.</p>\n<p>Note that the loop is written on one line. The semi-colons are used\ninstead of the equivalent newlines.</p>\n<h3 id=\"variables-and-subshells\">Variables and subshells</h3>\n<p>What if the lines output by the loop need to be numbered?</p>\n<pre><code>$ i=0; printf &#39;World&bsol;nHello&bsol;n&#39; | sort | while read line; do ((i++)); echo &quot;$i) $line&quot;; done\n1) Hello\n2) World</code></pre>\n<p>Here the variable <code>\'i\'</code> is set to zero before the\npipeline. It could have been done on the line before of course. In the\n<code>while</code> loop the variable is incremented on each iteration\nand included in the output.</p>\n<p>You might expect <code>\'i\'</code> to be 2 once the loop exits but it\nis not. It will be zero in fact.</p>\n<p>The reason is that there are two <code>\'i\'</code> variables. One is\ncreated when it\'s set to zero at the start before the pipeline. The\nother one is created in the loop as a \"clone\". The expression:</p>\n<pre><code>((i++))</code></pre>\n<p>both creates the variable (where it is a copy of the one in the\nparent shell) and increments it.</p>\n<p>When the subshell in which the loop runs completes, it will delete\nthis version of <code>\'i\'</code> and the original one will simply\ncontain the zero that it was originally set to.</p>\n<p>You can see what happens in this slightly different example:</p>\n<pre><code>$ i=1; printf &#39;World&bsol;nHello&bsol;n&#39; | sort | while read line; do ((i++)); echo &quot;$i) $line&quot;; done\n2) Hello\n3) World\n$ echo $i\n1</code></pre>\n<p>These examples are fine, assuming the contents of variable\n<code>\'i\'</code> incremented in the loop are not needed outside it.</p>\n<p>The thing to remember is that the same variable name used in a\nsubshell is a different variable; it is initialised with the value of\nthe \"parent\" variable but any changes are not passed back.</p>\n<h2 id=\"how-to-avoid-the-loss-of-changes-in-the-loop\">How to avoid the\nloss of changes in the loop</h2>\n<p>To solve this the loop needs to be run in the original shell, not a\nsubshell. The pipeline which is being read needs to be attached to the\nloop in a different way:</p>\n<pre><code>$ i=0; while read line; do ((i++)); echo &quot;$i) $line&quot;; done &lt; &lt;(printf &#39;World&bsol;nHello&bsol;n&#39; | sort)\n1) Hello\n2) World\n$ echo $i\n2</codLine truncated
(3992,'2023-11-21','Test recording on a wireless mic',223,'Archer72 tests out a wireless mic with a USB C receiver','<h2 id=\"lekato-2-pack-wireless-microphone-with-charging-case\">LEKATO 2\nPack Wireless Microphone with Charging Case</h2>\n<p><a href=\"https://www.amazon.com/gp/product/B0C4SNT6QK\"\nclass=\"uri\">https://www.amazon.com/gp/product/B0C4SNT6QK</a></p>\n<ul>\n<li>USB C</li>\n<li>Two microphones in a charging case</li>\n<li>Charge phone and use the receiver simultaneously</li>\n</ul>\n<h3 id=\"claims\">Claims</h3>\n<ul>\n<li>75 ft. transmission range</li>\n<li>Wireless Mic can work continuously for 5 hours, and the charging box\ncan quickly charge the device 4 times. The total usage time reaches 25\nhours</li>\n</ul>\n<h2 id=\"axet-audio-recorder-on-f-droid\">Axet Audio recorder on\nF-Droid</h2>\n<p><a href=\"https://f-droid.org/packages/com.github.axet.audiorecorder\"\nclass=\"uri\">https://f-droid.org/packages/com.github.axet.audiorecorder</a></p>\n<ul>\n<li>Works to record stereo with this mic set</li>\n</ul>\n',318,0,0,'CC-BY-SA','Recording, Microphone, Wireless, USB \'C\', F-droid, Android App',0,0,1),
(4221,'2024-10-07','HPR Community News for September 2024',0,'HPR Volunteers talk about shows released and comments posted in September 2024','',159,47,1,'CC-BY-SA','Community News',0,0,1),
(4241,'2024-11-04','HPR Community News for October 2024',0,'HPR Volunteers talk about shows released and comments posted in October 2024','',159,47,1,'CC-BY-SA','Community News',0,0,1);
(4241,'2024-11-04','HPR Community News for October 2024',0,'HPR Volunteers talk about shows released and comments posted in October 2024','',159,47,1,'CC-BY-SA','Community News',0,0,1),
(3986,'2023-11-13','Optical media is not dead',435,'Archer72 shows command line options for creating and writing iso files','<h2 id=\"brought-up-by-klaatu-on-gnuworldorder.info\">Brought up by Klaatu\non GnuWorldOrder.info</h2>\n<h3 id=\"media-size\">Media size</h3>\n<p>4.7Gb DVD - Actual capacity: 4.377Gb</p>\n<p><a\nhref=\"https://www.cdrom2go.com/blog/what-is-the-actual-storage-capacity-of-a-dvd-disc\"\ntitle=\"What is the actual storage capacity of a dvd disc\">What is the\nactual storage capacity of a dvd disc</a></p>\n<p>A disc with a 25GB capacity is the equivalent of 23.28 gigabytes\nNormally rated at 50GB, in practice they can record about 46.57GB of\ndata</p>\n<p><a\nhref=\"https://www.cdrom2go.com/blog/what-is-the-maximum-capacity-of-a-blu-ray-disc\"\ntitle=\"What is the maximum capacity of a blu ray disc\">What is the\nmaximum capacity of a blu ray disc</a></p>\n<p>Generate ISO image from directory</p>\n<pre><code>genisoimage -U -R -allow-lowercase -allow-multidot -o mydvd.iso &quot;$1&quot;</code></pre>\n<p>Alternative is <em>mkisofs</em></p>\n<pre><code>-U\n\nAllows &quot;untranslated&quot; filenames, completely violating the ISO9660 standards described above. Enables the following flags: -d -l -N -allow-leading-dots -relaxed-filenames -allow-lowercase -allow-multidot -no-iso-translate. Allows more than one `.&#39; character in the filename, as well as mixed-case filenames. This is useful on HP-UX, where the built-in cdfs filesystem does not recognize any extensions. Use with extreme caution.\n\n-R\n\nGenerate SUSP and RR records using the Rock Ridge protocol to further describe the files on the ISO9660 filesystem.\n\n[Wikipedia - ISO 9660](https://en.wikipedia.org/wiki/ISO_9660#SUSP &quot;Wikipedia - ISO 9660&quot;)</code></pre>\n<h3 id=\"corrected-command\">Corrected command</h3>\n<pre><code>genisoimage -R -o mydvd.iso &quot;$1&quot;</code></pre>\n<p>Burning data to a DVD or Blu-ray</p>\n<p>Note:</p>\n<p>Make sure that the medium is not mounted when you begin to write to\nit. Mounting may happen automatically if the medium contains a readable\nfile system. In the best case, it will prevent the burn programs from\nusing the burner device. In the worst case, there will be misburns\nbecause read operations disturbed the drive. So if in doubt, do:</p>\n<pre><code>umount /dev/sr0</code></pre>\n<p>growisofs has a small bug with blank BD-R media. It issues an error\nmessage after the burning is complete. Programs like k3b then believe\nthe whole burn run failed. To prevent this, either format the blank BD-R\nby dvd+rw-format /dev/sr0 before submitting it to growisofs or use\ngrowisofs option</p>\n<pre><code>-use-the-force-luke=spare:none</code></pre>\n<p><a\nhref=\"https://wiki.archlinux.org/title/Optical_disc_drive#Burning_an_ISO_image_to_CD,_DVD,_or_BD\"\ntitle=\"Archwiki - Optical disk burning\">Archwiki - Optical disk\nburning</a></p>\n<h2 id=\"burning-an-iso-image-to-cd-dvd-or-bd\">Burning an ISO image to\nCD, DVD, or BD</h2>\n<h3\nid=\"to-burn-a-readily-prepared-iso-image-file-isoimage.iso-onto-an-optical-medium-run-for-cd\">To\nburn a readily prepared ISO image file isoimage.iso onto an optical\nmedium, run for CD:</h3>\n<pre><code>cdrecord -v -sao dev=/dev/sr0 isoimage.iso</code></pre>\n<h3 id=\"and-for-dvd-or-bd\">and for DVD or BD:</h3>\n<pre><code>growisofs -dvd-compat -Z /dev/sr0=isoimage.iso</code></pre>\n<h3 id=\"for-cd-dvd-bd\">for CD, DVD, BD:</h3>\n<pre><code>xorriso -as cdrecord -v dev=/dev/sr0 -dao isoimage.iso</code></pre>\n<h2 id=\"other-reading\">Other reading</h2>\n<h3 id=\"archwiki---optical-disk-drive\">Archwiki - Optical disk\ndrive</h3>\n<p><a href=\"https://wiki.archlinux.org/title/Optical_disc_drive\"\ntitle=\"Archwiki - Optical disk drive\">Archwiki - Optical disk\ndrive</a></p>\n<h3 id=\"debian---gensisoimage-man-page\">Debian - Gensisoimage man\npage</h3>\n<p><a\nhref=\"https://manpages.debian.org/bookworm/genisoimage/genisoimage.1.en.html#U\"\ntitle=\"Debian - Gensisoimage man page\">Debian - Gensisoimage man\npage</a></p>\n<h3 id=\"debian-wiki---genisoimage-and-xorrisofs\">Debian wiki -\ngenisoimage and xorrisofs</h3>\n<p><a href=\"https://wiki.debian.org/genisoimage\"\ntitle=\"Debian wiki\">Debian wiki</a></p>\n<h3 id=\"archiving-data-on-blu-ray-discs\">Archiving data on Blu-ray\ndiscs</h3>\n<p><a href=\"https://briantomasik.com/archiving-data-on-blu-ray-discs/\"\ntitle=\"Archiving data\">Archiving data</a></p>\n<h3\nid=\"mount-an-iso-file-and-burning-it-to-cd-rdvd-rbluray-in-linux\">Mount\nan ISO file and Burning it to CD-R/DVD-R/BluRay in Linux</h3>\n<p><a href=\"https://linux.m2osw.com/mount-iso-file-linux\"\ntitle=\"Mount an ISO file and Burning\">Mount an ISO file and\nBurning</a></p>\n<h3\nid=\"what-is-the-size-capacity-of-my-dvd-dual-layer-dvd-or-blu-ray-disc\">What\nis the size capacity of my DVD, Dual Layer DVD or Blu-ray disc?</h3>\n<p><a\nhref=\"http://kb.primera.com/article/21426/45024/what-is-the-size-capacity-of-my-dvd-dual-layer-dvd-or-bluray-disc-Line truncated
(3987,'2023-11-14','The Grim Dawn',2391,'Sgoti rambles about a video game called Grim Dawn.','<ul>\n<li><p><strong>Source:</strong> <a\nhref=\"https://en.wikipedia.org/wiki/Action_role-playing_game\">Action\nrole-playing game.</a></p></li>\n<li><p><strong>Source:</strong> <a href=\"https://www.grimdawn.com/\">Grim\nDawn.</a></p></li>\n<li><p><strong>Supporting Source:</strong> <a\nhref=\"https://www.grimdawn.com/guide/\">Grim Dawn Game\nGuide.</a></p></li>\n<li><p><strong>Supporting Source:</strong> <a\nhref=\"https://store.steampowered.com/app/219990/Grim_Dawn/\">Steam page\nfor Grim Dawn.</a></p></li>\n<li><p><strong>Supporting Source:</strong> <a\nhref=\"https://www.grimtools.com/\">Grim Dawn Tools (Third party\nsite).</a></p></li>\n<li><p><strong>Supporting Source:</strong> <a\nhref=\"https://www.grimdawn.com/guide/character/masteries/soldier/\">Soldier\nClass.</a> Soldiers readily charge into the carnage and unleash crushing\nmight upon their foes. Their physical prowess is unmatched and their\nability to survive through the most brutal conflicts makes them an\nexcellent choice for defense-oriented players.</p></li>\n<li><p><strong>Source:</strong> <a\nhref=\"https://diablo4.blizzard.com/en-us/\">Diablo 4</a></p></li>\n</ul>\n<p>This work is licensed under a <a\nhref=\"https://creativecommons.org/licenses/by-sa/4.0/\"\ntitle=\"CC-BY-SA 4.0 International\">Creative Commons\nAttribution-ShareAlike 4.0 International License</a>.</p>\n',391,0,0,'CC-BY-SA','Grim Dawn, ARPG, Diablo 4, Video Games',0,0,0),
(3988,'2023-11-15','Beeper.com',750,'operat0r talks about Beeper dot com a multi chat client','<p>I talk about Beeper dot com a multi chat client</p>\n<p>Beeper is a universal messaging app that lets you chat with anyone on\nany chat app, including Whatsapp, iMessage, Telegram and 12 other\nnetworks.</p>\n<h2 id=\"links\">Links</h2>\n<ul>\n<li><a href=\"https://www.beeper.com/\">https://www.beeper.com/</a></li>\n<li><a\nhref=\"https://github.com/beeper\">https://github.com/beeper</a></li>\n</ul>\n',36,0,1,'CC-BY-SA','chat,messaging,mobile',0,0,0),
(3989,'2023-11-16','LastPass Security Update 1 November 2023',553,'LastPass was hacked, what should you do?','<p>In 2022, LastPass disclosed that it had been hacked, and I think by\nnow just about everyone has heard about it. Now we have evidence that\npassword vaults have been hacked. So what does this mean, and what\nshould you do?</p>\n<h2 id=\"links\">Links:</h2>\n<ul>\n<li><a\nhref=\"https://krebsonsecurity.com/2023/09/experts-fear-crooks-are-cracking-keys-stolen-in-lastpass-breach/\"\nclass=\"uri\">https://krebsonsecurity.com/2023/09/experts-fear-crooks-are-cracking-keys-stolen-in-lastpass-breach/</a></li>\n<li><a\nhref=\"https://www.zwilnik.com/security-and-privacy/lastpass-hacked-what-does-this-mean/\"\nclass=\"uri\">https://www.zwilnik.com/security-and-privacy/lastpass-hacked-what-does-this-mean/</a></li>\n<li><a\nhref=\"https://wtop.com/tech/2023/01/data-doctors-should-i-stop-using-lastpass-for-password-management/\"\nclass=\"uri\">https://wtop.com/tech/2023/01/data-doctors-should-i-stop-using-lastpass-for-password-management/</a></li>\n<li><a href=\"http://hackerpublicradio.org/eps.php?id=1810\"\nclass=\"uri\">http://hackerpublicradio.org/eps.php?id=1810</a></li>\n</ul>\n',198,74,0,'CC-BY-SA','LastPass, password vault',0,0,0);
/*!40000 ALTER TABLE `eps` ENABLE KEYS */;
UNLOCK TABLES;
@@ -994,7 +998,3 @@ INSERT INTO `miniseries` (`id`, `name`, `description`, `private`, `image`, `vali
(25,'Programming 101','A series focusing on concepts and the basics of programming',0,'',1),
(26,'RoundTable','Panelists dicuss a topic each month.',0,'',1),
(82,'Vim Hints','<p>\r\nVarious contributors lead us on a journey of discovery of the Vim (and vi) editors.\r\n</p>\r\n<p>\r\nVim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor distributed with most UNIX systems.\r\n</p>\r\n<p>\r\n<a href=\"https://www.vim.org/about.php\">https://www.vim.org/about.php</a>\r\n</p>',0,'',1),
(28,'NewsCast','What\'s happening in the News world',1,'',1),
(29,'How I got into tech','Started by monsterb, this series invites people to share with us how they found Linux. It has become traditional for first time hosts to share with us their journey to Linux. Indeed it has morphed to be way to share your journey in tech right up to your first contribution to HPR.',0,'',1),
(30,'Tit Radio','Welcome to TiT Radio! The only Hacker Public Radio show with super cow powers broadcasting live on ddphackradio.org every utter Saturday night at 11pm CST. You may be asking yourself \"What in tarnation is Tit Radio?\" Well, it\'s a potluck style roundtable of geeks talking about Free Software, GNU + Linux, and anything geeky the TiTs bring to the table. Chat with the TiTs over at irc.freenode.net #linuxcranks. Thats no bull.',1,'',1),
(34,'Talk Geek to me','deepgeek talks geek to his fans',1,'',1),
+5 -1
View File
@@ -1,3 +1,7 @@
(28,'NewsCast','What\'s happening in the News world',1,'',1),
(29,'How I got into tech','Started by monsterb, this series invites people to share with us how they found Linux. It has become traditional for first time hosts to share with us their journey to Linux. Indeed it has morphed to be way to share your journey in tech right up to your first contribution to HPR.',0,'',1),
(30,'Tit Radio','Welcome to TiT Radio! The only Hacker Public Radio show with super cow powers broadcasting live on ddphackradio.org every utter Saturday night at 11pm CST. You may be asking yourself \"What in tarnation is Tit Radio?\" Well, it\'s a potluck style roundtable of geeks talking about Free Software, GNU + Linux, and anything geeky the TiTs bring to the table. Chat with the TiTs over at irc.freenode.net #linuxcranks. Thats no bull.',1,'',1),
(34,'Talk Geek to me','deepgeek talks geek to his fans',1,'',1),
(35,'SELF Talks 2009','South East Linux Fest talks 2009',1,'',1),
(36,'Software Freedom Day Dundee 2009','Software Freedom Day Dundee 2009',1,'',1),
(38,'A Little Bit of Python','<p>\r\nInitially based on the podcast \"A Little Bit of Python\", by Michael Foord, Andrew Kuchling, Steve Holden, Dr. Brett Cannon and Jesse Noller. <a href=\"https://www.voidspace.org.uk/python/weblog/arch_d7_2009_12_19.shtml#e1138\">https://www.voidspace.org.uk/python/weblog/arch_d7_2009_12_19.shtml#e1138</a>\r\n</p>\r\n<p>\r\nNow the series is open to all.\r\n</p>',0,'',1),
@@ -409,4 +413,4 @@ UNLOCK TABLES;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2023-11-11 8:33:40
-- Dump completed on 2023-11-12 15:56:47
+6 -2
View File
@@ -20485,7 +20485,11 @@ INSERT INTO `eps` (`id`, `date`, `title`, `duration`, `summary`, `notes`, `hosti
(3985,'2023-11-10','Bash snippet - be careful when feeding data to loops',1644,'A loop in a pipeline runs in a subshell','<article>\n<h2 id=\"overview\">Overview</h2>\n<p>Recently Ken Fallon did a show on HPR, <a\nhref=\"https://hackerpublicradio.org/eps/hpr3962/index.html\">number\n3962</a>, in which he used a <a\nhref=\"https://www.gnu.org/software/bash/manual/html_node/Pipelines.html\">Bash\npipeline</a> of multiple commands feeding their output into a\n<code>while</code> loop. In the loop he processed the lines produced by\nthe pipeline and used what he found to download audio files belonging to\na series with <code>wget</code>.</p>\n<p>This was a great show and contained some excellent advice, but the\nuse of the format:</p>\n<pre><code>pipeline | while read variable; do ...</code></pre>\n<p>reminded me of the \"gotcha\" I mentioned in my own <a\nhref=\"https://hackerpublicradio.org/eps/hpr2699/index.html\">show\n2699</a>.</p>\n<p>I thought it might be a good time to revisit this subject.</p>\n<h2 id=\"so-whats-the-problem\">So, what\'s the problem?</h2>\n<p>The problem can be summarised as a side effect of pipelines.</p>\n<h3 id=\"what-are-pipelines\">What are pipelines?</h3>\n<p>Pipelines are an amazingly useful feature of Bash (and other shells).\nThe general format is:</p>\n<pre><code>command1 | command2 ...</code></pre>\n<p>Here <code>command1</code> runs in a subshell and produces output (on\nits <em>standard output</em>) which is connected via the pipe symbol\n(<code>|</code>) to <code>command2</code> where it becomes its\n<em>standard input</em>. Many commands can be linked together in this\nway to achieve some powerful combined effects.</p>\n<p>A very simple example of a pipeline might be:</p>\n<pre><code>$ printf &#39;World&bsol;nHello&bsol;n&#39; | sort\nHello\nWorld</code></pre>\n<p>The <code>printf</code> command (≡<code>\'command1\'</code>) writes two\nlines (separated by newlines) on <em>standard output</em> and this is\npassed to the <code>sort</code> command\'s <em>standard input</em>\n(≡<code>\'command2\'</code>) which then sorts these lines\nalphabetically.</p>\n<p>Commands in the pipeline can be more complex than this, and in the\ncase we are discussing we can include a loop command such as\n<code>while</code>.</p>\n<p>For example:</p>\n<pre><code>$ printf &#39;World&bsol;nHello&bsol;n&#39; | sort | while read line; do echo &quot;($line)&quot;; done\n(Hello)\n(World)</code></pre>\n<p>Here, each line output by the <code>sort</code> command is read into\nthe variable <code>line</code> in the <code>while</code> loop and is\nwritten out enclosed in parentheses.</p>\n<p>Note that the loop is written on one line. The semi-colons are used\ninstead of the equivalent newlines.</p>\n<h3 id=\"variables-and-subshells\">Variables and subshells</h3>\n<p>What if the lines output by the loop need to be numbered?</p>\n<pre><code>$ i=0; printf &#39;World&bsol;nHello&bsol;n&#39; | sort | while read line; do ((i++)); echo &quot;$i) $line&quot;; done\n1) Hello\n2) World</code></pre>\n<p>Here the variable <code>\'i\'</code> is set to zero before the\npipeline. It could have been done on the line before of course. In the\n<code>while</code> loop the variable is incremented on each iteration\nand included in the output.</p>\n<p>You might expect <code>\'i\'</code> to be 2 once the loop exits but it\nis not. It will be zero in fact.</p>\n<p>The reason is that there are two <code>\'i\'</code> variables. One is\ncreated when it\'s set to zero at the start before the pipeline. The\nother one is created in the loop as a \"clone\". The expression:</p>\n<pre><code>((i++))</code></pre>\n<p>both creates the variable (where it is a copy of the one in the\nparent shell) and increments it.</p>\n<p>When the subshell in which the loop runs completes, it will delete\nthis version of <code>\'i\'</code> and the original one will simply\ncontain the zero that it was originally set to.</p>\n<p>You can see what happens in this slightly different example:</p>\n<pre><code>$ i=1; printf &#39;World&bsol;nHello&bsol;n&#39; | sort | while read line; do ((i++)); echo &quot;$i) $line&quot;; done\n2) Hello\n3) World\n$ echo $i\n1</code></pre>\n<p>These examples are fine, assuming the contents of variable\n<code>\'i\'</code> incremented in the loop are not needed outside it.</p>\n<p>The thing to remember is that the same variable name used in a\nsubshell is a different variable; it is initialised with the value of\nthe \"parent\" variable but any changes are not passed back.</p>\n<h2 id=\"how-to-avoid-the-loss-of-changes-in-the-loop\">How to avoid the\nloss of changes in the loop</h2>\n<p>To solve this the loop needs to be run in the original shell, not a\nsubshell. The pipeline which is being read needs to be attached to the\nloop in a different way:</p>\n<pre><code>$ i=0; while read line; do ((i++)); echo &quot;$i) $line&quot;; done &lt; &lt;(printf &#39;World&bsol;nHello&bsol;n&#39; | sort)\n1) Hello\n2) World\n$ echo $i\n2</codLine truncated
(3992,'2023-11-21','Test recording on a wireless mic',223,'Archer72 tests out a wireless mic with a USB C receiver','<h2 id=\"lekato-2-pack-wireless-microphone-with-charging-case\">LEKATO 2\nPack Wireless Microphone with Charging Case</h2>\n<p><a href=\"https://www.amazon.com/gp/product/B0C4SNT6QK\"\nclass=\"uri\">https://www.amazon.com/gp/product/B0C4SNT6QK</a></p>\n<ul>\n<li>USB C</li>\n<li>Two microphones in a charging case</li>\n<li>Charge phone and use the receiver simultaneously</li>\n</ul>\n<h3 id=\"claims\">Claims</h3>\n<ul>\n<li>75 ft. transmission range</li>\n<li>Wireless Mic can work continuously for 5 hours, and the charging box\ncan quickly charge the device 4 times. The total usage time reaches 25\nhours</li>\n</ul>\n<h2 id=\"axet-audio-recorder-on-f-droid\">Axet Audio recorder on\nF-Droid</h2>\n<p><a href=\"https://f-droid.org/packages/com.github.axet.audiorecorder\"\nclass=\"uri\">https://f-droid.org/packages/com.github.axet.audiorecorder</a></p>\n<ul>\n<li>Works to record stereo with this mic set</li>\n</ul>\n',318,0,0,'CC-BY-SA','Recording, Microphone, Wireless, USB \'C\', F-droid, Android App',0,0,1),
(4221,'2024-10-07','HPR Community News for September 2024',0,'HPR Volunteers talk about shows released and comments posted in September 2024','',159,47,1,'CC-BY-SA','Community News',0,0,1),
(4241,'2024-11-04','HPR Community News for October 2024',0,'HPR Volunteers talk about shows released and comments posted in October 2024','',159,47,1,'CC-BY-SA','Community News',0,0,1);
(4241,'2024-11-04','HPR Community News for October 2024',0,'HPR Volunteers talk about shows released and comments posted in October 2024','',159,47,1,'CC-BY-SA','Community News',0,0,1),
(3986,'2023-11-13','Optical media is not dead',435,'Archer72 shows command line options for creating and writing iso files','<h2 id=\"brought-up-by-klaatu-on-gnuworldorder.info\">Brought up by Klaatu\non GnuWorldOrder.info</h2>\n<h3 id=\"media-size\">Media size</h3>\n<p>4.7Gb DVD - Actual capacity: 4.377Gb</p>\n<p><a\nhref=\"https://www.cdrom2go.com/blog/what-is-the-actual-storage-capacity-of-a-dvd-disc\"\ntitle=\"What is the actual storage capacity of a dvd disc\">What is the\nactual storage capacity of a dvd disc</a></p>\n<p>A disc with a 25GB capacity is the equivalent of 23.28 gigabytes\nNormally rated at 50GB, in practice they can record about 46.57GB of\ndata</p>\n<p><a\nhref=\"https://www.cdrom2go.com/blog/what-is-the-maximum-capacity-of-a-blu-ray-disc\"\ntitle=\"What is the maximum capacity of a blu ray disc\">What is the\nmaximum capacity of a blu ray disc</a></p>\n<p>Generate ISO image from directory</p>\n<pre><code>genisoimage -U -R -allow-lowercase -allow-multidot -o mydvd.iso &quot;$1&quot;</code></pre>\n<p>Alternative is <em>mkisofs</em></p>\n<pre><code>-U\n\nAllows &quot;untranslated&quot; filenames, completely violating the ISO9660 standards described above. Enables the following flags: -d -l -N -allow-leading-dots -relaxed-filenames -allow-lowercase -allow-multidot -no-iso-translate. Allows more than one `.&#39; character in the filename, as well as mixed-case filenames. This is useful on HP-UX, where the built-in cdfs filesystem does not recognize any extensions. Use with extreme caution.\n\n-R\n\nGenerate SUSP and RR records using the Rock Ridge protocol to further describe the files on the ISO9660 filesystem.\n\n[Wikipedia - ISO 9660](https://en.wikipedia.org/wiki/ISO_9660#SUSP &quot;Wikipedia - ISO 9660&quot;)</code></pre>\n<h3 id=\"corrected-command\">Corrected command</h3>\n<pre><code>genisoimage -R -o mydvd.iso &quot;$1&quot;</code></pre>\n<p>Burning data to a DVD or Blu-ray</p>\n<p>Note:</p>\n<p>Make sure that the medium is not mounted when you begin to write to\nit. Mounting may happen automatically if the medium contains a readable\nfile system. In the best case, it will prevent the burn programs from\nusing the burner device. In the worst case, there will be misburns\nbecause read operations disturbed the drive. So if in doubt, do:</p>\n<pre><code>umount /dev/sr0</code></pre>\n<p>growisofs has a small bug with blank BD-R media. It issues an error\nmessage after the burning is complete. Programs like k3b then believe\nthe whole burn run failed. To prevent this, either format the blank BD-R\nby dvd+rw-format /dev/sr0 before submitting it to growisofs or use\ngrowisofs option</p>\n<pre><code>-use-the-force-luke=spare:none</code></pre>\n<p><a\nhref=\"https://wiki.archlinux.org/title/Optical_disc_drive#Burning_an_ISO_image_to_CD,_DVD,_or_BD\"\ntitle=\"Archwiki - Optical disk burning\">Archwiki - Optical disk\nburning</a></p>\n<h2 id=\"burning-an-iso-image-to-cd-dvd-or-bd\">Burning an ISO image to\nCD, DVD, or BD</h2>\n<h3\nid=\"to-burn-a-readily-prepared-iso-image-file-isoimage.iso-onto-an-optical-medium-run-for-cd\">To\nburn a readily prepared ISO image file isoimage.iso onto an optical\nmedium, run for CD:</h3>\n<pre><code>cdrecord -v -sao dev=/dev/sr0 isoimage.iso</code></pre>\n<h3 id=\"and-for-dvd-or-bd\">and for DVD or BD:</h3>\n<pre><code>growisofs -dvd-compat -Z /dev/sr0=isoimage.iso</code></pre>\n<h3 id=\"for-cd-dvd-bd\">for CD, DVD, BD:</h3>\n<pre><code>xorriso -as cdrecord -v dev=/dev/sr0 -dao isoimage.iso</code></pre>\n<h2 id=\"other-reading\">Other reading</h2>\n<h3 id=\"archwiki---optical-disk-drive\">Archwiki - Optical disk\ndrive</h3>\n<p><a href=\"https://wiki.archlinux.org/title/Optical_disc_drive\"\ntitle=\"Archwiki - Optical disk drive\">Archwiki - Optical disk\ndrive</a></p>\n<h3 id=\"debian---gensisoimage-man-page\">Debian - Gensisoimage man\npage</h3>\n<p><a\nhref=\"https://manpages.debian.org/bookworm/genisoimage/genisoimage.1.en.html#U\"\ntitle=\"Debian - Gensisoimage man page\">Debian - Gensisoimage man\npage</a></p>\n<h3 id=\"debian-wiki---genisoimage-and-xorrisofs\">Debian wiki -\ngenisoimage and xorrisofs</h3>\n<p><a href=\"https://wiki.debian.org/genisoimage\"\ntitle=\"Debian wiki\">Debian wiki</a></p>\n<h3 id=\"archiving-data-on-blu-ray-discs\">Archiving data on Blu-ray\ndiscs</h3>\n<p><a href=\"https://briantomasik.com/archiving-data-on-blu-ray-discs/\"\ntitle=\"Archiving data\">Archiving data</a></p>\n<h3\nid=\"mount-an-iso-file-and-burning-it-to-cd-rdvd-rbluray-in-linux\">Mount\nan ISO file and Burning it to CD-R/DVD-R/BluRay in Linux</h3>\n<p><a href=\"https://linux.m2osw.com/mount-iso-file-linux\"\ntitle=\"Mount an ISO file and Burning\">Mount an ISO file and\nBurning</a></p>\n<h3\nid=\"what-is-the-size-capacity-of-my-dvd-dual-layer-dvd-or-blu-ray-disc\">What\nis the size capacity of my DVD, Dual Layer DVD or Blu-ray disc?</h3>\n<p><a\nhref=\"http://kb.primera.com/article/21426/45024/what-is-the-size-capacity-of-my-dvd-dual-layer-dvd-or-bluray-disc-Line truncated
(3987,'2023-11-14','The Grim Dawn',2391,'Sgoti rambles about a video game called Grim Dawn.','<ul>\n<li><p><strong>Source:</strong> <a\nhref=\"https://en.wikipedia.org/wiki/Action_role-playing_game\">Action\nrole-playing game.</a></p></li>\n<li><p><strong>Source:</strong> <a href=\"https://www.grimdawn.com/\">Grim\nDawn.</a></p></li>\n<li><p><strong>Supporting Source:</strong> <a\nhref=\"https://www.grimdawn.com/guide/\">Grim Dawn Game\nGuide.</a></p></li>\n<li><p><strong>Supporting Source:</strong> <a\nhref=\"https://store.steampowered.com/app/219990/Grim_Dawn/\">Steam page\nfor Grim Dawn.</a></p></li>\n<li><p><strong>Supporting Source:</strong> <a\nhref=\"https://www.grimtools.com/\">Grim Dawn Tools (Third party\nsite).</a></p></li>\n<li><p><strong>Supporting Source:</strong> <a\nhref=\"https://www.grimdawn.com/guide/character/masteries/soldier/\">Soldier\nClass.</a> Soldiers readily charge into the carnage and unleash crushing\nmight upon their foes. Their physical prowess is unmatched and their\nability to survive through the most brutal conflicts makes them an\nexcellent choice for defense-oriented players.</p></li>\n<li><p><strong>Source:</strong> <a\nhref=\"https://diablo4.blizzard.com/en-us/\">Diablo 4</a></p></li>\n</ul>\n<p>This work is licensed under a <a\nhref=\"https://creativecommons.org/licenses/by-sa/4.0/\"\ntitle=\"CC-BY-SA 4.0 International\">Creative Commons\nAttribution-ShareAlike 4.0 International License</a>.</p>\n',391,0,0,'CC-BY-SA','Grim Dawn, ARPG, Diablo 4, Video Games',0,0,0),
(3988,'2023-11-15','Beeper.com',750,'operat0r talks about Beeper dot com a multi chat client','<p>I talk about Beeper dot com a multi chat client</p>\n<p>Beeper is a universal messaging app that lets you chat with anyone on\nany chat app, including Whatsapp, iMessage, Telegram and 12 other\nnetworks.</p>\n<h2 id=\"links\">Links</h2>\n<ul>\n<li><a href=\"https://www.beeper.com/\">https://www.beeper.com/</a></li>\n<li><a\nhref=\"https://github.com/beeper\">https://github.com/beeper</a></li>\n</ul>\n',36,0,1,'CC-BY-SA','chat,messaging,mobile',0,0,0),
(3989,'2023-11-16','LastPass Security Update 1 November 2023',553,'LastPass was hacked, what should you do?','<p>In 2022, LastPass disclosed that it had been hacked, and I think by\nnow just about everyone has heard about it. Now we have evidence that\npassword vaults have been hacked. So what does this mean, and what\nshould you do?</p>\n<h2 id=\"links\">Links:</h2>\n<ul>\n<li><a\nhref=\"https://krebsonsecurity.com/2023/09/experts-fear-crooks-are-cracking-keys-stolen-in-lastpass-breach/\"\nclass=\"uri\">https://krebsonsecurity.com/2023/09/experts-fear-crooks-are-cracking-keys-stolen-in-lastpass-breach/</a></li>\n<li><a\nhref=\"https://www.zwilnik.com/security-and-privacy/lastpass-hacked-what-does-this-mean/\"\nclass=\"uri\">https://www.zwilnik.com/security-and-privacy/lastpass-hacked-what-does-this-mean/</a></li>\n<li><a\nhref=\"https://wtop.com/tech/2023/01/data-doctors-should-i-stop-using-lastpass-for-password-management/\"\nclass=\"uri\">https://wtop.com/tech/2023/01/data-doctors-should-i-stop-using-lastpass-for-password-management/</a></li>\n<li><a href=\"http://hackerpublicradio.org/eps.php?id=1810\"\nclass=\"uri\">http://hackerpublicradio.org/eps.php?id=1810</a></li>\n</ul>\n',198,74,0,'CC-BY-SA','LastPass, password vault',0,0,0);
/*!40000 ALTER TABLE `eps` ENABLE KEYS */;
UNLOCK TABLES;
@@ -21409,4 +21413,4 @@ UNLOCK TABLES;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2023-11-11 8:33:40
-- Dump completed on 2023-11-12 15:56:47