Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import os,sys,re
from sets import Set
from pipes import quote
FILE_TYPES=[
'.mkv',
'.avi',
'.mp4',
'.flv'
#!/bin/bash
TMPPATH="/tmp"
function run_ffmpeg(){
input_file=$1
output_file=$2
echo ffmpeg from $1 to $2
#ffmpeg -v info -hide_banner -i ${input_file} -c:v libx264 -x264opts bitrate=1200:vbv-maxrate=1200:vbv bufsize=200:nal-hrd=cbr:force-cfr=1 -r 30 -movflags +faststart -pix_fmt yuv420p -preset slow -tune film -c:a aac -ar 44100 -b:a 128k ${output_file}.mp4
}
SRC=$1
Total objects size:82485061812
Total objects number:28316047
CNS:{:count=>5925, :size=>116272}
Top 10 projects by size
58aae0be9ba4d900075ef35f
{"q:"=>{:size=>79802075800, :count=>4394003}, :total=>{:size=>79802091074, :count=>4394049}, "m:"=>{:size=>15274, :count=>46}}
5afa8ce03215080009198861
{"q:"=>{:size=>1341877908, :count=>728228}, :total=>{:size=>1341886696, :count=>728234}, "m:"=>{:size=>8788, :count=>6}}
59883dad8f237e000a1e3025
{"q:"=>{:size=>873431360, :count=>750968}, :total=>{:size=>873449766, :count=>750996}, "m:"=>{:size=>18406, :count=>28}}
@dukelion
dukelion / set-elb-access-logs.py
Last active March 13, 2018 08:01
Make sure ELB access logs enabled for MQ
#!/usr/bin/env python
import boto3
from os import getenv
region = getenv('AWS_REGION','us-east-1')
ec2 = boto3.client('elbv2', region_name=region)
response = ec2.describe_load_balancers()
grepAccessLogParam = lambda x: x['Key'] == 'access_logs.s3.enabled'
grepAccessLogBucket = lambda x: x['Key'] == 'access_logs.s3.bucket'
@dukelion
dukelion / Dockerfile
Created September 15, 2017 08:23
Rocksdb tools image
# docker-rocksdb
Alpine Linux image with compiled and installed RocksDB with all compression libraries
dukelion@x1-carbon:~/source/docker-rocksdb$ cat Dockerfile
FROM golang:1.8-alpine
RUN echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >>/etc/apk/repositories && \
echo "@community http://nl.alpinelinux.org/alpine/edge/community" >>/etc/apk/repositories
RUN apk add --update --no-cache build-base linux-headers git cmake bash #wget mercurial g++ autoconf libgflags-dev cmake bash jemalloc perl
RUN apk add --update --no-cache zlib zlib-dev bzip2 bzip2-dev snappy snappy-dev lz4 lz4-dev zstd@community zstd-dev@community jemalloc jemalloc-dev libtbb-dev@testing libtbb@testing
### Keybase proof
I hereby claim:
* I am dukelion on github.
* I am dukelion (https://keybase.io/dukelion) on keybase.
* I have a public key whose fingerprint is CEB5 ED18 CC1C EFD8 9500 DF05 886C 160F FBDA 45A9
To claim this, I am signing this object:
listen 443 ssl;
ssl on;
ssl_certificate /etc/letsencrypt/live/wiki.iron.io/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/wiki.iron.io/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/wiki.iron.io/fullchain.pem;
ssl_dhparam /etc/ssl/private/dhparam.key;
ssl_session_timeout 24h;
ssl_session_cache shared:SSL:10m;
ssl_stapling on;
ssl_stapling_verify on;
@dukelion
dukelion / gist:f6263bd164afa1ca6631
Created December 8, 2015 12:26
job description
[6:13:38 PM] Vadim Glebov: У нас есть один клиент в Израиле и он хочет часть своих задач переложить на другого специалиста, чтобы освободить время для бизнеса, вот что он пишет:
In our company we're 6 people sitting in the office. The problem is that I am the only technical person. So at least 50% of my time is going on IT support.
I do stuff like cloning databases, writing fast scripts for WP, coding automation scripts and other stuff like that. Anyway, those are all really simple tasks so we decided to hire someone for that position. I think it's called DevOps.
Here are the responsibilities for this position:
* Priority 1 (20% of the time):
* Give technical support with JS, HTML, CSS, PHP
$r = mysql_query("SELECT count(*) FROM user");
$d = mysql_fetch_row($r);
$rand = mt_rand(0,$d[0] - 1);
$r = mysql_query("SELECT username FROM user LIMIT $rand, 1");
whois ts.kg
% This is the .kg ccTLD Whois server
% Register your own domain at http://www.domain.kg
Domain TS.KG
Administrative Contact:
PID: 10613-KG
Name: Фейдман А.В.
Email: [email protected]