Small utilities
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
include
src
tests
.gitignore
CMakeLists.txt
LICENSE
README.md

README.md

cxx_utils

Small utilities

rand_line

Reads a file passed as argument and returns a random line from it:

$ ./rand_line /usr/share/dict/words
puddle

lurker

Simple grep-like utility. Recursively scans current directory for specific pattern. For now accepts only string and doesn't print anything except matched lines:

$ ./lurker random_device
./src/bulls_and_cows.cxx
10:    random_device rd;
./src/rand_line.cxx
26:    random_device rd;

rand_int

Generates random numbers in specified range:

$ ./rand_int 1 6 3
3
5
2
$ ./rand_int -2 2 2
-1
2

valid_ip_address

Tests if passed string is a valid IP address.

$ ./valid_ip_address --address ::1 # returns 0
$ ./valid_ip_address --address 127.0.0.1 # returns 0
$ ./valid_ip_address --address dog # returns 1