Skip to content

Instantly share code, notes, and snippets.

View TeroKeso's full-sized avatar

Tero Keso TeroKeso

View GitHub Profile
@TeroKeso
TeroKeso / user_package_manage.md
Created August 28, 2024 13:45 — forked from dipaish/user_package_manage.md
User Management in Ubuntu

User Management in Linux

Adding and removing users on a Linux system is crucial for system administration. Typically, you start with just the root account, which has full control but can be risky. It's better to create standard users (with no admin rights) for common tasks. In order to execute commands with superuser privileges, you can either log in as a root user (sudo su , not recommended) or use sudo with your commands (recommended).

To perform admin tasks, Ubuntu has a tool called sudo, allowing you to run commands as other users, including administrators.

Create a New User.

You can use the useradd command to add a new user to the system.

  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@TeroKeso
TeroKeso / 00 - A collection of free DNS Servers
Created May 24, 2024 10:31 — forked from kasuken/00 - A collection of free DNS Servers
Set and Reset DNS Settings with PowerShell
A collection of my favorites DNS
@TeroKeso
TeroKeso / Readme.md
Created April 1, 2024 12:03 — forked from saniaky/Readme.md
Docker + nginx-proxy + let's encrypt + watchtower + fail2ban

Complete solution for websites hosting

This gist contains example of how you can configure nginx reverse-proxy with autmatic container discovery, SSL certificates generation (using Let's Encrypt) and auto updates.

Features:

  • Automatically detect new containers and reconfigure nginx reverse-proxy
  • Automatically generate/update SSL certificates for all specified containers.
  • Watch for new docker images and update them.
  • Ban bots and hackers who are trying to bruteforce your website or do anything suspicious.
@TeroKeso
TeroKeso / derper
Last active March 26, 2024 09:10 — forked from amanjuman/derper
TailScale Derper Install on Linux
## Download Go
sudo wget --output-document /opt/go.tar.gz https://go.dev/dl/go1.22.0.linux-amd64.tar.gz
## Remove Existing Go and Extract Downloaded Go
sudo rm -rf /usr/local/go && sudo tar --directory /usr/local --extract --gzip --file /opt/go.tar.gz && sudo rm /opt/go.tar.gz
## Delete Derp if there is & Recreate user for Derper
sudo userdel -r derp & sudo useradd --system --create-home --home-dir /opt/derp --shell /bin/bash derp
@TeroKeso
TeroKeso / VMwareFusion_Export_ovf.txt
Last active November 28, 2024 14:34 — forked from xl7dev/VMwareFusion_Export_ovf.txt
HowTo Export a VM in OVA format in VMware Fusion for OS X
> cd /Applications/VMware\ Fusion\ Tech\ Preview.app/Contents/Library/VMware\ OVF\ Tool
> ./ovftool --acceptAllEulas /Users/$USER/Virtual\ Machines.localized/Windows\ 11\ 64-bit\ Arm\ 2.vmwarevm/Virtual\ Disk.vmx /Users/$USER/export.ova

How to install game-porting-toolkit (aka proton for macOS)

What is this?

In the recent WWDC, Apple announced and released the "game porting toolkit", which upon further inspection this is just a modified version of CrossOver's fork of wine which is a "compatibility layer" that allows you to run Windows applications on macOS and Linux.

Why would I want this?

Playing Windows games on MacOS

@TeroKeso
TeroKeso / Install-WSLAndUbuntu.ps1
Created November 10, 2022 13:44 — forked from ScriptAutomate/Install-WSLAndUbuntu.ps1
Enable WSL and Install Ubuntu 22.04 (or 20.04)
<#
- BIOS of host machine also needs to be configured to allow hardware virtualization
- Windows 10 Pro or otherwise is needed; Windows 10 Home Edition CANNOT get WSL
- This gist WSLv2, but can use WSLv1 instead. I needed v1 as I run Windows 10 in a VM in Virtualbox.
- WSLv2 has been giving me problems in Virtualbox 6.1, but WSLv1 works properly.
- vbox has issues with the GUI settings when it comes to nested virtualization on certain systems,
so run the following if needing to give a VM this enabled setting:
VBoxManage modifyvm <vm-name> --nested-hw-virt on
#>
@TeroKeso
TeroKeso / DNS_TO_LOCALHOST.markdown
Created September 17, 2021 07:18 — forked from tinogomes/DNS_TO_LOCALHOST.markdown
Public DNS Pointing to localhost (127.0.0.1)

Available Public Wildcard DNS Domains pointing to localhost (127.0.0.1)

It turns out that some kind hearted people already set up wildcard domains for you already. You can use any domain below and/or any subdomain of these and they currently resolve to 127.0.0.1 but could switch at any time to resolve somewhere else. Here's the list of ones I know about. Let me know if there are more!

  • localhost - It will always works. Do you know why? I hope so.
  • [*.]fuf.me - Managed by @fidian; it will always point to localhost for IPv4 and IPv6
  • [*.]fbi.com - 👏 👏 👏 👏 👏
  • [*.]localtest.me
  • [*.]127-0-0-1.org.uk
  • [*.]vcap.me
@TeroKeso
TeroKeso / .screenrc
Created November 12, 2020 16:35 — forked from joaopizani/.screenrc
A killer GNU Screen Config
# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 5000
# no welcome message
startup_message off