Skip to content

Instantly share code, notes, and snippets.

Fedora28-32

Current status:

df -h

Find large files in the system:

sudo find / -type f -size +1000M -exec ls -lh {} \;
@yuvalif
yuvalif / cb_serialization.cpp
Last active November 8, 2018 20:59
boost::circular_buffer serialization benchmark
// boost::circular_buffer serialization
// using: g++ (GCC) 8.2.1 20181011 (Red Hat 8.2.1-4)
//
// g++ -Wall -O2 -o cb_serialization cb_serialization.cpp -lboost_serialization
// g++ -Wall -O2 -DUSE_BINARY -o cb_serialization cb_serialization.cpp -lboost_serialization
//
//
#include <boost/circular_buffer.hpp>
#include <boost/serialization/split_free.hpp>
@yuvalif
yuvalif / s3-curl-get.sh
Last active December 3, 2018 08:46
Get the list of objects in an s3 bucket via curl
#!/bin/bash
set -ex
resource=$1
host=localhost
port=$2
dateValue=`date -Ru`
S3KEY=$SYSTEM_ACCESS_KEY
S3SECRET=$SYSTEM_SECRET_KEY

Configuration

Configuration process when running a fresh local development cluster:

cd build
MON=1 OSD=1 MDS=0 MGR=0 RGW=2 ../src/vstart.sh -n -d

Generate keys and export them:

export SYSTEM_ACCESS_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 20 | head -n 1)
export SYSTEM_SECRET_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 40 | head -n 1)
#!/bin/bash
set -ex
resource=$1
host=localhost
port=$2
dateValue=`date -Ru`
S3KEY=$SYSTEM_ACCESS_KEY
S3SECRET=$SYSTEM_SECRET_KEY
#!/bin/bash
set -ex
resource=$1
host=localhost
parameters=$2
port=$3
dateValue=`date -Ru`
S3KEY=$SYSTEM_ACCESS_KEY
#!/bin/bash
set -ex
resource=$1
host=localhost
parameters=$2
port=$3
dateValue=`date -Ru`
S3KEY=$SYSTEM_ACCESS_KEY
@yuvalif
yuvalif / SimpleHTTPPutServer.py
Last active December 3, 2018 09:47 — forked from fabiand/SimpleHTTPPutServer.py
A simple HTTP Server supporting put
# python -m SimpleHTTPPutServer 8080
import SimpleHTTPServer
import BaseHTTPServer
class SputHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_PUT(self):
print self.command + " " + self.path
print self.headers
self.end_headers()
# python -m SimpleHTTPPostServer 80
import SimpleHTTPServer
import BaseHTTPServer
class SpostHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_POST(self):
print self.command + " " + self.path
print self.headers
print self.rfile.read(int(self.headers['Content-Length']))