Perl wrapper script for curl from Amazon to GET/PUT items to/from S3 buckets, adding the required headers to the curl command line.
Download: http://aws.amazon.com/code/128
$ chmod u+x s3curl.pl
$ ./s3curl.pl \
--id [AWS_KEY] \
#!/bin/bash | |
IAM_BASE_URL="http://169.254.169.254/latest/meta-data/iam/security-credentials" | |
IAMRoleName=$(curl -s $IAM_BASE_URL/) | |
IAMRoleData=$(curl -s $IAM_BASE_URL/$IAMRoleName/) | |
IAMRoleAccessKeyID=$(echo -n "$IAMRoleData" | sed -nr 's/.*?"AccessKeyId"[^"]+"([^"]+)",?/\1/p') | |
IAMRoleAccessKeySecret=$(echo -n "$IAMRoleData" | sed -nr 's/.*?"SecretAccessKey"[^"]+"([^"]+)",?/\1/p') | |
IAMRoleToken=$(echo -n "$IAMRoleData" | sed -nr 's/.*?"Token"[^"]+"([^"]+)",?/\1/p') |
#!/bin/bash | |
rm turbo/* | |
rm mozjpeg/* | |
cd orig/ | |
echo libjpeg-turbo | |
find . -name "*.jpg" -exec jpegtran -optimize -copy none -outfile "{}.tmp" "{}" \; -exec mv "{}.tmp" "../turbo/{}" \; | |
echo Done |
Perl wrapper script for curl from Amazon to GET/PUT items to/from S3 buckets, adding the required headers to the curl command line.
Download: http://aws.amazon.com/code/128
$ chmod u+x s3curl.pl
$ ./s3curl.pl \
--id [AWS_KEY] \
Taken from XBMC Wiki.
UPDATE art SET url = REPLACE(url,'nfs://192.168.0.2/','nfs://nas/');
UPDATE episode SET c18 = REPLACE(c18,'nfs://192.168.0.2/','nfs://nas/');
UPDATE movie SET c22 = REPLACE(c22,'nfs://192.168.0.2/','nfs://nas/');
<?php | |
class TestClass { | |
public function generator() { | |
$this->curlRequestThingy( | |
'http://domain.com/endpoint', | |
// function here passed to CURLOPT_WRITEFUNCTION | |
function($data) { |
<?php | |
// https://gist.github.com/magnetikonline/650e30e485c0f91f2f40 | |
class DumpHTTPRequestToFile { | |
public function execute($targetFile) { | |
$data = sprintf( | |
"%s %s %s\n\nHTTP headers:\n", | |
$_SERVER['REQUEST_METHOD'], | |
$_SERVER['REQUEST_URI'], | |
$_SERVER['SERVER_PROTOCOL'] |
FROM ubuntu:18.04 | |
LABEL maintainer="Peter Mescalchin <[email protected]>" | |
RUN sed --in-place --regexp-extended "s/(\/\/)(archive\.ubuntu)/\1au.\2/" /etc/apt/sources.list && \ | |
apt-get update && apt-get upgrade --yes |