Required tools for playing around with memory:
hexdump
objdump
readelf
xxd
gcore
#include <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <iomanip> | |
#include <boost/iostreams/device/mapped_file.hpp> | |
#include <boost/iostreams/device/array.hpp> | |
#include <boost/iostreams/stream.hpp> | |
#include <boost/archive/binary_iarchive.hpp> | |
#include <boost/archive/binary_oarchive.hpp> | |
#include <boost/serialization/vector.hpp> |
#include <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <iomanip> | |
#include <boost/iostreams/device/mapped_file.hpp> | |
#include <boost/iostreams/device/array.hpp> | |
#include <boost/iostreams/stream.hpp> | |
#include <boost/archive/binary_iarchive.hpp> | |
#include <boost/archive/binary_oarchive.hpp> | |
#include <boost/serialization/vector.hpp> |
#!/usr/bin/env bash | |
#set -x | |
EXE=$(readlink -f ${BASH_SOURCE}) | |
WD=$(dirname ${EXE}) | |
cd ${WD} | |
rm -rf ${EXE}.* | |
cat > ${EXE}.cc <<'EOF' | |
#include <zconf.h> |
/** @arg what: any number | |
* @return: string number represented as hex */ | |
template <typename T, std::endian endianess = std::endian::native> | |
std::string HEX__1(const T& value, size_t value_size = sizeof(T)) | |
{ | |
using namespace std; | |
uint8_t *buffer = (uint8_t*)(&value); | |
char converted[value_size * 2 + 1]; | |
if (endianess == std::endian::big) |
Edit /etc/mkinitcpio.conf
as root
MODULES=(kvmgt vfio vfio-iommu-type1 vfio-mdev)
sudo mkinitcpio --allpresets
Edit /etc/default/grub
as root
If you cannot install Intel VTune Amplifier on Manjaro/Arch Linux (or other non-supported OS), because this shit cannot find installed libraries via ldconfig -p
, you can use this script.
Unpack vtune_amplifier_2019_update3.tar.gz
, then go to vtune_amplifier_2019_update3
, then copy and paste following:
shopt -s globstar
for i in **/sysreq.cab; do
echo "processing ${i}"
perl -pi -e 's/(\W*)RESULT=255(.*)/\1RESULT=1 \2/' "${i}" # COMPARE_VERSIONS() never returns 255
perl -pi -e 's/(\W*)LI_(.+)=unsupp(.*)/\1LI_\2=ok \3/' "${i}"
[Unit] | |
Description=autoswap | |
After=local-fs.target | |
RequiresMountsFor=/ | |
RequiresMountsFor=/run | |
RequiresMountsFor=/sys | |
RequiresMountsFor=/var | |
[Service] | |
Type=oneshot |