Skip to content

Instantly share code, notes, and snippets.

View giuseppe's full-sized avatar

Giuseppe Scrivano giuseppe

View GitHub Profile

Keybase proof

I hereby claim:

  • I am giuseppe on github.
  • I am giuseppe (https://keybase.io/giuseppe) on keybase.
  • I have a public key whose fingerprint is AC40 4C1C 0BF7 35C6 3FF4 D562 263D 6DF2 E163 E1EA

To claim this, I am signing this object:

@giuseppe
giuseppe / cleanup.py
Created February 23, 2016 12:39
cleanup dockerimg spc
import os
import sys
import stat
import gi
gi.require_version('OSTree', '1.0')
from gi.repository import Gio, GLib, OSTree
repo = OSTree.Repo.new(Gio.File.new_for_path("/ostree/repo"))
repo.open(None)
>>>>>+>>,[>>>+>>,]>>>>>>>>+>>+<<<<<<<<<<<<[<<<<<]>>>>>[>>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>[<<->>[-<+>]]<[->+<]<[[>>>>>]>>>>>>>[>>>>>]<<<.<<<<-[+<<<<<-]+<<<<<<<<<<<<<<<[<<<<<]>>>>>-][-]+>>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>[<<->>[-<+>]]<[->+<]<[[>>>>>]>>>>>>>[>>>>>]<<<,<<<<-[+<<<<<-]+<<<<<<<<<<<<<<<[<<<<<]>>>>>-][-]+>>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>[<<->>[-<+>]]<[->+<]<[[>>>>>]>>>>>>>[>>>>>]<<<+<<<<-[+<<<<<-]+<<<<<<<<<<<<<<<[<<<<<]>>>>>-][-]+>>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>
@giuseppe
giuseppe / provision-atomic-f24.yml
Created July 26, 2016 09:25
Provision Fedora 24 for running atomic tests
- name: Install packages for testing atomic
gather_facts: no
sudo: yes
hosts: all
tasks:
- name: update packages
dnf: state=latest name='*'
- name: install packages
dnf: state=present name={{ item }}
@giuseppe
giuseppe / config.json
Created September 16, 2016 16:45
httpd with systemd in runc
{
"ociVersion": "0.6.0-dev",
"platform": {
"os": "linux",
"arch": "amd64"
},
"process": {
"terminal": true,
"user": {},
"args": [
# Released under the terms of the GPLv2
import os
import sys
import struct
import subprocess
import select
import StringIO
import gzip
import hashlib
@giuseppe
giuseppe / overlay_ostree_test.sh
Last active December 14, 2017 10:11
overlay ostree comparison test
#!/bin/sh
umount /var/lib/containers/storage/overlay2
umount /var/lib/containers/storage-ostree/overlay2
rm -rf /var/lib/containers/storage /var/lib/containers/storage-ostree
for i in gscrivano/container-engine \
gscrivano/cri-o-centos \
gscrivano/etcd \
@giuseppe
giuseppe / podman_runc_crun.md
Last active April 10, 2024 22:38
runc vs crun performance

running Podman as root

runc

[root@fedora-s-4vcpu-8gb-fra1-01 ~]# for i in {1..10}; do /usr/bin/time -f%e podman \
    --runtime /usr/bin/runc run --rm alpine true; done 2>&1 | sort
1.10
1.10
1.10
@giuseppe
giuseppe / build.rs
Created June 16, 2019 22:02
crun rust hooks
use std::env;
use std::process::Command;
use std::path::Path;
fn main() {
let out_dir = env::var("OUT_DIR").unwrap();
Command::new("make").current_dir(&Path::new("../..")).arg("install").arg(&format!("DESTDIR={}", out_dir)).status().unwrap();
println!("cargo:rustc-link-search=native={}/usr/local/lib", out_dir);
println!("cargo:rustc-link-lib=static=crun");
println!("cargo:rustc-link-lib=yajl");
@giuseppe
giuseppe / local_k8s_crio.sh
Created July 4, 2019 12:54
local k8s CRI-O
#!/bin/bash -e
set -x
set -u
IP=$(hostname -I | cut -d' ' -f1)
echo "Using IP: $IP"
export GOPATH=/home/gscrivano/src/gopath
export PATH=$PATH:$GOPATH/bin:$GOPATH/src/k8s.io/kubernetes/third_party/etcd:$GOPATH/src/k8s.io/kubernetes/_output/local/bin/linux/amd64/
export FEATURE_GATES="AllAlpha=false,RunAsGroup=true"
export CONTAINER_RUNTIME=remote
export CGROUP_DRIVER=systemd