Wednesday, August 30, 2017

Difference between command substitution and 'while read' in bash

I just changed one of my scripts that, in principle, looked like this:
for i in `find . -type d`
do
     # do some processing on cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 found directory
done
The new format I use is:
find . -type d | while read i
do
    # do some processing on cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 found directory
done
While both versions will work in general, cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 second variant is better for cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 following reasons:
  1. It's faster. Namely, in cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 first case cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 find command has to finish before processing on directories starts. This isn't noticeable for small directory hierarchies, but it becomes very noticeable for large ones. In cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 second case cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 find command outputs results and in parallel while loop picks cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365m up and does processing.
  2. In case you have spaces embedded in directory names, cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 second version will work, while cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 first won't.
Maybe cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365re are some ocá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365r advantages (or disadvantages) of cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 second version, but none I can remember at cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 moment. If you know any, please write it in cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 comments!

Tuesday, August 22, 2017

Viber and Fedora 26 SSL errors

I just downloaded and updated Viber on my Fedora. When I tied to start it, it seg faulted with cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 following errors:
QSqlDatabasePrivate::removeDatabase: connection 'ConfigureDBConnection' is still in use, all queries will cease to work.
Qt WebEngine ICU data not found at /opt/viber/resources. Trying parent directory...
Qt WebEngine resources not found at /opt/viber/resources. Trying parent directory...
Qt WebEngine ICU data not found at /opt/viber/resources. Trying parent directory...
Qt WebEngine resources not found at /opt/viber/resources. Trying parent directory...
qt.network.ssl: QSslSocket: cannot resolve CRYPTO_num_locks
qt.network.ssl: QSslSocket: cannot resolve CRYPTO_set_id_callback
qt.network.ssl: QSslSocket: cannot resolve CRYPTO_set_locking_callback
qt.network.ssl: QSslSocket: cannot resolve ERR_free_strings
qt.network.ssl: QSslSocket: cannot resolve EVP_CIPHER_CTX_cleanup
qt.network.ssl: QSslSocket: cannot resolve EVP_CIPHER_CTX_init
qt.network.ssl: QSslSocket: cannot resolve sk_new_null
qt.network.ssl: QSslSocket: cannot resolve sk_push
qt.network.ssl: QSslSocket: cannot resolve sk_free
qt.network.ssl: QSslSocket: cannot resolve sk_num
qt.network.ssl: QSslSocket: cannot resolve sk_pop_free
qt.network.ssl: QSslSocket: cannot resolve sk_value
qt.network.ssl: QSslSocket: cannot resolve SSL_library_init
qt.network.ssl: QSslSocket: cannot resolve SSL_load_error_strings
qt.network.ssl: QSslSocket: cannot resolve SSL_get_ex_new_index
qt.network.ssl: QSslSocket: cannot resolve SSLv23_client_method
qt.network.ssl: QSslSocket: cannot resolve SSLv23_server_method
qt.network.ssl: QSslSocket: cannot resolve X509_STORE_CTX_get_chain
qt.network.ssl: QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf
qt.network.ssl: QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf
qt.network.ssl: QSslSocket: cannot resolve SSLeay
qt.network.ssl: QSslSocket: cannot resolve SSLeay_version
qt.network.ssl: QSslSocket: cannot call unresolved function CRYPTO_num_locks
qt.network.ssl: QSslSocket: cannot call unresolved function CRYPTO_set_id_callback
qt.network.ssl: QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init
qt.network.ssl: QSslSocket: cannot call unresolved function SSLv23_client_method
qt.network.ssl: QSslSocket: cannot call unresolved function sk_num
Segmentation fault (core dumped)
After some digging cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 solution was simple, just execute cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 following command and it should work afterwards:
sudo ln -s /usr/lib64/libssl.so.10 /opt/viber/lib/libssl.so

About Me

scientist, consultant, security specialist, networking guy, system administrator, philosopher ;)

Blog Archive