Skip to content

Instantly share code, notes, and snippets.

View slashtechno's full-sized avatar
🚀
Floating through space 🌌 🌎

slashtechno

🚀
Floating through space 🌌 🌎
View GitHub Profile
@slashtechno
slashtechno / commandAtBoot.md
Last active March 10, 2021 21:29
How to execute command at boot

To execute a command at boot:

Edit ~./bashrc and add whatever

@slashtechno
slashtechno / sshlog.md
Created April 12, 2021 22:14
How to log ssh attempts

Logging SSH attempts

Linux (Ubuntu at least) keeps logs by default for SSH to see them in a good format:

run lastb

Drawbacks

Sadly this does not tell if it is failed or successful login.

@slashtechno
slashtechno / staticWebsiteGenerators.md
Last active April 30, 2021 15:02
Best Static Website Generators
  1. Publii (I am using this currently)
  2. Siteleaf
  3. Bearblog
  4. PieCrust, similar to Bearblog
  5. Primo Drag and Drop static website maker. In my opinion not as good as Publii
@slashtechno
slashtechno / cliarguments.py
Created June 18, 2021 00:24
accept cli arguments in Python
#!/bin/python3
import argparse
cli_options = argparse.ArgumentParser()
cli_options.add_argument("--hello")
cli_options.add_argument("--world")
args = cli_options.parse_args()
host=args.host
port=args.port
print(host)
print(port)
@slashtechno
slashtechno / ubuntu-ssh-server
Last active July 21, 2021 22:12
Install SSH server onto Ubuntu
#!/bin/bash
# Just run this program with bash ubuntu-ssh-server or copy and paste the commands
sudo apt-get update
sudo apt-get install openssh-server -y
sudo systemctl start ssh
sudo systemctl enable ssh
@slashtechno
slashtechno / mc-server-install.sh
Last active October 17, 2021 22:49
Minecraft Server install script (tested on Pi 4, 4gb ram)
#!/bin/bash
mkdir minecraft
cd minecraft
wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
# java -Xmx1024M -jar BuildTools.jar for the latest version
java -Xmx2024M -jar BuildTools.jar --rev 1.16.5 #java -Xmx1024M -jar BuildTools.jar --rev 1.16.5
java -Xms512M -Xmx2024M -jar minecraft/spigot* nogui #java -Xms512M -Xmx2016M -jar minecraft/spigot* nogui
rm eula.txt
wget https://gist.githubusercontent.com/slashtechno/7fc6225d3b0023a7b1be7da49e0ca4ce/raw/1ec68a713c7ff8a336d1cc5ad683e80a3ca20b9b/eula.txt
echo run "java -Xms512M -Xmx20242M -jar spigot* nogui" inside the directory "minecraft" to run the server # java -Xms512M -Xmx2016M -jar spigot* nogui
@slashtechno
slashtechno / simple-service.service
Created November 7, 2021 16:18
Simple Systemd Script
# How to create systemd services: http://neilwebber.com/notes/2016/02/10/making-a-simple-systemd-file-for-raspberry-pi-jessie/
[Unit]
Description= Hello, world!
[Service]
User= <put user here>
WorkingDirectory=<put directory the command should be run in>
ExecStart=<path to command>
[Install]
WantedBy=multi-user.target
@slashtechno
slashtechno / install_rpiplay.sh
Created December 29, 2021 00:12
RpiPlay install script for Raspberry Pi OS Bullseye
git clone https://github.com/FD-/RPiPlay.git
cd RPiPlay
sudo apt-get install cmake -y
sudo apt-get install libavahi-compat-libdnssd-dev -y
sudo apt-get install libplist-dev -y
sudo apt-get install libssl-dev -y
sudo apt-get install libx264-dev libjpeg-dev -y
sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-ugly gstreamer1.0-tools gstreamer1.0-gl gstreamer1.0-gtk3 --fix-missing -y
mkdir build
@slashtechno
slashtechno / install-docker
Last active January 4, 2022 23:53
Install Docker on Ubuntu
#!/bin/bash
# Just to bash install-docker when in the directory you downloaded this script to or copy and paste commands
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
sudo apt update
sudo apt install docker-ce
sudo usermod -aG docker $USER
@slashtechno
slashtechno / xfce-ubuntu.md
Created May 21, 2021 23:08
Install Xfce or Xubuntu and Uninstall

How to install XFCE or Xubuntu Desktop enviroment on Ubuntu and unninstall

Install XFCE

sudo apt install xfce4

Install Xubuntu

sudo apt install xubuntu-desktop

Uninstall XFCE

sudo apt purge xubuntu-icon-theme xfce4-* &amp;&amp; sudo apt autoremove