Skip to content

Instantly share code, notes, and snippets.

View zoonderkins's full-sized avatar
🏠
Working 👍

Quack~ zoonderkins

🏠
Working 👍
View GitHub Profile

First of all, I must say that I'am not a fan or user of Ubuntu. This is just a guide for newcomers, and colleagues that are struggling after the new release with the system changes.

Repositories configurations and system upgrade

Right after fresh install, you must do a system update. Don't delay it, but first, let's configure repositories. Delete the new config for repositories, this can cause problems or new users can get lost configuring it, have friends reporting me that:

sudo rm /etc/apt/sources.list.d/ubuntu.sources
  • 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 \" \
@zoonderkins
zoonderkins / README.md
Created October 3, 2022 06:15 — forked from sutlxwhx/README.md
Synchronize folders between two servers using rclone and ssh-agent with ssh based authorisation

Introduction

This tutorial will help you transfer your folders / files between two server using rclone and ssh-agent.
It was tested between two Ubuntu 16.04 servers.

Installation

First things first. We need to install the neccessary packages:

apt-get update -y
@zoonderkins
zoonderkins / gist:213d6c3a23f855150eb67eee74d49ae2
Created June 21, 2022 19:20 — forked from clyang/gist:4f3e9f4098469cf53715ed64bede3932
10GB以上的測速檔案 (IPv4及IPv6) - 10GB+ Speedtest file urls (IPv4 & IPv6)
http://download.xs4all.nl/test/10GB.bin
http://ftp.iinet.net.au/test500MB.dat
http://lg-tor.fdcservers.net/10GBtest.zip
http://lg.ams2-c.fdcservers.net/10GBtest.zip
http://lg.chi2-c.fdcservers.net/10GBtest.zip
http://lg.den2-c.fdcservers.net/10GBtest.zip
http://lg.fra2-c.fdcservers.net/10GBtest.zip
http://lg.la2-c.fdcservers.net/10GBtest.zip
http://lg.lon-c.fdcservers.net/10GBtest.zip
http://lg.mad-c.fdcservers.net/10GBtest.zip
@zoonderkins
zoonderkins / optimal_mtu.md
Created June 6, 2022 09:02 — forked from nitred/optimal_mtu.md
Wireguard Optimal MTU

About

  • I faced bandwidth issues between a WG Peer and a WG server. Download bandwidth when downloading from WG Server to WG peer was reduced significantly and upload bandwidth was practically non existent.
  • I found a few reddit posts that said that we need to choose the right MTU. So I wrote a script to find an optimal MTU.
  • Ideally I would have liked to have run all possible MTU configurations for both WG Server and WG Peer but for simplicity I choose to fix the WG Server to the original 1420 MTU and tried all MTUs from 1280 to 1500 for the WG Peer.

Testing

  • On WG server, I started an iperf3 server
  • On WG peer, I wrote a script that does the following:
    • wg-quick down wg0
  • Edit MTU in the /etc/wireguard/wg0.conf file
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Import additional configuration files
#
# Imports are loaded in order, skipping all missing files, with the importing
# file being loaded last. If a field is already present in a previous import, it
# will be replaced.
#
# All imports must either be absolute paths starting with `/`, or paths relative
# to the user's home directory starting with `~/`.
@zoonderkins
zoonderkins / npm-audit.md
Last active May 7, 2021 03:08 — forked from KittyGiraudel/npm-audit.js
npm-audit
const { exec } = require('child_process')
const { promisify } = require('util')
const chalk = require('chalk')

// See: https://docs.npmjs.com/about-audit-reports#severity
const SEVERITY_LEVELS = ['low', 'moderate', 'high', 'critical']
const SEVERITY_THRESHOLD = 'critical'
const run = promisify(exec)
@zoonderkins
zoonderkins / npm-audit_report-generation.sh
Created May 5, 2021 03:12 — forked from aravindkumarsvg/npm-audit_report-generation.sh
Generates npm audit report for multiple directories and searching for multiple package.json inside those given directories
#!/bin/bash
# Global variable declarations
format="json"
directories=()
current_directory=`pwd`
report_directory="${current_directory}/report/"
fresh_report_directory="0"
# usage
@zoonderkins
zoonderkins / raspi-setup-gitea.md
Created May 3, 2021 09:27 — forked from afragen/raspi-setup-gitea.md
Installing Gitea on Raspberry Pi 3 b+ with nginx and automatic backups

Setup Gitea on Raspberry Pi (3b+)

These instructions are based on this article: https://docs.gitea.io/en-us/install-from-source/.

Setup Raspberry Pi with minimal Raspbian image. You need to connect to the HDMI port and set the following:

Use Noobs to install Raspian.

Open menu Preferences > Raspberry Pi Settings

@zoonderkins
zoonderkins / aria2
Created April 6, 2021 09:44
command line download of torrent magnet link using aria2
# Command to download file via bittorrent magnet link using aria2.
# See website and documentation at https://aria2.github.io
# -d specifies the directory to store the downloaded file
# --seed-time=0 disables seeding after download has completed
aria2c -d ~/Downloads --seed-time=0 "magnet:?xt=urn:btih:248D0A1CD08284299DE78D5C1ED359BB46717D8C"