Difference between revisions of "CopyPasta"

From Da Nerd Mage Wiki
Jump to navigation Jump to search
 
(27 intermediate revisions by the same user not shown)
Line 1: Line 1:
= For doing basic setup of an LXC (or pretty much any Linux VM...): =
= 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 <span style="color: rgb(22, 145, 121);" >### Optional...</span></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>


= Useful console display for Proxmox Virtual Environment =
=New System Cleanup & Prep=
Freshly installed systems usually have a bunch of stuff installed that you will never use.


* <code>apt update</code>
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.
* <code>apt -y upgrade</code>
* <code>apt -y install tmux htop</code>
* <code>cd /usr/local/bin</code>
* <code>wget <nowiki>https://www.nerdmage.ca/Downloads/PVEStuff/bin/TMUX-console</nowiki> -O TMUX-console</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-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-ShowMe</nowiki> -O TM-ShowMe</code>
* <code>chmod +x TM*</code>


You will need to edit '''TM-UPSstatus''' to match local configurations (i.e. UPS name).
These instructions are based on running Debian with the Cinnamon Desktop Environment...
==Remove all the Games==


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.
* <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>


= Installing Brave Browser =
==Remove obsolete and/or silly Internet apps==


* <code>sudo apt install apt-transport-https curl </code>
* <code>sudo apt purge hexchat pidgin transmission-gtk thunderbird -y</code>
* <code>sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg <nowiki>https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg </nowiki></code>
* <code>sudo apt autoremove -y</code>
* <code>echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] <nowiki>https://brave-browser-apt-release.s3.brave.com/</nowiki> stable main"|sudo tee /etc/apt/sources.list.d/brave-browser-release.list </code>
* <code>sudo apt update </code>
* <code>sudo apt install brave-browser </code>


= Installing TP-Link Omada SDN Controller on a Debian-based LXC =
== Get rid of Firefox ==
* <code>sudo apt purge firefox*</code>


(Debian 12, 4GB RAM, 4 cores)
= Simplified installation techniques & instructions =
Some cross-platform software seems to have Linux installation instructions written by people who have never actually used Linux.


<span style="color: rgb(132, 63, 161);" >Start with the prerequisites:</span>
(Or, at least, people who believe in making life difficult...)


* <code>sudo apt update && sudo apt install openjdk-17-jre-headless jsvc curl gnupg -y</code>
So...
** <code>wget <nowiki>http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1-1ubuntu2.1~18.04.23_amd64.deb</nowiki></code>
** <code>sudo dpkg -i libssl1.1_1.1.1-1ubuntu2.1~18.04.23_amd64.deb</code>
* <code>curl -fsSL <nowiki>https://www.mongodb.org/static/pgp/server-4.4.asc</nowiki> {{!}} sudo apt-key add -</code>
* <code>echo "deb [ arch=amd64,arm64 ] <nowiki>https://repo.mongodb.org/apt/ubuntu</nowiki> focal/mongodb-org/4.4 multiverse" {{!}} sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list</code>
* <code>sudo apt update && sudo apt install mongodb-org</code>
* <code>sudo systemctl start mongod.service</code>
* <code>sudo systemctl status mongod</code>
* <code>sudo systemctl enable mongod</code>
<span style="color: rgb(132, 63, 161);" >Install SDN:</span>


* <code>sudo wget wget <nowiki>https://static.tp-link.com/upload/software/2023/202312/20231201/Omada_SDN_Controller_v5.13.22_Linux_x64.tar.gz</nowiki></code>
* [[Installing Brave Browser]] (Properly... Not FLATPAK)
* <code>tar zxvf Omada_SDN_Controller_v5.12.7_linux_x64.tar.gz</code>
* [[Installing TP-Link Omada SDN Controller on a Debian-based LXC]]
* <code>cd Omada_SDN_Controller_v5.12.7_linux_x64</code>
Also, many installation instructions are long-winded or confusing...
* <code>sudo bash ./install.sh</code>
or (Tho this seems to fail weirdly whenever they update the version while the tar.gz version doesn't):


* <code>wget <nowiki>https://static.tp-link.com/upload/software/2023/202312/20231201/Omada_SDN_Controller_v5.13.22_Linux_x64.deb</nowiki></code>
So...
* <code>sudo dpkg -i ./Omada_SDN_Controller_v5.13.22_Linux_x64.deb</code>


Upon install, Omada Controller will start up.  Eventually.  It does seem to take a VERY long time for it's first start...
* [[Installing Docker on a Debian-based system]]


https://'''SERVERADDRESS''':8043/
= 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...)


<span style="font-size: 18pt; color: rgb(132, 63, 161);">'''CERTS!!!'''</span>
Annoyingly, it is rather common for build instructions to suck really badly.


You'll need to have your proper certs downloaded & then [https://support.tsplus.net/support/solutions/articles/44000038469-how-to-convert-different-ssl-https-certificate-formats-to-java-jks- mess with making a .PFX file from them]...
So...


(Really, just Part B, Step 1 at that link.)
* [[Arp-Scan from Source{{!}}Arp-Scan]]
* [[FreeCAD from Source{{!}}FreeCAD]]
* [[KiCAD from Source{{!}}KiCAD]]
* [[Mosquitto from Source{{!}}Mosquitto]]


Then install/update via the UI & fully reboot the server/VM/LXC to activate it... :(
= 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.


=Building FreeCAD from source on LMDE6=
* <code>apt update</code>
Based on: [https://wiki.freecad.org/Compile_on_Linux FreeCAD Documentation / Compile on Linux]
* <code>apt -y upgrade</code>
* <code>apt -y install tmux htop</code>
* <code>cd /usr/local/bin</code>
* <code>wget <nowiki>https://www.nerdmage.ca/Downloads/PVEStuff/bin/TMUX-console</nowiki> -O TMUX-console</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-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-ShowMe</nowiki> -O TM-ShowMe</code>
* <code>chmod +x TM*</code>


'''<span style="color: rgb(132, 63, 161);" data-mce-style="color: #843fa1;">The required tools:</span>'''
You will need to edit '''TM-UPSstatus''' to match local configurations (i.e. UPS name).


* <code>sudo apt install git cmake <s>cmake-gui </s></code>
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.
 
'''<span style="color: rgb(132, 63, 161);" data-mce-style="color: #843fa1;">Get the source:</span>'''
 
<span style="color: rgb(153, 51, 102);" data-mce-style="color: #993366;">'''Note: This builds a non-stable version.''' (Whatever state the code is currently in...)</span>
 
* <code>git clone --recurse-submodules <nowiki>https://github.com/FreeCAD/FreeCAD.git</nowiki> freecad-source</code>
 
'''<span style="color: rgb(132, 63, 161);" data-mce-style="color: #843fa1;">or maybe:</span>'''
 
<span style="color: rgb(153, 51, 102);" data-mce-style="color: #993366;">'''Note: This should build a stable version.''' (You can change branch to match current stable version...)</span>
 
* <code>git clone --recurse-submodules <nowiki>https://github.com/FreeCAD/FreeCAD.git</nowiki> --branch releases/FreeCAD-0-21 freecad-source</code>
 
'''<span style="color: rgb(132, 63, 161);" data-mce-style="color: #843fa1;">The prerequisites:</span>'''
 
* <code>sudo apt install libboost-date-time-dev libboost-dev libboost-filesystem-dev libboost-graph-dev libboost-iostreams-dev libboost-program-options-dev libboost-python-dev libboost-regex-dev libboost-serialization-dev libboost-thread-dev libcoin-dev libeigen3-dev libgts-bin libgts-dev libkdtree++-dev libmedc-dev libocct-data-exchange-dev libocct-ocaf-dev libocct-visualization-dev libopencv-dev libproj-dev libpyside2-dev libqt5opengl5-dev libqt5svg5-dev qtwebengine5-dev libqt5x11extras5-dev libqt5xmlpatterns5-dev libshiboken2-dev libspnav-dev libvtk9-dev libx11-dev libxerces-c-dev libzipios++-dev occt-draw pyside2-tools python3-dev python3-matplotlib python3-packaging python3-pivy python3-ply python3-pyside2.qtcore python3-pyside2.qtgui python3-pyside2.qtsvg python3-pyside2.qtwidgets python3-pyside2.qtnetwork python3-pyside2.qtwebengine python3-pyside2.qtwebenginecore python3-pyside2.qtwebenginewidgets python3-pyside2.qtwebchannel python3-markdown python3-git qtbase5-dev qttools5-dev swig libyaml-cpp-dev</code>
 
'''<span style="color: rgb(132, 63, 161);" data-mce-style="color: #843fa1;">Set it up:</span>'''
 
* <code>cd freecad-source/</code>
* <code>mkdir build</code>
* <code>cd build</code>
 
* <code>cmake ../</code>
 
'''<span style="color: rgb(132, 63, 161);" data-mce-style="color: #843fa1;">Build it:</span>'''
 
* <code>make -j$(nproc --ignore=2)</code>
 
'''<span style="color: rgb(132, 63, 161);" data-mce-style="color: #843fa1;">Install it:</span>'''
 
* <code>sudo make install</code>

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.