{"id":10526,"date":"2014-04-02T15:31:26","date_gmt":"2014-04-02T15:31:26","guid":{"rendered":"https:\/\/stevepedwards.today\/DebianAdmin\/?page_id=2"},"modified":"2014-04-02T15:31:26","modified_gmt":"2014-04-02T15:31:26","slug":"old-main-page-linux-admin-webdev","status":"publish","type":"page","link":"https:\/\/stevepedwards.today\/DebianAdmin\/old-main-page-linux-admin-webdev\/","title":{"rendered":"Old Main Page &#8211; Linux Admin &#038; WebDev"},"content":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_10526\" class=\"pvc_stats all  \" data-element-id=\"10526\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p><span style=\"color: #ffffff;\">A MOST useful and speedy thing on a Linux desktop is the ability to highlight text with the Left mouse button then immediately paste it elsewhere with the middle mouse button\/wheel press (= both laptop buttons). It's separate mem from Ctrl C too, so use BOTH for two text option pastes.notepad<\/span><\/p>\n<p><span style=\"color: #ffa500;\">Tab Key - completes available command line options in consoles<br \/>\nF3 - find text in some apps and pages like this webpage!<br \/>\nF5 - browser and Konqueror based apps page refresh (or e.g. https:\/\/192.168.1.2\/server-status?refresh=5)<br \/>\nCtrl-C - stops nearly all running command line progs<br \/>\nCTl-Alt-BackSpace - kills and respawns X window on CtrlAltF8<em><br \/>\nCtrl-F1 - App help?<br \/>\nCtrlZ - undo<br \/>\nCtrlX - cut<br \/>\nCtrlC - copy text etc (GUI\/App\/R click)<br \/>\nCtrlV - paste<br \/>\nCtrl-S - stops fast scroll in tty<br \/>\nCtrl-T for new tab in browser<br \/>\nCtrl + or - to magnify\/shrink text (Ctrl+wheel)<br \/>\nCtrl A\/E (move cursor to start\/end of cmd line)<br \/>\nCtrl U (deletes cmd line)<br \/>\nCtrl Z (pause running cmd line job)<br \/>\nCtrl-Alt-F1 to F7 Linux terminals and Dtop GUI (F8 usually)<br \/>\nEsc - close last open box etc.<br \/>\nAlt-F1 - Workspaces<br \/>\nAlt-F2 - GUI run cmd box<br \/>\nAlt-F3 - ?<br \/>\nAlt F4 - closes active window\/app<br \/>\nAlt-F5 -\u00a0reduces window size to pre max<br \/>\nPrint Screen saves screenshot to Pictures in Mint<br \/>\nAlt-PrntScr - saves active window to Pictures in Mint<br \/>\nCtrl-Alt-Delete -\u00a0close session option from GUI or reboot from F1-7 terminal<\/em><br \/>\n<\/span><\/p>\n<p><span style=\"color: #ffffff;\"><strong>Raspberry Picams Are Amazing!<\/strong><\/span><\/p>\n<p><span style=\"color: #ffffff;\">I have to showcase the Picams with Motion first as they really have been the most useful bits of kit I have for reliable but relatively cheap home security\/surveillance hobbyists. Their image quality, flexibility and 24\/7 reliability is outstanding:<\/span><\/p>\n<p><center><iframe loading=\"lazy\" title=\"picams\" src=\"https:\/\/www.youtube.com\/embed\/hUORBntR2OY\" width=\"1366\" height=\"599\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/center><span style=\"color: #ffffff;\">The topic of camera surveillance in Linux was a time consuming and steep learning curve from scratch, as seen by the Post histories leading up to the REALLY SIMPLE final incarnation of the overall setup which has been super stable since Sept 2015! They all rebooted 13 times in one day without corruption, in thunderstorm power cuts!<\/span><\/p>\n<p>That says a lot for the Raspberry Pi and Debian Raspbian OS with ext4 filesystem. Could you imagine the state a Windows FS would be in?<\/p>\n<p>A little serendipity helped for the final Apache2 server page setup that I stole the iframe code for\u00a0- a weather channel viewer - to embed the Picam's IP addresses in. Don't re-invent the wheel! The beauty of this simple index.html page is that it calls all the picams streams in one page, so you can have a copy of it on every desktop on you network\/smartfone and just open it in you browser and it will show you all the camera's live views without even needing an apache webserver on your network, except if you want\u00a0internet access via NAT through your router.<\/p>\n<p>The final Post showing the setup;<span style=\"color: #ffffff;\"> <a style=\"color: #ffffff;\" href=\"https:\/\/stevepedwards.today\/DebianAdmin\/multi-picam-webserver\">https:\/\/stevepedwards.today\/DebianAdmin\/multi-picam-webserver\/<\/a><\/span><\/p>\n<p>I can also access the Apache2 webserver via DynDNS from anywhere on the web via NAT routing - or directly for those with a static IP. The Pi units were set up using my own steps - some are probably not required with later Raspbian\/Motion releases or depending how you set up you shared folders - I was still getting to grips with linux permissions overall back then.<\/p>\n<p>I review the Picams daily then delete the videos. I have a crontab set on each also to delete the videos every week if I was away for any reason, as the cams will stop when the SD card is full if not. File rotation needs research here as necessary. A typical review is as below:<\/p>\n<p><center><iframe loading=\"lazy\" title=\"pifront review\" src=\"https:\/\/www.youtube.com\/embed\/I0864uS08MI\" width=\"1366\" height=\"599\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/center>How to autoplay and loop the videos you make once uploaded to YouTube. The code for the (quoted for WPress sake here) embed is of format:<\/p>\n<p><span style=\"color: #ffa500;\">\"&lt;c<\/span><span style=\"color: #ffa500;\">enter&gt;&lt;iframe src=\"https:\/\/www.youtube.com\/embed\/ukkzwulNuBc?autoplay=1&amp;amp;version=3&amp;amp;loop=1&amp;amp;playlist=ukkzwulNuBc\" width=\"260\" height=\"115\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"&gt;&lt;\/iframe&gt;&lt;\/center&gt;\"<\/span><\/p>\n<p><strong><span style=\"color: #ffffff;\">Image Editing<\/span><\/strong><\/p>\n<p>This is a big one if you think of how many photos\/images need timely size reduction\/cropping to get uploaded to websites for bandwidth optimisation and minimal server\/backup storage. The handiest smartfone multiple photo shrinker cmd ever for me is<\/p>\n<p><span style=\"color: #ffffff;\"><a style=\"color: #ffffff;\" href=\"https:\/\/stevepedwards.today\/DebianAdmin\/cool-command-10-mogrify\/\">mogrify<\/a> -resize 25% *jpg<\/span><\/p>\n<p>- part of ImageMagik.<\/p>\n<p>Used with screenshot and rarely, GIMP, these tools are all I need to get images to WordPress with minimal pain.<\/p>\n<p><strong><span style=\"color: #ffffff;\">File Permissions<\/span><\/strong><\/p>\n<p>If you are serious about understanding Linux - or any other OS - past a basic user level, you need to understand this topic well! It takes practise. I only now - in the last year - feel I understand perms to a satisfactory level after writing my <span style=\"color: #008000;\"><a style=\"color: #008000;\" href=\"https:\/\/stevepedwards.today\/DebianAdmin\/files-downloads-available\/\"><span style=\"color: #ffffff;\">Linux Tutor's Course PDFs<\/span>.<\/a><\/span> That is also why there are 2 \"days\" devoted to the topic in my course PDFs, to make a student\/newbie WORK through the examples to think about, research and realise the importance, function, complexity - yet genius design of the Unix system regarding directory and file ownership\/protection. Download\u00a0them from the menu links.\u00a0Perms affects system function in many ways - not least overall security or potential data loss. You can even set a perm so root cannot directly delete files using <a href=\"https:\/\/stevepedwards.today\/DebianAdmin\/using-and-finding-the-attribute-of-i-immutable-assigned-to-a-file\/\"><span style=\"color: #008000;\"><span style=\"color: #ffffff;\">chattr<\/span><\/span><\/a>. Setting up the Picams was a classic case of perms\u00a0as required knowledge to get Motion to work at the time.<\/p>\n<p><strong><span style=\"color: #ffffff;\">Utilising Metachars on the Command Line<\/span><\/strong><\/p>\n<p>Exploring metachars for command manipulation is fundamental to effective use and understanding of Unix.<\/p>\n<p>Useful examples as an intro to this topic is the removal of white space from file names as was required in the <span style=\"color: #ffffff;\"><a style=\"color: #ffffff;\" href=\"https:\/\/stevepedwards.today\/DebianAdmin\/creating-an-ebook-pdf-from-your-wordpress-posts\/\">PDF eBook Post<\/a>,<\/span> and in messy MP3 album\/filenames shown in the <span style=\"color: #ffffff;\"><a style=\"color: #ffffff;\" href=\"https:\/\/stevepedwards.today\/DebianAdmin\/cool-cmd-2-find-with-exec\/\">Find with -Exec<\/a><\/span> Post:<\/p>\n<p><a href=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/uploads\/2016\/07\/rmspaces.png\"><img loading=\"lazy\" decoding=\"async\" class=\"align center size-medium wp-image-3800 aligncenter\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/uploads\/2016\/07\/rmspaces.png\" alt=\"rmspaces.png\" width=\"578\" height=\"114\" \/><\/a><\/p>\n<p><iframe loading=\"lazy\" title=\"Linux white space file name removal\" src=\"https:\/\/www.youtube.com\/embed\/dhR3i-GsHUk\" width=\"1351\" height=\"480\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p><center><\/center>\u00a0<strong><span style=\"color: #ffffff;\">Basic Programming Insight<\/span><\/strong><\/p>\n<p>I'm a useless programmer. But computing in general will be far more interesting and understandable if you study even the most basic elements of programming up to concepts of iteration loops say; while\/for loops etc - even if - like me - you are not \"good\" at it. The logic is instantly usable on the linux cmd line, and will help you understand any commands using iterative operations such as find or rsync.<\/p>\n<p><iframe loading=\"lazy\" title=\"Linux for loop\" width=\"1778\" height=\"1000\" src=\"https:\/\/www.youtube.com\/embed\/S-Ye1I0IXiI?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p><center><\/center>\u00a0Try these yourself:<\/p>\n<p><center><span style=\"color: #ffffff;\">for x in {1..100}; do printf \\ 100\\ Repeats \\n ; done<\/span><\/center><center><span style=\"color: #ffffff;\">echo What is your name? ; read MY_NAME ; echo \"Hello $MY_NAME - hope you're well.\"<\/span><\/center><center><span style=\"color: #ffffff;\">a=1; b=2; echo `expr $a + $b`<\/span><\/center><center><span style=\"color: #ffffff;\">cd; for i in G M K; do du -hsx * | grep \"[0-9]$i\\b\" | sort -nr; done 2&gt;\/dev\/null<\/span><\/center><center><span style=\"color: #ffffff;\">for x in {1..5}; do echo $((1 + RANDOM % 20)); done<\/span><\/center><center><span style=\"color: #ffffff;\">while sleep 1 ; do printf \"lots of text\\n\" ; done<\/span><\/center><br \/>\nSED\/VIM search and replace methods is a good place to start, and AWK specifically, as a path to C. I have Post examples on this and C programming with examples you can just copy and paste into a vim text file in your home dir and then run them.<\/p>\n<p><span style=\"color: #ffffff;\">echo \"my name is steve\"<\/span><\/p>\n<p><span style=\"color: #ffa500;\">my name is steve<\/span><\/p>\n<p><span style=\"color: #ffffff;\">echo \"my name is steve\" | sed s\/steve\/fred\/g<\/span><\/p>\n<p><span style=\"color: #ffa500;\">my name is fred<\/span><\/p>\n<p>Now can you see how the white space search and replace command above works? The same function found in the Search\/Replace webpage in the running your <span style=\"color: #ffffff;\"><a style=\"color: #ffffff;\" href=\"https:\/\/stevepedwards.today\/DebianAdmin\/running-apache2-and-mysql-on-win11-wsl-ubuntu\/\">WP DB onWSL2<\/a><\/span> Post.<\/p>\n<p>Understanding $(variable) expansion is very useful when you need the iterated output of an operation to be expanded first then processed as part of another command, as in the <span style=\"color: #ffffff;\"><a style=\"color: #ffffff;\" href=\"https:\/\/stevepedwards.today\/DebianAdmin\/developing-one-liners-with-command-substitution\/\">developing-one-liners-with-command-substitution\/<\/a>\u00a0 \u00a0<\/span>the\u00a0<span style=\"color: #ffffff;\"><a style=\"color: #ffffff;\" href=\"https:\/\/stevepedwards.today\/DebianAdmin\/creating-an-ebook-pdf-from-your-wordpress-posts\/\">eBook Creation Post <\/a><\/span>or the <span style=\"color: #ffffff;\"><a style=\"color: #ffffff;\" href=\"https:\/\/stevepedwards.today\/DebianAdmin\/using-awk-and-sed-to-cut-a-column-list-and-for-character-substitution\/\">Nmap BadPorts<\/a> <\/span>example.<\/p>\n<p><strong><span style=\"color: #ffffff;\">SSH, Rsync, X11, and Passwordless Logins for Aliased Remote Backups<\/span><\/strong><\/p>\n<p>These few procedures make general networking admin much easier.<\/p>\n<p>For the ssh passwordless login process, see the <span style=\"color: #ffffff;\"><a style=\"color: #ffffff;\" href=\"https:\/\/stevepedwards.today\/DebianAdmin\/notepad\/\">Notepad<\/a> <\/span>page, and to understand <span style=\"color: #ffffff;\"><a style=\"color: #ffffff;\" href=\"https:\/\/stevepedwards.today\/DebianAdmin\/basic-useful-rsync-usage-summaries-from-man-page\/\">rsync<\/a> <\/span>in conjunction with that. Aliases for these long commands can be set up after it has been checked as working with dry run (-n) e.g:<\/p>\n<p><span style=\"color: #ffffff;\">alias budellmint='rsync -e ssh --delete-excluded --progress \/home\/stevee\/* stevee@dellmint:\/home\/stevee\/ --exclude=. -vahn'<\/span><\/p>\n<p><iframe loading=\"lazy\" title=\"Linux remote rsync\" width=\"1778\" height=\"1000\" src=\"https:\/\/www.youtube.com\/embed\/CFEjFMfQAFI?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p><center><\/center>\u00a0Once the alias is setup, it's a breeze to do an immediate backup of say, a newly downloaded file to my\u00a0other\u00a0remote PCs using just my \"budellmint\" type aliases.<\/p>\n<p>To run remote X11 GUI based apps on a remote PC, but viewed on your own screen, connect to the remote PC, dellmint, using:<\/p>\n<p><span style=\"color: #ffffff;\">ssh -X dellmint<\/span><\/p>\n<p>Then run the <span style=\"color: #ffffff;\"><a style=\"color: #ffffff;\" href=\"https:\/\/stevepedwards.today\/DebianAdmin\/remote-server-gkrellm-monitors-via-ssh-and-x11\/\">GUI based app<\/a><\/span> remotely to see it appear on the local PC:<\/p>\n<p><iframe loading=\"lazy\" title=\"linux gkrellm\" width=\"1778\" height=\"1000\" src=\"https:\/\/www.youtube.com\/embed\/nYn19udwI88?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p style=\"text-align: left;\">This is useful for updating\/running CAV AntiVirus on a remote server via command line.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_10526\" class=\"pvc_stats all  \" data-element-id=\"10526\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p>A MOST useful and speedy thing on a Linux desktop is the ability to highlight text with the Left mouse button then immediately paste it elsewhere with the middle mouse button\/wheel press (= both laptop buttons). It's separate mem from Ctrl C too, so use BOTH for two text option pastes.notepad Tab Key - completes <a href=\"https:\/\/stevepedwards.today\/DebianAdmin\/old-main-page-linux-admin-webdev\/\" class=\"more-link\">...<span class=\"screen-reader-text\">\u00a0 Old Main Page &#8211; Linux Admin &#038; WebDev<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-10526","page","type-page","status-publish","hentry"],"a3_pvc":{"activated":true,"total_views":3,"today_views":0},"_links":{"self":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/pages\/10526","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/comments?post=10526"}],"version-history":[{"count":0,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/pages\/10526\/revisions"}],"wp:attachment":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/media?parent=10526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}