This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| perl -pi -e 's/\r\n/\n/g; $rv=1 if $&; END{ exit $1rv }' $1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Unit] | |
| Description=autoswap | |
| After=local-fs.target | |
| RequiresMountsFor=/ | |
| RequiresMountsFor=/run | |
| RequiresMountsFor=/sys | |
| RequiresMountsFor=/var | |
| [Service] | |
| Type=oneshot |
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}"Edit /etc/mkinitcpio.conf as root
MODULES=(kvmgt vfio vfio-iommu-type1 vfio-mdev)
sudo mkinitcpio --allpresetsEdit /etc/default/grub as root
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** @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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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> |