Tuesday, December 4, 2018

Budget gaming PC (~1000€) for Christmas 2018

CPU AMD Ryzen 5 2600X AM4 Box
Motherboards Gigabyte GA-AB350-Gaming
Ram Memory Corsair DDR 4 16G (8Gx2) 2400 CL14 Vengeance LPX Red CMK16GX4M2A2400C14R
Cases Corsair Carbide 100R Mid Tower Black
Power Supplies Corsair CX450M 450W PSU 80+ Bronze Modular
SSD Drives Samsung SSD 500GB 860 EVO M.2
Video Cards Sapphire RX 580 PULSE 8G GDDR5
Software Windows 10 Pro 64 Bit

This is the most cost effective PC I could come with for people with a relatively limited budget, still allowing to play the most recent games with more than acceptable performance.

Cost could be brought further down with small impact on performance by downgrading the CPU to AMD Ryzen 5 2600 (instead of the X version), Radeon RX 570 (instead of the 580), cheaper motherboard and ram etc.
I would stick with 16GB of RAM and at least 500GB of storage. Mechanical disks (aka HDD/spinners) are best avoided as they will cause a performance hit to your PC.

Tuesday, June 5, 2018

Bash - get flags and arbitrary strings in no particular order


#!/bin/bash

# Get arguments and separate them to flags and arbitrary strings
# Execution example: ./get_opts.sh Something -w 10 somethingElse -c20 whatever

# For debug purpose, show everything we received:
# echo $@

# Save original arguments for later use / debug purpose
original_arguments="$@"

# Initialize variable
strings=""

# While there are arguments, keep looping
while (( "$#" )); do
case "$1" in
# if the next argument begins with '-w'
-w*)
# Put all the digits in this or the next argument in  the variable 'warn' and shift the argument array
warn=$(echo $1|tr -cd  '[[:digit:]]')
if [ "$warn" ]; then shift 1;
else warn=$(echo $2|tr -cd  '[[:digit:]]'); shift 2;
fi
;;
# if the next argument beings with '-c'
-c*)
# put all the digits in this or the next argument in the variable 'crit' and shift the argument array
crit=$(echo $1|tr -cd  '[[:digit:]]')
if [ "$crit" ]; then shift 1;
else crit=$(echo $2|tr -cd  '[[:digit:]]'); shift 2;
fi
;;
*)
# Arbitrary strings go here
strings="${strings} $1"
shift
;;
esac
done
echo Warn=${warn} Crit=${crit} Arbitary strings=${strings}
exit