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 / Dockerfile.devenv
Last active August 21, 2023 00:20
Dockerfile to create a Ubuntu container with zsh and shellinabox
# docker build --file Dockerfile-devenv.txt -t devenv .
# docker run -it --name devenv -p 4200:4200 -d devenv zsh
FROM ubuntu:latest
ARG USERNAME=user
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
@slashtechno
slashtechno / README.md
Last active September 18, 2022 17:01
HTML meant to be set as a redirect URI for OAuth2 in order to display the authorization code

OAuth Code Viewer

A simple website to extract the code from an OAuth2 callback.
If state exists, output the URL instead

from python_on_whales import docker
output = docker.run(image="ubuntu", detach=True, tty=True, interactive=True, publish=[(80, 80), (8080, 8080)], name = "hello", remove=True)
# Both are equal
print(output)
print(docker.container.inspect(output))
docker.container.execute(container = output, command = "bash", tty=True, interactive=True)
docker.container.remove(output, force=True)
@slashtechno
slashtechno / .vimrc
Created June 19, 2022 23:09
Prevent Vim from creating backup files in the working directory
set backupdir=$HOME/vimfiles/tmp/
set undodir=$HOME/temp/vimfiles/tmp/
@slashtechno
slashtechno / crossCompileGo.sh
Last active June 16, 2022 20:57
Script to cross compile a Go file
#!/usr/bin/bash
# Edited code from https://opensource.com/article/21/1/go-cross-compiling
# xgo (https://github.com/techknowlogick/xgo) is a better solution for programs which use more than one Go file
archsLinux=(amd64 arm64 arm)
archsWindows=(amd64 arm arm64 386)
programName=
for arch in ${archsLinux[@]}
do
env GOOS=linux GOARCH=${arch} go build -o ../binaries/${programName}_linux_${arch} main.go
@slashtechno
slashtechno / alias-change-directory.sh
Created May 14, 2022 19:16
Function to quickly change to a specific directory in a drive (bash, zsh, etc)
x() {
cd /media/<user>/<drive>/"${1:-}"
}
@slashtechno
slashtechno / mc-server.service
Last active May 1, 2022 21:18
systemd service to run MC server
[Unit]
Description= minecraft server service
[Service]
User=pi
WorkingDirectory=/home/pi/minecraft-servers/survival-1.18.2
ExecStart=/usr/bin/java -Xms512M -Xmx2048M -jar /home/pi/minecraft-servers/survival-1.18.2/spigot-1.18.2.jar nogui
[Install]
WantedBy=multi-user.target
@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

@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 / 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