Skip to content

Instantly share code, notes, and snippets.

View DarthSim's full-sized avatar

Sergei Aleksandrovich DarthSim

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="9" librarySectionTitle="Фильмы" librarySectionUUID="e0942539-8a4d-4271-9c9d-670a379a6825" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1418750662">
<Video ratingKey="2851" key="/library/metadata/2851" guid="com.plexapp.agents.kinopoiskru://342?lang=ru" studio="A Band Apart" type="movie" title="Криминальное чтиво" originalTitle="Pulp Fiction" contentRating="R" summary="КиноПоиск: 8.635 (192687). IMDb: 9.0 (1022283). &#xA;Двое бандитов Винсент Вега и Джулс Винфилд проводят время в философских беседах в перерыве между разборками и «решением проблем» с должниками своего криминального босса Марселласа Уоллеса. Параллельно разворачивается три истории." rating="8.6" viewOffset="1166211" lastViewedAt="1419410007" year="1994" tagline="Just because you are a character doesn&apos;t mean you have character" thumb="/library/metadata/2851/thumb/1419010968" art="/library

Keybase proof

I hereby claim:

  • I am darthsim on github.
  • I am darthsim (https://keybase.io/darthsim) on keybase.
  • I have a public key ASDbO-9ZUeZWBo756yqgq4zo3QmqqTUl5w4MY7-5_3iqrwo

To claim this, I am signing this object:

@DarthSim
DarthSim / imgproxy.conf
Created November 30, 2017 12:59
Nginx configuration for imgproxy
server {
server_name your-domain.com;
listen 443;
client_max_body_size 8M;
ssl on;
ssl_certificate /path/to/your/cert.crt;
ssl_certificate_key /path/to/your/cert.key;
@DarthSim
DarthSim / 00.imgproxy_vs_alternatives.md
Last active September 23, 2024 05:55
imgproxy vs alternatives benchmark

imgproxy vs alternatives benchmark

Setup

  • c5.xlarge AWS instance: 4 CPUs, 8 GB RAM
  • Ubuntu 18.04
  • Go 1.12
  • Python 2.7
  • Vips 8.7.4
@DarthSim
DarthSim / Dockerfile
Created May 20, 2019 12:25
imgproxy + nginx
FROM darthsim/imgproxy:latest
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
&& apk --no-cache upgrade \
&& apk add --no-cache nginx
RUN echo -e "#!/bin/bash\nnginx && imgproxy" > /usr/local/bin/imgproxy-nginx
RUN chmod +x /usr/local/bin/imgproxy-nginx
RUN mkdir -p /run/nginx
@DarthSim
DarthSim / 01_jpeg_x86
Last active July 20, 2020 11:03
Benchmark of imgproxy on c5 (x86) and c6g (arm) instances of AWS ES2.
Concurrency Level: 8
Time taken for tests: 579.080 seconds
Complete requests: 5000
Failed requests: 0
Total transferred: 253160000 bytes
HTML transferred: 251255000 bytes
Requests per second: 8.63 [#/sec] (mean)
Time per request: 926.528 [ms] (mean)
Time per request: 115.816 [ms] (mean, across all concurrent requests)
Transfer rate: 426.93 [Kbytes/sec] received
@DarthSim
DarthSim / imgproxy.json
Created June 10, 2020 14:26
Grafana dashboard for imgproxy
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
import (
"imgproxy"
)
func foo() {
imgproxy.SetEndpoint("https://my-imgproxy.com")
imgproxy.SetKeySalt("MYKEY", "MYSALT")
imgproxyURL := imgproxy.NewUrl(
"local:///my_pic.jpg",
#include <stdlib.h>
#include <vips/vips.h>
int main( int argc, char *argv[] ) {
if( argc < 2 ) {
printf("src image path is missing\n");
return 1;
}
if( argc < 3 ) {
HEROKU_APPLICATION="your_application_name"
IMGPROXY_TAG="v3.7.2"
# You'll probably have to do this just once
heroku login
heroku container:login
# Make sure you use "-amd64" prefix. Otherwise you may accidentally deploy
# arm64 build of imgproxy which won't run on Heroku
docker pull us-docker.pkg.dev/imgproxy-pro/v3/imgproxy:$IMGPROXY_TAG-amd64