Friday, May 20, 2022

[Solved] Fix upgrade errors in Kali Linux

If you face errors from powershell-empire while upgrading Kali Linux, upgrade the pip packages for Flask and aiohttp with root privileges.

Error - 1:

Traceback (most recent call last):
  File "/usr/share/powershell-empire/", line 11, in <module>
    import empire.server.server as server
  File "/usr/share/powershell-empire/empire/server/", line 23, in <module>
    import flask
  File "/usr/lib/python3/dist-packages/flask/", line 19, in <module>
    from . import json
  File "/usr/lib/python3/dist-packages/flask/json/", line 15, in <module>
    from itsdangerous import json as _json
ImportError: cannot import name 'json' from 'itsdangerous' (/usr/lib/python3/dist-packages/itsdangerous/
dpkg: error processing package powershell-empire (--configure):
 installed powershell-empire package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

[How To] Remove conda from macOS

Follow these steps from a Terminal window to remove conda in macOS:
  • conda install anaconda-clean
  • anaconda-clean --yes
  • rm -rf /Users/devharsh/.anaconda_backup/
  • rm -rf ~/anaconda3
  • rm -rf ~/anaconda2
  • rm -rf ~/.condarc ~/.conda ~/.continuum
  • sudo rm ~/.zshrc
  • brew reinstall python
  • /usr/local/opt/python@3.9/bin/python3.9 -m pip install --upgrade pip
  • pip3 list

Tuesday, February 22, 2022

[How To] Draw Vectors in Python

import numpy as np
import matplotlib.pyplot as plt

x_pos = np.linspace(0,5,10)
y_pos = np.linspace(0,10,10)
x_dir = y_dir = np.zeros((10,10))
plt.quiver(x_pos, y_pos, x_dir, y_dir, scale=1)

Rename Algorithm to Procedure in LaTeX

If you want to change the section name from Algorithm to Procedure, you just need to use the \floatname command while the code remains unchanged.

The code for an algorithm:
    \State Hello!

Now to change the label, add the following command before \begin{document}.
The code remains the same.


Sunday, February 06, 2022

[Solved] 15 duplicate symbols for architecture x86_64


If you are getting build failures in Xcode for a C++ program with similar errors then try this fix.

15 duplicate symbols for architecture x86_64

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

  • You can avoid declaring variables in the header and move them to implementation.
  • Or you can declare all the variables in the header file as static.

Thursday, February 03, 2022

[Solved] Enable iCloud Private Replay in Pi-hole

Pi-hole is a network-wide ad-blocking DNS server. iCloud Private Replay is a secure internet relay service. While Pi-hole can protect you from unwanted tracking and advertisements, iCloud Private Relay provides you with privacy when you browse the web in Safari.

When you join the Pi-hole network with a device with iCloud Private Relay enabled, Pi-hole returns NXDOMAIN response for and as per Apple recommendation.

To disable this feature in Pi-hole and allow the functioning of iCloud Private Relay go to /etc/pihole/pihole-FTL.conf and set BLOCK_ICLOUD_PR=false.


[How To] Calculate hash of a vector in C++

This is a sample code to generate SHA256 in C++ using CryptoPP.

For the first string in a vector:
std::vector<std::string> stringVector{"abcde", "fghij", "klmno", "pqrst", "uvwxyz"};
byte digest[SHA256::DIGESTSIZE];
SHA256().CalculateDigest(digest, (const byte*), stringVector.size());
For an entire vector of string:
std::vector<std::string> stringVector{"abcde", "fghij", "klmno", "pqrst", "uvwxyz"};
HexEncoder encoder(new FileSink(std::cout));
std::string digest;
SHA256 hash;

for(auto str: stringVector) { 
hash.Update((const byte*), str.size()); 


std::cout << "Digest: ";
StringSource(digest, true, new Redirector(encoder));
std::cout << std::endl;