fn convert(res: Result<Option<T>, E>) -> Result<Option<U>, E> where U : TryFrom<T, Error=E>
{
res.and_then(|it| it.map(U::try_from).transpose())
}
This file contains 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
const NUM_RUNS: usize = 10; | |
fn run_self(exe: &str) -> usize { | |
use std::process::Command; | |
let mut set = std::collections::HashSet::new(); | |
let mut cmd = Command::new(exe); | |
cmd.arg("--report"); | |
(0..NUM_RUNS).for_each(|_| { | |
set.insert(cmd.output().expect("failed to execute process").stdout); |
This file contains 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
%rename cpp_options old_cpp_options | |
*cpp_options: | |
-nostdinc -isystem -isystem include%s %(old_cpp_options) | |
*cc1: | |
%(cc1_cpu) %{static-pie:-fPIE} -nostdinc -isystem -isystem include%s | |
*link_libgcc: | |
-L -L .%s |
This file contains 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
diff --git a/enarx-keep-sev/src/kvmvm.rs b/enarx-keep-sev/src/kvmvm.rs | |
index eed3b80..5ea0ae7 100644 | |
--- a/enarx-keep-sev/src/kvmvm.rs | |
+++ b/enarx-keep-sev/src/kvmvm.rs | |
@@ -235,9 +235,9 @@ impl KvmVm { | |
failure::bail!(msg.to_string()); | |
} | |
- let guest_code: VirtAddr = VirtAddr::new(elf_file.header.pt2.entry_point()); | |
let mut load_addr: Option<VirtAddr> = None; |
This file contains 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 x86_64::structures::paging::PageTableFlags; | |
#[repr(C, align(4096))] | |
pub struct Pagetable([u64; 512]); | |
#[link_section = ".pmldata"] | |
#[no_mangle] | |
pub static PML4T: Pagetable = Pagetable([0; 512]); | |
#[link_section = ".pmldata"] |
Restrict podman-remote access to podman with ssh certficates.
On the local machine, create a certificate CA.
$ ssh-keygen -f my_ssh_cert_authority
$ cat my_ssh_cert_authority.pub
ssh-rsa AAAAB3NzaC1yc…
Login to the remote machine and add the CA to .ssh/authorized_keys
This file contains 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
type Mutator<T, R> = Box<dyn for<'a> Fn(&'a mut T) -> R + 'static>; | |
fn mutator<T, R, F>(f: F) -> Mutator<T, R> | |
where | |
F: for<'a> Fn(&'a mut T) -> R + 'static | |
{ | |
Box::new(f) as Mutator<T, R> | |
} | |
type Validator<T, R> = Box<dyn for<'a> Fn(&'a T) -> R + 'static>; |
This file contains 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
# Interface to query access to interface methods | |
interface org.surfsite.access | |
type Credentials ( | |
uid: ?int, | |
gid: ?int, | |
attributes: ?[string]string, | |
extended_attributes: ?object | |
) |
This file contains 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
package main | |
import ( | |
"fmt" | |
"go/ast" | |
"go/importer" | |
"go/parser" | |
"go/token" | |
"go/types" | |
"log" |
I hereby claim:
- I am haraldh on github.
- I am haraldhoyer (https://keybase.io/haraldhoyer) on keybase.
- I have a public key ASD6KZy4D2yMtf2UGBRDBS7tuckvlI1AVs0pn_Ifc3VkbAo
To claim this, I am signing this object: