How to reduce the size of RHEL/Centos/Fedora Docker image

Yes Docker image sizes can be dramatically reduced by doing a “yum clean all” Initial RHEL Image Size = 196M Dockerfile – RHEL Image(+bc) = 505M # Build command # docker build -t rhel7base:latest –build-arg REG_USER='<redhat_developer_user>’ –build-arg REG_PSWD='<password>’ –squash . FROM registry.access.redhat.com/rhel7/rhel:latest LABEL maintainer=”tim” ARG REG_USER=none ARG REG_PSWD=none RUN subscription-manager register –username $REG_USER –password $REG_PSWD … Read more

python sys.exit not working in try [duplicate]

sys.exit() raises an exception, namely SystemExit. That’s why you land in the except-block. See this example: import sys try: sys.exit() except: print(sys.exc_info()[0]) This gives you: <type ‘exceptions.SystemExit’> Although I can’t imagine that one has any practical reason to do so, you can use this construct: import sys try: sys.exit() # this always raises SystemExit except … Read more

Segfault on declaring a variable of type vector

Given the point of crash, and the fact that preloading libpthread seems to fix it, I believe that the execution of the two cases diverges at locale_init.cc:315. Here is an extract of the code: void locale::_S_initialize() { #ifdef __GTHREADS if (__gthread_active_p()) __gthread_once(&_S_once, _S_initialize_once); #endif if (!_S_classic) _S_initialize_once(); } __gthread_active_p() returns true if your program is … Read more

How do I clone an OpenLDAP database

The problem with SourceRebels’ answer is that slapcat(8) does not guarantee that the data is ordered for ldapadd(1)/ldapmodify(1). From man slapcat (from OpenLDAP 2.3) : The LDIF generated by this tool is suitable for use with slapadd(8). As the entries are in database order, not superior first order, they cannot be loaded with ldapadd(1) without … Read more