openssl rand -base64 512 | tr -d '\r\n' > /path/to/secret
export EDITOR=nano; knife data bag create BAG_NAME ITEM_NAME -z --secret-file /path/to/chef_secret
import json | |
import boto3 | |
import gzip | |
import base64 | |
import time | |
# AWS account ID | |
AWS_ACCOUNT_ID = "001234567890" | |
# CloudWatch log group name |
class ClassFinder { | |
static List<Class> findClasses(Class clazz) { | |
URL srcLocation = clazz.getProtectionDomain().getCodeSource().getLocation() | |
String packageName = clazz.package.name | |
List<String> classNames | |
if (srcLocation.toString().endsWith('.jar')) { | |
String packagePath = packageName.replaceAll(/\./, '/') | |
classNames = loadClassNamesFromJar(srcLocation, packagePath) | |
} else { | |
File dir = new File(clazz.getResource('').toURI()) |
/*** BEGIN META {"name" : "Bulk Delete Jobs", | |
"comment" : "Delete jobs disabled and where last build is older than specified param", | |
"parameters" : [ 'dryRun', 'numberOfDays', 'excludeRegexp' ], | |
"core": "2.0", | |
"authors" : [{ name : "Benjamin Francisoud" }, { name : "Aleksei Vesnin" }]} END META**/ | |
import jenkins.model.* | |
import java.util.regex.Pattern |
#!/bin/bash | |
set -e | |
region=eu-central-1 | |
haproxy_url=http://haproxy.internal:5555 | |
haproxy_username=admin | |
haproxy_password=password | |
cluster_size=3 |
#!/usr/bin/env bash | |
TASK=$@ | |
FAIL_CNT=0 | |
RUN= | |
TASK_PID= | |
LOOPID=1 | |
_ctl() { |
sudo service pritunl stop | |
mongodump -d pritunl -o pritunl-bkp | |
tar -czvf pritunl-bkp.tar.gz pritunl-bkp |
CHttpSession.timout - session data will be cleaned up (default - 1440) | |
CHttpSession.cookieParams.lifetime - session cookie lifetime (default - 0 means "until the browser is closed.") | |
CWebUser.authTimeout - user is logged out if inactive (not set - after the current session expires) | |
CWebUser.absoluteAuthTimeout - user is logged out regardless of activity (not set - ommited) | |
== | |
CWebUser.allowAutoLogin = true | |
CWebUser.autoRenewCookie = false |
# Based on https://blog.mediacru.sh/2013/12/23/The-right-way-to-encode-HTML5-video.html | |
# ogv | |
ffmpeg -i input.mp4 -q 5 -pix_fmt yuv420p -vcodec libtheora -vf "crop=1200:680:360:200" -an output.ogv | |
# Cropped WebM without audio | |
ffmpeg -i input.mp4 -c:v libvpx -pix_fmt yuv420p -quality good -b:v 2M -crf 5 -vf "crop=1200:680:360:200,scale=trunc(in_w/2)*2:trunc(in_h/2)*2" -an -f webm output.webm | |
# Same mp4 | |
ffmpeg -i input.mp4 -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -preset slower -b:v 2M -crf 18 -maxrate 4000k -bufsize 1835k -vf "crop=1200:680:360:200,scale=trunc(in_w/2)*2:trunc(in_h/2)*2" -an -movflags faststart -f mp4 output.mp4 |
#!/bin/bash | |
# | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2014 Mathias Leppich <[email protected]> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |