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
printf "[Service]\nSystemCallFilter=~fsync sync syncfs fdatasync msync sync_file_range\nSystemCallErrorNumber=0\n" \ | |
| s env EDITOR='tee -a' systemctl edit [email protected] |
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
// cc drop-privs-harder.c -o drop-privs-harder -lseccomp | |
#define _GNU_SOURCE | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <sys/prctl.h> | |
#include <errno.h> | |
#include <seccomp.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 <assert.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <stddef.h> | |
#include <stdlib.h> | |
#include <fcntl.h> | |
#include <signal.h> | |
#include <unistd.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
use std::error; | |
use std::fmt; | |
use std::io; | |
#[derive(Debug)] | |
struct MyError { | |
} | |
impl error::Error for MyError { | |
fn description(&self) -> &str { |
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
commit 9d2bf90676206957a502e9ec1c3cfe4f4b40b0cc | |
Author: Chris West (Faux) <[email protected]> | |
Date: Thu Jun 1 17:01:16 2017 +0000 | |
dynamically allocate EVP_CTX | |
diff --git a/boxbackup-0.11.1~r2837/debian/control b/boxbackup-0.11.1~r2837/debian/control | |
index 5cbdba6..d422125 100644 | |
--- a/boxbackup-0.11.1~r2837/debian/control | |
+++ b/boxbackup-0.11.1~r2837/debian/control |
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
# grab a load of dbd txt files | |
# v the maximum size of log to download | |
./fetch-logs -m 5k --download --delete-outdated -t dbdtxt | |
# process the logs | |
cd logs | |
../has-only.py debian/dbdtxt/unstable/amd64/* | |
# read out some packages | |
CBP=$(python3 -c 'import yaml; print(" ".join(pkg for pkg,dat in yaml.load(open("suggested_notes.yml")).items() if "captures_build_path" in dat.get("issues", {})))') |
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
#[macro_use] | |
extern crate error_chain; | |
use errors::*; | |
fn call_john() -> Result<()> { | |
john::useful() | |
.chain_err(|| "calling useful") | |
?; | |
Ok(()) |
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
use std::collections::HashMap; | |
use std::collections::hash_map; | |
#[derive(Debug)] | |
enum Node { | |
Dir(HashMap<String, Node>), | |
File | |
} | |
fn list_to_tree(from: Vec<Vec<String>>) -> HashMap<String, Node> { |
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
use std::collections::HashMap; | |
use std::collections::hash_map; | |
#[derive(Debug)] | |
enum Node { | |
Dir(HashMap<String, Node>), | |
File | |
} | |
fn add(into: &mut HashMap<String, Node>, remaining: &[String]) { |
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
cleanup() { | |
sudo umount a | |
rm a.img | |
sudo losetup -d /dev/loop0 | |
} | |
set -eu | |
mkdir -p a | |
truncate -s 128k a.img | |
mkfs.ext4 a.img >/dev/null 2>&1 |