Skip to content

Instantly share code, notes, and snippets.

View Alexand's full-sized avatar

João Cunha Alexand

View GitHub Profile
@flah00
flah00 / glacier_uploader.rb
Last active July 19, 2018 08:49
Upload an archive to AWS Glacier, automatically splitting the file, if necessary
#!/usr/bin/env ruby
# Inspired by https://github.com/aws/aws-sdk-core-ruby/blob/5bdfbebc6d845ac24fb977cb078a920b03b791ac/features/glacier/step_definitions.rb#L28
# Usage: glacier_uploader.rb VAULT /PATH/TO/FILE [NUM_PARTS] [RETRIES]
# files larger than 100mb must be broken up into chunks 1mb-4gb
# total chunks cannot exceed 10,000
# chunk sizes must be a power of 2
# Metadata stored in simpledb
GDRIVE_DOMAIN = 'GlacierGdrive'
Aws.config[:logger] = Logger.new $stdout
@czerasz
czerasz / autossh.c
Last active July 25, 2016 01:58
useful commands
// Compile with
// gcc -o /etc/bin/autossh autossh.c
#include <stdio.h>
int main(int argc, char *argv[]) {
while(1) {
sleep(60);
printf(".\n");
}
}