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
#!/bin/bash | |
qemu-system-arm \ | |
-M virt \ | |
-m 3G \ | |
-device virtio-gpu-pci \ | |
-drive if=none,file=os.qcow2,id=hd0 \ | |
-device virtio-blk-device,drive=hd0 \ | |
-device virtio-net-device \ | |
-kernel vmlinuz-5.17.5-300.fc36.armv7hl \ |
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 <fstream> | |
#include <iterator> | |
#include <vector> | |
int main(int argc, char** argv) | |
{ | |
std::ifstream ifs(argv[1], std::ios::binary); | |
std::istreambuf_iterator<char> begin(ifs), end; | |
std::vector<uint8_t> data(begin, end); |
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
#define _GNU_SOURCE | |
#include <stdio.h> | |
#include <fenv.h> | |
int main() | |
{ | |
feenableexcept(FE_DIVBYZERO); | |
double x = 12.34; |
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
# This script requests the RSS feed for phoronix.com and outputs the latest | |
# news items into a CSV file. | |
# | |
# It is not particularly well written, and if it were part of a real project, | |
# it would be awkward to test in an automated way. | |
# | |
# How would you refactor (change) this code to make it more testable for fuzzing or unit testing? | |
# |
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
# For some reason, the native power management features of the NVIDIA card in the MSI GS65 Stealth don't seem to completely | |
# power down the card. This sucks because the GPU still consumes lots of power even when idle, reducing the battery life | |
# to about an hour. | |
# My workaround on Fedora 32/34 is this: | |
# 1. Install RPMFusion NVIDIA drivers. | |
# 2. Install the bbswitch driver (https://copr.fedorainfracloud.org/coprs/chenxiaolong/bumblebee/) | |
# 3. Configure bbswitch module to shutdown card on load. | |
# 4. Blacklist all nvidia drivers in the GRUB boot menu. |
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
mkisofs -iso-level 3 -o <ISO Filename> -V <Disc Title> <File 1> .. <File N> | |
growisofs -speed 16 -Z /dev/sr0=<ISO Filename> |
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
dbus-send --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval "string:global.reexec_self()" |
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
# Install wimlib | |
dnf install wimlib-utils wimlib | |
# Mount Windows 10 ISO | |
mkdir /tmp/winiso | |
mount <path to windows 10 iso> /tmp/winiso | |
# Create Split WIM files | |
wimsplit /tmp/winiso/sources/install.wim install.swm 2048 |
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 <assert.h> | |
#include <stddef.h> | |
#include <limits.h> | |
#include <stdio.h> | |
struct node { | |
int value; | |
struct node *next; | |
}; |
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
# A minimal config for samba to share with Windows 2000. | |
# This is insecure... don't run this config on a production system. | |
[global] | |
workgroup = SAMBA | |
security = user | |
lanman auth = yes | |
ntlm auth = yes | |
[public] |
NewerOlder