Whats the maximum number of virtual processor cores available in aws lambda
Memory: 3008 MB
from datetime import datetime | |
import urllib.request | |
import base64 | |
import json | |
import time | |
import os | |
webui_server_url = 'http://127.0.0.1:7860' | |
out_dir = 'api_out' |
# Set the control character to Ctrl+Spacebar (instead of Ctrl+B) | |
set -g prefix C-space | |
unbind-key C-b | |
bind-key C-space send-prefix | |
# Set new panes to open in current directory | |
bind c new-window -c "#{pane_current_path}" | |
bind '"' split-window -c "#{pane_current_path}" | |
bind % split-window -h -c "#{pane_current_path}" |
This snippet is a sample showing how to implement CloudWatch Logs streaming to ElasticSearch using terraform
.
I wrote this gist
because I didn't found a clear, end-to-end example on how to achieve this task. In particular,
I understood the resource "aws_lambda_permission" "cloudwatch_allow"
part by reading a couple of bug reports plus
this stackoverflow post.
The js
file is actually the Lambda function automatically created by AWS when creating this pipeline through the
web console. I only added a endpoint
variable handling so it is configurable from terraform
.
import bpy | |
# https://blender.stackexchange.com/questions/5281/blender-sets-compute-device-cuda-but-doesnt-use-it-for-actual-render-on-ec2 | |
bpy.context.user_preferences.addons['cycles'].preferences.compute_device_type = 'CUDA' | |
bpy.context.user_preferences.addons['cycles'].preferences.devices[0].use = True | |
bpy.context.scene.cycles.device = 'GPU' | |
bpy.data.scenes["Scene"].render.filepath = "/tmp/output.png" | |
bpy.ops.render.render(write_still=True) |
// npm install --save scrollreveal or install like you're used to doing it. | |
// It doesn't work well if there are multiple instances of ScrollReveal, | |
// so we have to create a module returning an instance: | |
// file ScrollReveal.js: | |
import ScrollReveal from 'scrollreveal' | |
export default ScrollReveal() | |
// Then in a component: | |
import React from 'react' | |
import sr from './ScrollReveal' |
import ReactUpdates from 'react-dom/lib/ReactUpdates' | |
import ReactDefaultBatchingStrategy from 'react-dom/lib/ReactDefaultBatchingStrategy' | |
import 'isomorphic-fetch' | |
const logError = (err, extra = {}) => { | |
fetch('/logger', { | |
method: 'POST', | |
credentials: 'same-origin', | |
headers: { 'Content-Type': 'application/json' }, | |
body: JSON.stringify({ |
Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).
docker run -it --rm --privileged --pid=host justincormack/nsenter1
more info: https://github.com/justincormack/nsenter1
Transcoding FLAC music to Opus:
ffmpeg is a highly useful application for converting music and videos. However, audio transcoding is limited to a a single core. If you have a large FLAC archive and you wanted to compress it into the efficient Opus codec, it would take forever with the fastest processor to complete, unless you were to take advantage of all cores in your CPU.
parallel 'ffmpeg -v 0 -i "{}" -c:a libopus -b:a 128k "{.}.opus"' ::: $(find -type f -name '*.flac')
Transcoding Videos to VP9: