Evaggelos Balaskas - System Engineer

The sky above the port was the color of television, tuned to a dead channel

Blog
Posts
Wiki
About
Contact
rss.png twitter linkedin github gitlab profile for ebal on Stack Exchange

Next Page »
  -  
May
23
2015
Create TRUE random passwords
Posted by ebal at 19:48:11 in blog, planet_ellak, planet_Sysadmin


There is an errata blog post for this one !!!

tldr;


$ cat /dev/urandom  | tr -dc '[\x21-\x7E]' | head -c 16

(Not so) Long Story:

In Linux (we trust) we have a device that create randomness, named: /dev/random

The problem with this device is that the pool entropy (is something useful, believe me) can ran out very quickly.
So instead of random we use urandom. This device takes some output and re-entering it into the pool entropy, so that the entropy pool can never be empty.

Enough with all this tech crap … nobody truly cares …

We want to take some randomness from /dev/urandom … but … the output isnt something useful:


$ cat /dev/urandom  | head

urandom.jpg

so we need to take only the ASCII printable characters from that output.

Looking at the ascii table, we found out that the printable characters starts from:


hexadecimal: 21
to
hexadecimal: 7E

So to get the first n characters we can use the head command.
To get the first 16 characters: head -c 16

To put everything together:


$ cat /dev/urandom  | tr -dc '[\x21-\x7E]' | head -c 16
JY`Fidt:sI>KoElR

$ cat /dev/urandom  | tr -dc '[\x21-\x7E]' | head -c 16
LH[lskwStlgM:

$ cat /dev/urandom  | tr -dc '[\x21-\x7E]' | head -c 16
Eifen5W1F@Vrqsc
Tag(s): random, password
    Tag: random, password
May
17
2015
best conspiracy theory EVER
Posted by ebal at 22:42:32 in blog

This post is only in Greek - sorry about that.

Βρίσκομαι έξω από το κτήριο των αρχαιολόγων στο common fest και την ώρα που ο Richard M Stalman μίλαγε για ελεύθερο λογισμικό κι ελευθερίες, μια ομάδα πιτσιρικάδων συζητάνε μεταξύ τους:

  • Ρε, όλα έχουν τον σκοπό τους.
  • Έλα ρε, γιατί το λες αυτό ?
  • Και ποιος μου λέει, ρε συ, ότι δεν τον πληρώνουν αυτόν εδώ οι εταιρείες για να λέει στον κόσμο να μην βάζει windows !
Tag(s): commonfest, rms
    Tag: commonfest, rms
May
08
2015
pnp4nagios selinux
Posted by ebal at 12:07:33 in blog, planet_ellak, planet_Sysadmin

I have found a few difficulties with pnp4nagios and SElinux:

So here are my notes:


module httpd_pnp4nagios 1.0;

require {
        type httpd_t;
        type nagios_var_lib_t;
        class dir       { getattr search open read };
        class file      { getattr open read };
}

#============= httpd_t ==============
allow httpd_t nagios_var_lib_t:dir      { getattr search open read };
allow httpd_t nagios_var_lib_t:file     { getattr open read };

With the above policy we give privileges on httpd to directories with the tag nagios_var_lib_t (like /var/lib/pnp4nagios/ ).

Checking the module:


# checkmodule -M -m -o httpd_pnp4nagios.mod httpd_pnp4nagios.te

Creating the module:


# semodule_package -o httpd_pnp4nagios.pp -m httpd_pnp4nagios.mod

And finally install the policy:


# semodule -i httpd_pnp4nagios.pp
Tag(s): pnp4nagios, selinux
    Tag: pnp4nagios, selinux
  -  

Search

Admin area

  • Login

Categories

  • blog
  • wiki
  • pirsynd
  • midori
  • books
  • archlinux
  • movies
  • xfce
  • code
  • beer
  • planet_ellak
  • planet_Sysadmin
  • microblogging
  • UH572
  • KoboGlo
  • planet_fsfe

Archives

  • 2025
    • April
    • March
    • February
  • 2024
    • November
    • October
    • August
    • April
    • March
  • 2023
    • May
    • April
  • 2022
    • November
    • October
    • August
    • February
  • 2021
    • November
    • July
    • June
    • May
    • April
    • March
    • February
  • 2020
    • December
    • November
    • September
    • August
    • June
    • May
    • April
    • March
    • January
  • 2019
    • December
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2018
    • December
    • November
    • October
    • September
    • August
    • June
    • May
    • April
    • March
    • February
    • January
  • 2017
    • December
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2016
    • December
    • November
    • October
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2015
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • January
  • 2014
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2013
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2012
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2011
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2010
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2009
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
Ευάγγελος.Μπαλάσκας.gr

License GNU FDL 1.3 - CC BY-SA 3.0