Posts

[Solved] Fix upgrade errors in Kali Linux

Image
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/empire.py", line 11, in <module>     import empire.server.server as server   File "/usr/share/powershell-empire/empire/server/server.py", line 23, in <module>     import flask   File "/usr/lib/python3/dist-packages/flask/__init__.py", line 19, in <module>     from . import json   File "/usr/lib/python3/dist-packages/flask/json/__init__.py", line 15, in <module>     from itsdangerous import json as _json ImportError: cannot import name 'json' from 'itsdangerous' (/usr/lib/python3/dist-packages/itsdangerous/__init__.py) dpkg: error processing package powershell-empire (--configure):  installed powershell-empire package post-installation script subprocess returned error exit status...

[How To] Remove conda from macOS

Image
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/ (Replace "devharsh" with user directory) 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 These steps fully remove a conda or Anaconda installation from macOS, first using anaconda-clean to clear configuration and then deleting the install directories and shell hooks. A clean removal is the safest way to recover from a broken environment or to switch package managers, since leftover paths in the shell profile often cause confusing errors afterward.

[How To] Draw Vectors in Python

Image
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

Image
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: \begin{algorithm} \caption{Test}   \begin{algorithmic}[1]     \State Hello!   \end{algorithmic} \end{algorithm} Output: Now to change the label, add the following command before \begin{document} . \floatname{algorithm}{Procedure} The code remains the same. Output: This LaTeX tip relabels floats produced by the algorithm package from Algorithm to Procedure using the \floatname command, without changing the algorithm body itself. It is handy when a venue or style guide expects a particular caption label. The same \floatname approach works for renaming other float types too.

[Solved] 15 duplicate symbols for architecture x86_64

Image
Error: 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) Solution: 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.