{"id":151,"date":"2025-12-05T21:26:38","date_gmt":"2025-12-05T21:26:38","guid":{"rendered":"https:\/\/diasparscribe.com\/blog\/?p=151"},"modified":"2025-12-05T21:39:33","modified_gmt":"2025-12-05T21:39:33","slug":"general-raspberry-pi-commands","status":"publish","type":"post","link":"https:\/\/diasparscribe.com\/blog\/2025\/12\/05\/general-raspberry-pi-commands\/","title":{"rendered":"General Raspberry Pi Commands"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong><u>Add A New User<\/u><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo adduser alice<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You will be prompted to create a password.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The new user home directory is at \/home\/alice\/<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add to the sudo group and give sudo permissions:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo adduser alice sudo<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo su: If it runs aok account is in sudo group.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add user to groups via: Sudo adduser alice adm<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add to the following groups: adm dialout cdrom sudo audio video plugdev games users input netdev gpio i2c spi<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><u>Disable wifi &amp; bluetooth<\/u><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Sudo apt install rfkill:&nbsp; Sudo rfkill list all<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Sudo rfkill block Bluetooth:&nbsp; Sudo rfkill block wifi<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><u>OR Edit config file<\/u><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Sudo nano \/boot\/config.txt<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"># Disable Bluetooth:&nbsp; Dtoverlay=pi3-disable-bluetooth<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">#Disable Wi Fi:&nbsp; Dtoverlay=pi3-disable-wifi<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><u>Add Video Codecs<\/u><\/strong><strong><u><\/u><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">From a command prompt type:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>sudo nano \/boot\/config.txt<\/strong>&nbsp; &#8211;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add the line: decode_MPG2=XXXXXXX<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Where XXXXXX is the code you got when you bought the MPG2 licence from the Raspberry Pi store.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then <strong>CTRL O<\/strong> to save the file then <strong>CTRL X<\/strong> to exit.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check if enabled from the command prompt by typing:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>vcgencmd codec_enabled MPG2<\/strong><strong><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>vcgencmd codec_enabled WVC1<\/strong><strong><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><u>To shred a file:<\/u><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open a command prompt in the directory the file (called test.doc) you want to shred is located.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Type:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>shred \u2013u test.doc<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The -u can be replaced with the following:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">-f: Changes permissions to allow writing if needed<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">-n=x: Overwrites x times instead of the default (*3)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">-s=x: Specifies the number of bytes, x, to shred<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">-u: Truncates and removes files after overwriting<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">-v: Shows verbose information about the progress<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">-x: Do not round file sizes up to the next full block<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">-z: Adds a final overwrite with zeros to hide shredding<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">-u: Removes the file after overwriting<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><u>Linux Encryption<\/u><\/strong><strong><u><\/u><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To create an encrypted usb stick connect to the internet and type the following from a command prompt:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>sudo apt install cryptsetup<\/strong><strong><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>sudo apt install gparted<\/strong><strong><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To view cryptsetup encryption data type<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>cryptsetup &#8211;help<\/strong><strong><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><u>To encrypt a file with gpg<\/u><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To encrypt a file called test.doc, open the command prompt in the directory it is located in and type:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>gpg \u2013c test.doc<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You will then be asked to enter the password you want to use. Twice.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To decrypt the file stay in the directory and type:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>gpg test.doc.gpg<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Enter your password and you should see the document appear in the folder.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Add A New User sudo adduser alice You will be prompted to create a password. The new user home directory is at \/home\/alice\/ Add to the sudo group and give sudo permissions: sudo adduser alice sudo sudo su: If it&hellip;  <\/p>\n<p class=\"more-link\"><a href=\"https:\/\/diasparscribe.com\/blog\/2025\/12\/05\/general-raspberry-pi-commands\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[10],"tags":[],"class_list":["post-151","post","type-post","status-publish","format-standard","hentry","category-pi-tech"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/diasparscribe.com\/blog\/wp-json\/wp\/v2\/posts\/151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/diasparscribe.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/diasparscribe.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/diasparscribe.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/diasparscribe.com\/blog\/wp-json\/wp\/v2\/comments?post=151"}],"version-history":[{"count":1,"href":"https:\/\/diasparscribe.com\/blog\/wp-json\/wp\/v2\/posts\/151\/revisions"}],"predecessor-version":[{"id":152,"href":"https:\/\/diasparscribe.com\/blog\/wp-json\/wp\/v2\/posts\/151\/revisions\/152"}],"wp:attachment":[{"href":"https:\/\/diasparscribe.com\/blog\/wp-json\/wp\/v2\/media?parent=151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/diasparscribe.com\/blog\/wp-json\/wp\/v2\/categories?post=151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/diasparscribe.com\/blog\/wp-json\/wp\/v2\/tags?post=151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}