Skip to content

Instantly share code, notes, and snippets.

View QuentinBrosse's full-sized avatar
🕺
Work hard, play hard

Quentin Brosse QuentinBrosse

🕺
Work hard, play hard
View GitHub Profile
@QuentinBrosse
QuentinBrosse / scaleway-provider-v1.11.0-test-guide.md
Last active November 25, 2019 10:27
Scaleway Provider v1.11.0 Test Guide

Scaleway Provider v1.11.0 Test Guide

In order to improve our provider and support our new products, we have made a significant refactoring on the whole codebase to release version 2 in the future. You can find more information on the roadmap.

You can find an overview of the new resources here.

What to test?

Your mission is to test the new version (v1.11.0) for our provider to fix potential issues in the documentation and in the provider itself. To do so, the new documentation will be your best friend. We intentionally don't give you more information in order to test the efficiency of the new documentation.

@QuentinBrosse
QuentinBrosse / image-id-by-label.md
Last active August 9, 2021 12:24
Find Scaleway Image ID by Label

Find Scaleway Image ID by Label

It could be difficult to find a Scaleway image ID for the right zone, architecture, and instance type. The Scaleway marketplace API has an endpoint dedicated to that but it could be difficult to understand the response and to find the right image UUID.

Here is a bash command that returns a JSON with just the necessary information needed to find your image ID.

curl -s 'https://api-marketplace.scaleway.com/images?page=1&per_page=100' | sed 's/par1/fr-par-1/g; s/ams1/nl-ams-1/g' | jq '.images | map({"key": .label | gsub("_";"-"), "value": .versions[0].local_images}) | from_entries'
@QuentinBrosse
QuentinBrosse / guessCannedACL.go
Created November 27, 2019 10:05
Guess S3 canned ACL from an ACL object
// This is experimental.
// guessCannedACL try to guess the canned ACL from an ACL object.
//
// Canned ACL table: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
func guessCannedACL(acl *s3.GetBucketAclOutput) (string, error) {
if acl.Owner == nil || acl.Owner.ID == nil {
return "", fmt.Errorf("no owner")
}
ownerID := *acl.Owner.ID
@QuentinBrosse
QuentinBrosse / mv_py_camel_case.sh
Last active August 31, 2021 09:33
This script renames all PascalCase python files in the current directory into camel_case version.
#!/usr/bin/env bash
# This script renames all PascalCase python files in the current directory into camel_case version.
# Note: gsed is the GNU sed; on macOS install with `brew install gnu-sed`
for path in $(find . -maxdepth 1 -regex '\./[A-Z].*\.py')
do
pascal_case=$(echo $path | cut -c 3-)
camel_case=$(echo $pascal_case | gsed -E 's/([A-Z])/_\L\1/g' | cut -c 2-)
git mv $pascal_case $camel_case