Skip to content

Instantly share code, notes, and snippets.

View siscia's full-sized avatar

Simone Mosciatti siscia

View GitHub Profile
@siscia
siscia / split_slice.go
Last active October 24, 2024 09:53
Splitting a go array or slice in a defined number of chunks.
package foo
// SplitSlice splits a slice in `numberOfChunks` slices.
//
// Each slice is, at most, one element bigger than any other slice.
// Abs( len(result[i]) - len(result[j]) ) <= 1 for every i, j in the result.
//
// Moreover the function maintains the order of the elements, it is stable.
//
// If the input array is nil, or empty, the function returns nil.
@siscia
siscia / # binutils - 2020-08-13_10-32-03.txt
Created August 13, 2020 08:50
binutils on Ubuntu 18.04.5 LTS - Homebrew build logs
Homebrew build logs for binutils on Ubuntu 18.04.5 LTS
Build date: 2020-08-13 10:32:03
@siscia
siscia / main.go
Created March 31, 2020 19:41
go parallel quick sort
package main
import (
"fmt"
"math/rand"
"sort"
"sync"
"time"
)
@siscia
siscia / DUCC_filesystem_structure.md
Last active January 13, 2020 17:50
A filesystem structure to serve container from local storage

DUCC filesystem structure

The DUCC filesystem structure is developed inside CERN to allow the efficient distribution of containers images. The structure itself is orthogonal to the filesystem implementation, but it was designed to work effiecientely with CernVM-FS.

Why formalize it

o) Naming o) Having a common understading of the benefits

User authentication system

Your task is now to create a user authentication system.

This document will guide you through all the features and implication of such system, so that you don't have to search them yourself.

We will focus on web/browser-technologies, however similar concept can be widely applied. This guide, is a work in progress, feel free to comment and provide feedbacks.

Expected Workflows

set -x
set -e
sudo apt install -y \
wget \
tar \
build-essential \
pkg-config \
libssl-dev \
bzip2 \
==9674== Memcheck, a memory error detector
==9674== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==9674== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==9674== Command: redis-server --loadmodule target/debug/libredis_sql.so
==9674==
9674:C 14 Aug 2019 15:56:45.162 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
9674:C 14 Aug 2019 15:56:45.176 # Redis version=5.0.3, bits=64, commit=00000000, modified=0, pid=9674, just started
9674:C 14 Aug 2019 15:56:45.176 # Configuration loaded
9674:M 14 Aug 2019 15:56:45.201 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
9674:M 14 Aug 2019 15:56:45.204 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
Copyright <YEAR> <COPYRIGHT HOLDER>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
2. The telemetrics functionality must not be disable nor removed nor impared in any way.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CO
free; for i in {1..11000}; do if [ $(( $i % 1000 )) -eq 0 ]; then echo $i; free; fi; ./redis-cli REDISQL.CREATE_D
B DB$i > /dev/null; ./redis-cli REDISQL.EXEC DB$i "CREATE TABLE foo(a, b, c); CREATE TABLE bar(a, b, c)" > /dev/null; done
free;
for i in {1..11000}; do
if [ $(( $i % 1000 )) -eq 0 ]; then
echo $i;
free;
fi;

Start thin images

Assuming you have already follow the [geneal guide on thin image on the cvmfs documentation.][graph-driver-doc]

Hence, we are assuming that the docker daemon is running with the graph-driver plugin installed.

After the plugin is installed you should be able to run thin-images in your local docker.

This page show first how to mount the CVMFS repository that backs the thin images and then how to obtain the thin images themselves.