Skip to content

Instantly share code, notes, and snippets.

View udoyen's full-sized avatar

george udosen udoyen

View GitHub Profile
Java Paramter Type Names
E – Element (used extensively by the Java Collections Framework, for example ArrayList, Set etc.)
K – Key (Used in Map)
N – Number
T – Type
V – Value (Used in Map)
S,U,V etc. – 2nd, 3rd, 4th types
@udoyen
udoyen / iptables-round-robin.sh
Created June 5, 2019 07:44 — forked from apparentlymart/iptables-round-robin.sh
round robin to three ports on the same host with iptables
# The following example shows a way to use iptables for basic round-robin load balancing, by redirecting
# packets two one of three ports based on a statistic counter.
#
# TCP packets for new sessions arriving on port 9000 will rotate between ports 9001, 9002 and 9003, where
# three identical copies of some application are expected to be listening.
#
# Packets that aren't TCP or that related to an already-established connection are left untouched, letting
# the standard iptables connection tracking machinery send it to the appropriate port.
#
# For this to work well, connections need to be relatively short. Ideally there would be an extra layer
@udoyen
udoyen / vscode-ubuntu
Created June 15, 2019 16:36
vscode-ubuntu
[
{
"metadata": {
"id": "850c6bb1-4a81-4f83-a81f-835d651a211c",
"publisherId": "Mikael.Angular-BeastCode",
"publisherDisplayName": "Mikael"
},
"name": "Angular-BeastCode",
"publisher": "Mikael",
"version": "8.0.7"
@udoyen
udoyen / merger.sh
Last active June 28, 2019 13:34
How to merge pdf files using the pdfunite tool on linux
#!/usr/bin/env bash
set -e # Quit on first error
count=0
for i in ./*/*
do
my_array["$count"]="$i" # Creates an array with the filenames
((++count)) # Increase the array index
echo ${my_array[@]} # Echo the contents of the array
done
@udoyen
udoyen / monitor.sh
Created December 24, 2019 09:27
Bash script to use and monitor wifi hotspot connections on linux systems
#!/usr/bin/env bash
# how_wifi_clients.sh
# Shows MAC, IP address and any hostname info for all connected wifi devices
# written for openwrt 12.09 Attitude Adjustment
# modified by [email protected] from http://wiki.openwrt.org/doc/faq/faq.wireless#how.to.get.a.list.of.connected.clients
function mon () {
echo "# All connected wifi devices, with IP address,"

Update 7/28/2019: An updated version of this guide for Ubuntu Server 18.04 LTS is now available. Feel free to check it out.

Mounting VirtualBox shared folders on Ubuntu Server 16.04 LTS

This guide will walk you through steps on how to setup a VirtualBox shared folder inside your Ubuntu Server guest. Tested on Ubuntu Server 16.04.3 LTS (Xenial Xerus)

Steps:

  1. Open VirtualBox
  2. Right-click your VM, then click Settings
  3. Go to Shared Folders section

Update 7/28/2019: An updated version of this guide for Ubuntu Server 18.04 LTS is now available. Feel free to check it out.

Mounting VirtualBox shared folders on Ubuntu Server 16.04 LTS

This guide will walk you through steps on how to setup a VirtualBox shared folder inside your Ubuntu Server guest. Tested on Ubuntu Server 16.04.3 LTS (Xenial Xerus)

Steps:

  1. Open VirtualBox
  2. Right-click your VM, then click Settings
  3. Go to Shared Folders section

Mounting VirtualBox shared folders on Ubuntu Server 18.04 LTS (Bionic Beaver)

This guide will walk you through the steps on how to setup a VirtualBox shared folder inside your Ubuntu Server guest.

Prerequisites

This guide assumes that you are using the following setup:

You could still make this guide work with other setups (possibly with some modifications to the commands and whatnot).

@udoyen
udoyen / README.md
Created May 28, 2020 18:58 — forked from eruvanos/README.md
Simple mock server for testing using Flask

Mock server for testing using flask

License

MIT

Prepare

Install flask and requests to run this example.