Difference between revisions of "CopyPasta"

From Da Nerd Mage Wiki
Jump to navigation Jump to search
 
(54 intermediate revisions by the same user not shown)
Line 1: Line 1:
= For doing basic setup of an LXC: =
= For doing basic setup of an LXC (or pretty much any Linux VM...) (Heck, I run these on physical machines too.): =
I run this set of commands '''as root''' on nearly every new VM or LXC I spin up. That way, I have a consistant environment to work in with all the tools I rely on.


Note: You CAN copyPasta groups of commands all at once. BUT: in this case, everything indented (after <code>su - '''yourname'''</code>) needs to be pasted AFTER that command has run.
Note: You CAN copyPasta groups of commands all at once. BUT: in this case, everything indented (after <code>su - '''yourname'''</code>) needs to be pasted AFTER that command has run.
Line 5: Line 6:
* <code>apt update</code>
* <code>apt update</code>
* <code>apt -y upgrade</code>
* <code>apt -y upgrade</code>
* <code>apt -y install sudo vim curl mosquitto-clients</code>
* <code>apt -y install sudo rsync vim curl mosquitto-clients</code>
* <code>wget <nowiki>https://www.nerdmage.ca/Downloads/RootStuff/DOT.bashrc</nowiki> -O .bashrc</code>
* <code>wget <nowiki>https://www.nerdmage.ca/Downloads/RootStuff/DOT.bashrc</nowiki> -O .bashrc</code>
* <code>wget <nowiki>https://www.nerdmage.ca/Downloads/RootStuff/DOT.vimrc</nowiki> -O .vimrc</code>
* <code>wget <nowiki>https://www.nerdmage.ca/Downloads/RootStuff/DOT.vimrc</nowiki> -O .vimrc</code>
* <code>mkdir bin</code>
* <code>mkdir bin</code>
* <code>source .bashrc</code>
* <code>source .bashrc</code>
 
* <code>apt -y install gnupg tmux htop <span style="color: rgb(22, 145, 121);">### Optional...</span></code>
* <code>apt -y install qemu-guest-agent <span style="color: rgb(22, 145, 121);">### Only on VMs. (Wish it worked for LXCs as well tho...)</span></code>
* <code>adduser '''yourname'''</code>
* <code>adduser '''yourname'''</code>
* <code>adduser '''yourname''' sudo</code>
* <code>adduser '''yourname''' sudo</code>
Line 18: Line 20:
** <code>mkdir bin</code>
** <code>mkdir bin</code>
** <code>source .bashrc</code>
** <code>source .bashrc</code>
** <code>ssh-keygen <span style="color: rgb(22, 145, 121);">### Optional... But rather handy.</span></code>
=New System Cleanup & Prep=
Freshly installed systems usually have a bunch of stuff installed that you will never use.
For myself, I don't generally have any interest in the games. I also don't use some of the Internet apps that seem important to the developers/maintainers.
These instructions are based on running Debian with the Cinnamon Desktop Environment...
==Remove all the Games==
* <code>sudo apt purge gnome-2048 aisleriot atomix gnome-chess five-or-more hitori iagno gnome-klotski lightsoff gnome-mahjongg gnome-mines gnome-nibbles quadrapassel four-in-a-row gnome-robots gnome-sudoku swell-foop tali gnome-taquin gnome-tetravex -y</code>
* <code>sudo apt autoremove -y</code>
==Remove obsolete and/or silly Internet apps==
* <code>sudo apt purge hexchat pidgin transmission-gtk thunderbird -y</code>
* <code>sudo apt autoremove -y</code>
== Get rid of Firefox ==
* <code>sudo apt purge firefox*</code>
= Simplified installation techniques & instructions =
Some cross-platform software seems to have Linux installation instructions written by people who have never actually used Linux.
(Or, at least, people who believe in making life difficult...)
So...
* [[Installing Brave Browser]] (Properly... Not FLATPAK)
* [[Installing TP-Link Omada SDN Controller on a Debian-based LXC]]
Also, many installation instructions are long-winded or confusing...
So...
* [[Installing Docker on a Debian-based system]]
= Building/Installing things from source =
You may have noticed that the various distro repositories tend to have outdated versions of some (most) packages. While this makes perfect sense, sometimes you want the newest features & fixes. (Or maybe you just want to enable something that the repo managers figured wouldn't be useful...)
Annoyingly, it is rather common for build instructions to suck really badly.
So...
* [[Arp-Scan from Source{{!}}Arp-Scan]]
* [[FreeCAD from Source{{!}}FreeCAD]]
* [[KiCAD from Source{{!}}KiCAD]]
* [[Mosquitto from Source{{!}}Mosquitto]]


= Useful console display for Proxmox Virtual Environment =
= Useful console display for Proxmox Virtual Environment =
I find it nice to have stats & such on the console of a server.  This way I can just look & see what's happening with the machine.


* <code>apt update</code>
* <code>apt update</code>
Line 28: Line 78:
* <code>wget <nowiki>https://www.nerdmage.ca/Downloads/PVEStuff/bin/TM-guestlist</nowiki> -O TM-guestlist</code>
* <code>wget <nowiki>https://www.nerdmage.ca/Downloads/PVEStuff/bin/TM-guestlist</nowiki> -O TM-guestlist</code>
* <code>wget <nowiki>https://www.nerdmage.ca/Downloads/PVEStuff/bin/TM-clusterstatus</nowiki> -O TM-clusterstatus</code>
* <code>wget <nowiki>https://www.nerdmage.ca/Downloads/PVEStuff/bin/TM-clusterstatus</nowiki> -O TM-clusterstatus</code>
* <code>wget <nowiki>https://www.nerdmage.ca/Downloads/PVEStuff/bin/TM-upsstatus</nowiki> -O TM-upsstatus</code>
* <code>wget <nowiki>https://www.nerdmage.ca/Downloads/PVEStuff/bin/TM-systemstatus</nowiki> -O TM-systemstatus</code>
* <code>wget <nowiki>https://www.nerdmage.ca/Downloads/PVEStuff/bin/TM-UPSstatus</nowiki> -O TM-UPSstatus</code>
* <code>wget <nowiki>https://www.nerdmage.ca/Downloads/PVEStuff/bin/TM-FixThis</nowiki> -O TM-FixThis</code>
* <code>wget <nowiki>https://www.nerdmage.ca/Downloads/PVEStuff/bin/TM-FixThis</nowiki> -O TM-FixThis</code>
* <code>wget <nowiki>https://www.nerdmage.ca/Downloads/PVEStuff/bin/TM-ShowMe</nowiki> -O TM-ShowMe</code>
* <code>chmod +x TM*</code>
* <code>chmod +x TM*</code>


You will need to edit '''TM-upsstatus''' to match local configurations (i.e. UPS name).
You will need to edit '''TM-UPSstatus''' to match local configurations (i.e. UPS name).


Running <code>TMUX-console</code> at the console will create a formatted screen of useful system information that you can reach by attaching to the '''tmux''' session from a terminal (SSH) session.
Running <code>TMUX-console</code> at the console will create a formatted screen of useful system information that you can reach by attaching to the '''tmux''' session from a terminal (SSH) session.

Latest revision as of 14:11, 11 October 2025

For doing basic setup of an LXC (or pretty much any Linux VM...) (Heck, I run these on physical machines too.):

I run this set of commands as root on nearly every new VM or LXC I spin up. That way, I have a consistant environment to work in with all the tools I rely on.

Note: You CAN copyPasta groups of commands all at once. BUT: in this case, everything indented (after su - yourname) needs to be pasted AFTER that command has run.

  • apt update
  • apt -y upgrade
  • apt -y install sudo rsync vim curl mosquitto-clients
  • wget https://www.nerdmage.ca/Downloads/RootStuff/DOT.bashrc -O .bashrc
  • wget https://www.nerdmage.ca/Downloads/RootStuff/DOT.vimrc -O .vimrc
  • mkdir bin
  • source .bashrc
  • apt -y install gnupg tmux htop ### Optional...
  • apt -y install qemu-guest-agent ### Only on VMs. (Wish it worked for LXCs as well tho...)
  • adduser yourname
  • adduser yourname sudo
  • su - yourname
    • wget https://www.nerdmage.ca/Downloads/UserStuff/DOT.bashrc -O .bashrc
    • wget https://www.nerdmage.ca/Downloads/UserStuff/DOT.vimrc -O .vimrc
    • mkdir bin
    • source .bashrc
    • ssh-keygen ### Optional... But rather handy.

New System Cleanup & Prep

Freshly installed systems usually have a bunch of stuff installed that you will never use.

For myself, I don't generally have any interest in the games. I also don't use some of the Internet apps that seem important to the developers/maintainers.

These instructions are based on running Debian with the Cinnamon Desktop Environment...

Remove all the Games

  • sudo apt purge gnome-2048 aisleriot atomix gnome-chess five-or-more hitori iagno gnome-klotski lightsoff gnome-mahjongg gnome-mines gnome-nibbles quadrapassel four-in-a-row gnome-robots gnome-sudoku swell-foop tali gnome-taquin gnome-tetravex -y
  • sudo apt autoremove -y

Remove obsolete and/or silly Internet apps

  • sudo apt purge hexchat pidgin transmission-gtk thunderbird -y
  • sudo apt autoremove -y

Get rid of Firefox

  • sudo apt purge firefox*

Simplified installation techniques & instructions

Some cross-platform software seems to have Linux installation instructions written by people who have never actually used Linux.

(Or, at least, people who believe in making life difficult...)

So...

Also, many installation instructions are long-winded or confusing...

So...

Building/Installing things from source

You may have noticed that the various distro repositories tend to have outdated versions of some (most) packages. While this makes perfect sense, sometimes you want the newest features & fixes. (Or maybe you just want to enable something that the repo managers figured wouldn't be useful...)

Annoyingly, it is rather common for build instructions to suck really badly.

So...

Useful console display for Proxmox Virtual Environment

I find it nice to have stats & such on the console of a server. This way I can just look & see what's happening with the machine.

  • apt update
  • apt -y upgrade
  • apt -y install tmux htop
  • cd /usr/local/bin
  • wget https://www.nerdmage.ca/Downloads/PVEStuff/bin/TMUX-console -O TMUX-console
  • wget https://www.nerdmage.ca/Downloads/PVEStuff/bin/TM-guestlist -O TM-guestlist
  • wget https://www.nerdmage.ca/Downloads/PVEStuff/bin/TM-clusterstatus -O TM-clusterstatus
  • wget https://www.nerdmage.ca/Downloads/PVEStuff/bin/TM-systemstatus -O TM-systemstatus
  • wget https://www.nerdmage.ca/Downloads/PVEStuff/bin/TM-UPSstatus -O TM-UPSstatus
  • wget https://www.nerdmage.ca/Downloads/PVEStuff/bin/TM-FixThis -O TM-FixThis
  • wget https://www.nerdmage.ca/Downloads/PVEStuff/bin/TM-ShowMe -O TM-ShowMe
  • chmod +x TM*

You will need to edit TM-UPSstatus to match local configurations (i.e. UPS name).

Running TMUX-console at the console will create a formatted screen of useful system information that you can reach by attaching to the tmux session from a terminal (SSH) session.