Skip to content

Instantly share code, notes, and snippets.

View maxux's full-sized avatar
🔑

Maxime Daniel maxux

🔑
View GitHub Profile
#!/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();
#!/bin/ash
if [ -f /etc/ssh/ssh_host_rsa_key ]; then
# nothing to do, hackish way
sleep 10
exit 0
fi
echo "Setting up sshd"
mkdir -p /run/sshd
package main
import (
"bytes"
"context"
"fmt"
"io"
"sync"
// "github.com/threefoldtech/zos/pkg"
import json
import random
import string
import urllib.parse
import pprint
import requests
import nacl.public
import nacl.signing
import base64
from flask import Flask, request, redirect