Posts

setsockopt: Protocol not available [Solved]

Image
Problem code: if (setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR | SO_REUSEPORT , &opt, sizeof(opt)))  {  perror("setsockopt");  exit(EXIT_FAILURE);  } Solution: if (setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR , &opt, sizeof(opt)))  {  perror("setsockopt");  exit(EXIT_FAILURE);  } Ref.:  https://stackoverflow.com/a/59807281/4064166 This error appears when a socket option is not supported on the current platform. Here the combination of SO_REUSEADDR and SO_REUSEPORT fails because SO_REUSEPORT is unavailable, so the call returns Protocol not available. Setting SO_REUSEADDR on its own fixes it, which is widely supported and enough for the common case of rebinding a recently used address. SO_REUSEPORT behaves differently across operating systems and is not always present.

[How To] Fix "Waiting to Upload" in iCloud Drive

Image
1. Check if you have enough free storage on iCloud 2. Go to Settings (iOS / iPadOS) or System Preferences (macOS) >> iCloud >> Sign Out 3. Wait for a minute or two after you have successfully logged out 4. Log in to iCloud again 5. Go to iCloud settings and >> iCloud Drive >> Options... >> select the checkbox for "Desktop & Documents Folder" >> Done

Best tablets to buy in 2021

Image
iPad Air 2020 256 GB -  https://amzn.to/2OVg49n Brand - Apple Storage - 256 GB Display - 10.9" Resolution - 2360 x 1640 Operating System - iPadOS 14 stylus pen for iPad with palm rejection -  https://amzn.to/3aEluxP iPad A ir 4th generation keyboard case -  https://amzn.to/3kbOT5D iPad Air glass screen protector -  https://amzn.to/3aG5xY1

[How To] Use Cryptopp in Xcode

Image
Crypto++ Library is a free C++ class library of cryptographic schemes. Currently the library contains the following algorithms: algorithm type name authenticated encryption schemes GCM, CCM, EAX, ChaCha20Poly1305 and XChaCha20Poly1305 high speed stream ciphers ChaCha (8/12/20), ChaCha (IETF), Panama, Salsa20, Sosemanuk, XSalsa20, XChaCha20 AES and AES candidates AES (Rijndael), RC6, MARS, Twofish, Serpent, CAST-256 ARIA, Blowfish, Camellia, CHAM, HIGHT, IDEA, Kalyna (128/256/512), LEA, SEED, RC5, SHACAL-2, other block ciphers SIMON (64/128), Skipjack, SPECK (64/128), Simeck, SM4, Threefish (256/512/1024), Triple-DES (DES-EDE2 and DES-EDE3), TEA, XTEA block cipher modes of operati...

[How To] check if Intel SGX is enabled

Image
Steps to check if Intel SGX is enabled on your system: 1. Download test-sgx.c from  https://github.com/ayeks/SGX-hardware 2. % gcc test-sgx.c -o test-sgx 3.  % ./test-sgx eax: 806ea ebx: 4100800 ecx: 7ffafbbf edx: bfebfbff stepping 10 model 14 family 6 processor type 0 extended model 8 extended family 0 smx: 0 Extended feature bits (EAX=07H, ECX=0H) eax: 0 ebx: 29c67af ecx: 0 edx: 9c002600 sgx available: 1 sgx launch control: 0 CPUID Leaf 12H, Sub-Leaf 0 of Intel SGX Capabilities (EAX=12H,ECX=0) eax: 0 ebx: 0 ecx: 0 edx: 0 sgx 1 supported: 0 sgx 2 supported: 0 MaxEnclaveSize_Not64: 0 MaxEnclaveSize_64: 0 CPUID Leaf 12H, Sub-Leaf 1 of Intel SGX Capabilities (EAX=12H,ECX=1) eax: 0 ebx: 0 ecx: 0 edx: 0 CPUID Leaf 12H, Sub-Leaf 2 of Intel SGX Capabilities (EAX=12H,ECX=2) eax: 0 ebx: 0 ecx: 0 edx: 0 CPUID Leaf 12H, Sub-Leaf 3 of Intel SGX Capabilities (EAX=12H,ECX=3) eax: 0 ebx: 0 ecx: 0 edx: 0 CPUID Leaf 12H, Sub-Leaf 4 of Intel SGX Capabilities (EAX=12H,ECX=4) eax: 0 ebx: 0 ...