This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"fmt" | |
"math/rand" | |
"time" | |
"golang.org/x/sync/errgroup" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: | |
gcc -g -Wall -c search.c -lcunit -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lglib-2.0 | |
gcc -g -Wall test_search.c search.o -lcunit -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lglib-2.0 -o test_search | |
./test_search && rm search.o test_search |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a list of examples on how to interact with the slab.com API using curl. | |
# The original documentation is https://the.slab.com/public/slab-api-vk0o0i33 but missing good examples | |
# so I figured I'd keep that one here for future reference | |
SLAB_TOKEN=<PLACE_YOUR_TOKEN_HERE> | |
# Get the organization domain | |
curl -s -X POST \ | |
-H "Authorization: ${SLAB_TOKEN}" \ | |
-H "Content-Type: application/json" \ | |
-d '{"query":"query { organization { host } }"}' \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# reports the number of occurences of an IP in aws ELB access logs files | |
awk '{match($3, /(.*):.*/,arr);k=arr[1];if(k in counter){counter[k]++}else{counter[k]=1}} END {for(i in counter){printf "%d \t %s\n",counter[i],i}}' *.log | sort -n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export ORG=VEVO | |
# generate import commands for users in the org | |
# /!\ Note the parge_arg, this one looks for the page number 2 of the list | |
export page_arg="page=2" | |
curl -s -H "Authorization: token ${GITHUB_AUTH_TOKEN}" https://api.github.com/orgs/VEVO/members?${page_arg} | jq -r '.[]| "terraform import github_membership.\(.login) VEVO:\(.login)"' | |
# generate import commands for teams in the org | |
# /!\ Note the parge_arg, this one looks for the page number 2 of the list | |
export page_arg="page=2" | |
curl -s -H "Authorization: token ${GITHUB_AUTH_TOKEN}" https://api.github.com/orgs/${ORG}/teams?${page_arg} | jq -r '.[]| "terraform import github_team.\(.slug) \(.id)"' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"errors" | |
"time" | |
"github.com/google/go-github/github" | |
"golang.org/x/oauth2" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: batch/v2alpha1 | |
kind: CronJob | |
metadata: | |
name: dynamodbdump-mytable | |
namespace: myteam | |
spec: | |
failedJobsHistoryLimit: 5 | |
successfulJobsHistoryLimit: 10 | |
schedule: 0 2 * * * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/VEVO/dynamodbdump.git | |
cd dynamodbdump | |
make build | |
# Now just restore the table: | |
./dynamodbdump -action restore \ | |
-dynamo-table mynewtable \ | |
-wait-ms 800 \ | |
-batch-size 100 \ | |
-restore-append \ | |
-s3-bucket my-dynamo-backup-bucket \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/VEVO/dynamodbdump.git | |
cd dynamodbdump | |
make build | |
# Now just take a backup | |
./dynamodbdump -action backup \ | |
-dynamo-table mytable \ | |
-wait-ms 2000 \ | |
-batch-size 1000 \ | |
-s3-bucket my-dynamo-backup-bucket \ | |
-s3-folder "backups/mytable" \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script's purpose is to test the response time on a url | |
# by doing a simple curl loop (no pause, so a bit hammering). | |
# It returns the several curl metrics in a csv file for further analysis. | |
# | |
TO="localhost" | |
OUTFILE="$(date +%Y%m%d%H%M)_curl_test_from_$(hostname)_to_${TO}.csv" | |
CURLURI="http://${TO}/crossdomain.xml" | |
CURLFORMAT='\n%{time_namelookup},%{time_connect},%{time_appconnect},%{time_pretransfer},%{time_redirect},%{time_starttransfer},%{time_total},%{num_connects},%{num_redirects}' | |
ITERATIONS=100000 |
NewerOlder