Skip to content

Instantly share code, notes, and snippets.

View joec4i's full-sized avatar
🎯
Focusing

Joe Cai joec4i

🎯
Focusing
  • Sydney, Australia
View GitHub Profile
@joec4i
joec4i / swift-debug.txt
Last active June 15, 2023 01:00
OpenStack Swift request log from rclone for an empty-dir
2023/06/15 10:48:42 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2023/06/15 10:48:42 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2023/06/15 10:48:42 DEBUG : HTTP REQUEST (req 0x140007a0500)
2023/06/15 10:48:42 DEBUG : GET /v1/AUTH_test/bar?delimiter=%2F&format=json&limit=1000 HTTP/1.1
Host: 127.0.0.1:8080
User-Agent: rclone/v1.63.0-beta.7067.c7d63704d.swift-dir-marker
Transfer-Encoding: chunked
X-Auth-Token: XXXX
Accept-Encoding: gzip
@joec4i
joec4i / main.go
Created June 11, 2023 12:58
OpenSwift dir marker tests
package main
import (
"context"
"fmt"
"github.com/ncw/swift/v2"
)
const container = "foo"
socat tcp-listen:19001,fork,reuseaddr \
exec:'ip netns exec c878c09b86bf socat STDIO "tcp-connect:127.0.0.1:19001"',nofork
@joec4i
joec4i / socket_test.php
Last active April 20, 2020 10:17
A script to test stream_socket_client()
<?php
// Usage: php socket_test.php [number_of_connections] [timeout]
ini_set('display_errors', 'On');
ini_set('error_reporting', 'E_ALL');
$n = (int)($argv[1] ?? 100);
$timeout = (float)($argv[2] ?? 0.5);
(new StreamSocketTest())->run($n, $timeout);
class StreamSocketTest

Keybase proof

I hereby claim:

  • I am joec4i on github.
  • I am joec4i (https://keybase.io/joec4i) on keybase.
  • I have a public key ASAd1PKYaoo0AdlM5bTPddOZNUXteFiHw0JrMPsZ2xU7zQo

To claim this, I am signing this object:

socat -t5 -T5 - TCP-LISTEN:8888,fork,reuseaddr
socat -t5 -T5 - TCP-LISTEN:8888,fork,reuseaddr
@joec4i
joec4i / delete-versioned-s3-bucket.py
Created August 8, 2019 12:58
A Python script to delete s3 bucket with object versions
import boto3
boto3.set_stream_logger('boto3.resources.action')
session = boto3.Session()
s3 = session.resource(service_name='s3')
bucket = s3.Bucket('bucket-name')
bucket.object_versions.delete()
bucket.delete()
package main
import "fmt"
var letterValuesConfig = map[string]int{
"AEIOULNRST": 1,
"DG": 2,
"BCMP": 3,
"FHVWY": 4,
"K": 5,
@joec4i
joec4i / glusterfs.md
Last active June 16, 2018 17:42
Setting up GlusterFS on Vagrant for Kubernetes
# Setting up GlusterFS on Vagrant for Kubernetes
Note that since this is only a setup for local testing, there is no redundancy or authentication configuration.
* The Vagrantfile for a two-node set-up
```
# -*- mode: ruby -*-
# vi: set ft=ruby :
hosts = {