50 private links
https://namvu.net/2021/07/setup-a-family-printer-with-a-raspberry-pi-1-and-canon-lbp-2900/
sudo apt install git build-essential automake cups libcups2-dev
git clone https://github.com/mounaiban/captdriver.git
cd captdriver
aclocal
autoconf
automake --add-missing
./configure
make
make ppd
sudo make install
sudo cp -p /usr/local/bin/rastertocapt /usr/lib/cups/filter/
sudo cp ppd/*.ppd /usr/share/ppd/custom/
- https://andreafortuna.org/2017/06/25/volatility-my-own-cheatsheet-part-1-image-identification/
- https://andreafortuna.org/2017/07/03/volatility-my-own-cheatsheet-part-2-processes-and-dlls/
- https://andreafortuna.org/2017/07/10/volatility-my-own-cheatsheet-part-3-process-memory/
- https://andreafortuna.org/2017/07/17/volatility-my-own-cheatsheet-part-4-kernel-memory-and-objects/
- https://andreafortuna.org/2017/07/24/volatility-my-own-cheatsheet-part-5-networking/
- https://andreafortuna.org/2017/07/31/volatility-my-own-cheatsheet-part-6-windows-registry/
- https://andreafortuna.org/2017/08/07/volatility-my-own-cheatsheet-part-7-analyze-and-convert-crash-dumps-and-hibernation-files/
- https://andreafortuna.org/2017/08/21/volatility-my-own-cheatsheet-part-8-filesystem/
- https://github.com/volatilityfoundation/volatility
Compile the kernel
# Install the needed packages
sudo apt install -y build-essential bison dwarves flex libssl-dev libelf-dev
# Clone kernel source
git clone https://github.com/microsoft/WSL2-Linux-Kernel.git
cd WSL2-Linux-Kernel
# Config kernel
cp Microsoft/config-wsl .config
sed -i 's/microsoft-standard-WSL2/generic/' .config # Change the LOCALVERSION value
sed -i 's/# CONFIG_SOUND is not set/CONFIG_SOUND=y\nCONFIG_SND=y/' .config # Enable sound modules
make olddefconfig
# Now that everything is ready, let's compile the kernel
make -j $(nproc)
# Copy the kernel into a directory in the Windows filesystem
mkdir /mnt/c/wslkernel
cp arch/x86/boot/bzImage /mnt/c/wslkernel/custom_kernel
# Last step, the kernel needs to be referenced in the file .wslconfig
nano /mnt/c/Users/<your username>/.wslconfig
The content of the .wslconfig
should look like this:
[wsl2]
kernel = c:\\wslkernel\\custom_kernel
Now, reboot WSL by running the following command in PowerShell:
wsl --shutdown
Launch again a terminal with your WSL2 distro and confirm the new kernel is now being the one used:
uname -a
You should see generic
in the output.
Install headers (for developing kernel modules)
sed -i 's/SPDX-License-Identifier: GPL-2.0/SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note/g' include/uapi/misc/d3dkmthk.h
sudo make headers_install INSTALL_HDR_PATH=/usr
sudo mkdir -p /lib/modules/$(uname -r)
sudo ln -s <path to WSL2-Linux-Kernel> /lib/modules/$(uname -r)/build
- Follow this instruction from NVIDIA to install CUDA drivers for WSL.
DO NOT install CUDA Toolkit yet. The version in that instruction is not compatible with current version of Tensorflow/Pytorch.
- Install CUDA Toolkit 11.8.0 for WSL:
wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-wsl-ubuntu.pin
sudo mv cuda-wsl-ubuntu.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda-repo-wsl-ubuntu-11-8-local_11.8.0-1_amd64.deb
sudo dpkg -i cuda-repo-wsl-ubuntu-11-8-local_11.8.0-1_amd64.deb
sudo cp /var/cuda-repo-wsl-ubuntu-11-8-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda
Add CUDA to path:
echo 'export PATH=/usr/local/cuda/bin:$PATH' >> ~/.zshrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH' >> ~/.zshrc
Symlink libcuda (needed for building darknet):
sudo ln -s /usr/lib/wsl/lib/libcuda.so.1 /usr/local/cuda/lib64/libcuda.so
- Install cuDNN
Go to https://developer.nvidia.com/rdp/cudnn-download and download cuDNN for CUDA 11.x for Linux.
Filename: cudnn-linux-x86_64-8.9.4.25_cuda11-archive.tar.xz
tar -xvf cudnn-linux-x86_64-8.9.4.25_cuda11-archive.tar.xz
cd cudnn-linux-x86_64-8.9.4.25_cuda11-archive
sudo cp -P include/* /usr/local/cuda/include/
sudo cp -P lib/* /usr/local/cuda/lib64/
sudo chmod a+r /usr/local/cuda/include/cudnn*.h /usr/local/cuda/lib64/libcudnn*
sudo ldconfig /usr/local/cuda/lib64
-
Install pyenv and create a virtual environment
-
Install Tensorflow and Pytorch:
pip install --upgrade pip setuptools wheel
pip install torch torchvision torchaudio
pip install tensorflow
- Install additional packages (optional):
pip install jupyterlab
In a nutshell: to avoid your shell character set from messing with imports, use -r to export and SOURCE when importing.
Dumping safely
# Do not do this, since it might screw up encoding
mysqldump -uroot -p database > utf8.dump # this is bad
Better do:
mysqldump -uroot -p database -r utf8.dump
Note that when your MySQL server is not set to UTF-8 you need to do mysqldump --default-character-set=latin1
(!) to get a correctly encoded dump. In that case, you will also need to remove the SET NAMES='latin1'
comment at the top of the dump, so the target machine won't change its UTF-8 charset when sourcing.
If you only want to dump the structure without data, use
mysqldump -uroot -p --no-data database -r utf8.dump
Importing a dump safely
# Do not do this, since it might screw up encoding
mysql -u username -p database < dump_file # this is bad
Better do:
mysql -uroot -p --default-character-set=utf8mb4 database
mysql> SET names 'utf8';
mysql> SOURCE utf8.dump;
Ref: https://makandracards.com/makandra/595-dumping-and-importing-from-to-mysql-in-an-utf-8-safe-way