Skip to content

Instantly share code, notes, and snippets.

View maxux's full-sized avatar
🔑

Maxime Daniel maxux

🔑
View GitHub Profile
@maxux
maxux / r710-zos.md
Created May 25, 2022 13:22
Zero-OS Dell PowerEdge

Dell PowerEdge R710 - Zero-OS

This tutorial explain how to boot Zero-OS v3 on a Dell PowerEdge R710, using vDisk and iDRAC. No external USB drive needed. This require iDRAC Enterprise.

Zero-OS Bootloader

First, you need to download your booloader. This is needed for any system to boot. With the vFlash, you can use disk image and avoid external USB.

@maxux
maxux / humanread.c
Last active April 19, 2024 19:34
Human readable size to bytes in C
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <errno.h>
#include <string.h>
static char *human_readable_suffix = "kMGT";
size_t *parse_human_readable(char *input, size_t *target) {
char *endp = input;
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <sys/types.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <ctype.h>
#include <errno.h>
#include <unistd.h>
#!/usr/bin/env bash
set -e
prefix="$HOME/.threefold"
echo "[+] prefix: $prefix"
echo "[+] creating default directories"
mkdir -p "${prefix}"
mkdir -p "${prefix}/bin"
@maxux
maxux / sysctl
Created September 16, 2020 11:17
#!/sbin/openrc-run
# Copyright (c) 2007-2015 The OpenRC Authors.
# See the Authors file at the top-level directory of this distribution and
# https://github.com/OpenRC/openrc/blob/master/AUTHORS
#
# This file is part of OpenRC. It is subject to the license terms in
# the LICENSE file found in the top-level directory of this
# distribution and at https://github.com/OpenRC/openrc/blob/master/LICENSE
# This file may not be copied, modified, propagated, or distributed
# except according to the terms contained in the LICENSE file.
import redis
import time
import json
"""
nodes = {
'minio': [
{
'host': '10.241.0.232',
'port': 6379,
#!/bin/bash
settings() {
rootdir="/export"
excludes="/dev /proc /sys /corex ${rootdir}"
ZFLIST_MNT="${rootdir}/flist"
ZFLIST_HUB="https://playground.hub.grid.tf"
# ZFLIST_BACKEND='{"host": "playground.hub.grid.tf", "port": 9910}'
ZFLIST_HUB_TOKEN=kiUTd9jRjgt7QB6lRh2bcpNiC2UqvTLI
Name: test
Umask: 0022
State: S (sleeping)
Tgid: 21248
Ngid: 0
Pid: 21248
PPid: 21247
TracerPid: 0
Uid: 1000 1000 1000 1000
Gid: 1000 1000 1000 1000
@maxux
maxux / smaps
Last active April 23, 2020 13:33
00400000-00401000 r--p 00000000 103:02 288372 /tmp/test
Size: 4 kB
KernelPageSize: 4 kB
MMUPageSize: 4 kB
Rss: 4 kB
Pss: 4 kB
Shared_Clean: 0 kB
Shared_Dirty: 0 kB
Private_Clean: 4 kB
Private_Dirty: 0 kB
use redis::Commands;
use std::{
fs::File,
io::{self, BufRead, BufReader},
os::unix::io::FromRawFd,
};
fn main() -> io::Result<()> {
let client = redis::Client::open("redis://10.241.0.232").unwrap();
let r = client.get_connection().unwrap();