Skip to content

Instantly share code, notes, and snippets.

View lovesegfault's full-sized avatar
🔨

Bernardo Meurer lovesegfault

🔨
View GitHub Profile
diff --git a/mutagen/_util.py b/mutagen/_util.py
index 1332f9d..5b9a8cd 100644
--- a/mutagen/_util.py
+++ b/mutagen/_util.py
@@ -20,7 +20,7 @@ import decimal
from io import BytesIO
try:
- import mmap
+ mmap = None
diff --git a/mutagen/_util.py b/mutagen/_util.py
index 1332f9d..795eec4 100644
--- a/mutagen/_util.py
+++ b/mutagen/_util.py
@@ -19,13 +19,6 @@ import errno
import decimal
from io import BytesIO
-try:
- import mmap
diff --git a/mutagen/_util.py b/mutagen/_util.py
index 1332f9d..795eec4 100644
--- a/mutagen/_util.py
+++ b/mutagen/_util.py
@@ -19,13 +19,6 @@ import errno
import decimal
from io import BytesIO
-try:
- import mmap
diff --git a/mutagen/_util.py b/mutagen/_util.py
index 1332f9d..f331942 100644
--- a/mutagen/_util.py
+++ b/mutagen/_util.py
@@ -19,12 +19,7 @@ import errno
import decimal
from io import BytesIO
-try:
- import mmap
diff --git a/mutagen/_util.py b/mutagen/_util.py
index 1767bce..09a5b43 100644
--- a/mutagen/_util.py
+++ b/mutagen/_util.py
@@ -19,12 +19,7 @@ import errno
import decimal
from io import BytesIO
-try:
- import mmap
/* futex_demo.c
Usage: futex_demo [nloops]
(Default: 5)
Demonstrate the use of futexes in a program where parent and child
use a pair of futexes located inside a shared anonymous mapping to
synchronize access to a shared resource: the terminal. The two
processes each write 'num-loops' messages to the terminal and employ
a synchronization protocol that ensures that they alternate in
mod nix;
use nix::NixShellTemplateBuilder;
use std::io::Write;
use std::process::Command;
use tempfile::NamedTempFile;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let rust_shell = NixShellTemplateBuilder::default()
.name("Rust")
security = {
audit = {
enable = true;
rules = [
"-w /home/bemeurer/Desktop"
"-w /home/bemeurer/Downloads"
];
};
auditd.enable = true;
};
# Function to create a directory in both the place where we want
# to bind mount it as well as making sure it exists in the location
# where persistence is located. This also enforces the correct ownership
# of the directory structure.
mkDirCreationSnippet = persistentStoragePath: dir:
''
# capture the nix vars into bash to avoid escape hell
local sourceBase="${persistentStoragePath}"
local target="${dir}"
# iterate over each part of the target path
~
❯ touch foo
~
❯ stat foo
File: foo
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: 1ah/26d Inode: 261048 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 8888/bemeurer) Gid: ( 100/ users)
Access: 2020-06-06 13:17:57.469173634 -0700
Modify: 2020-06-06 13:17:57.469173634 -0700