Skip to content

Instantly share code, notes, and snippets.

View tairov's full-sized avatar

Aydyn Tairov tairov

  • London, UK
View GitHub Profile
# ffmpeg -i "$1" -vcodec h264 -threads 10 "$2"
process_mov_files() {
{
find . -name "*.mov" -print0 | while read -d $'\0' file
do
{
NEW_NAME="$(echo "${file%.mov}" | sed 's/[ _]/-/g' | tr '[:upper:]' '[:lower:]')"
ffmpeg -i "$file" -vcodec h264 -threads 10 -f mp4 "${NEW_NAME}.mp4"
} < /dev/null
while true; do printf 'HTTP/1.1 200 OK\n\n%s' "pong $(date)" | nc -l 8888; done
* To use Docker, the Docker daemon must be running as root. To automatically
* start the Docker daemon at boot, add Docker to the default runlevel:
* rc-update add docker default
* Similarly for systemd:
* systemctl enable docker.service
*
* To use Docker as a non-root user, add yourself to the 'docker' group:
* usermod -aG docker youruser
@tairov
tairov / video_cut.sh
Created April 30, 2019 13:52
cut video with ffmpeg
#!/usr/bin/env bash
# INPUT_SRC=input.mp4
INPUT_SRC=input.mp4
START_TIME=00:39:51
END_TIME=00:40:29
echo Start processing
ffmpeg -ss $START_TIME -i $INPUT_SRC -acodec copy -vcodec copy -c copy -to $END_TIME output2.mp4
INPUT_SRC=$(youtube-dl -f best -g 'https://www.youtube.com/watch?v=wnHW6o8WMas')
ffmpeg -ss 00:01:22 -i $INPUT_SRC -vframes 1 -q:v 2 output.jpg
# shared library
// mylib/vars/myGitlabStage.groovy
call (String _stage, Closure _closure, String _label = 'master') {
stage(_stage) {
node (_label) {
gitlabCommitStatus(name: _stage ) {
_closure()
}
} // node
[main] "stdout_lines": [
[main] "JENKINS_HOME=/opt/jervis/../my_jenkins_home",
[main] "GIT_PREVIOUS_SUCCESSFUL_COMMIT=2287deab5c65f0597650ec7f83f779883ae4c5a0",
[main] "ENVIRONMENT_NAME=dev",
[main] "MAIL=/var/mail/jenkins",
[main] "USER=jenkins",
[main] "RUN_CHANGES_DISPLAY_URL=http://localhost:8080/page=changes",
[main] "HUDSON_URL=http://localhost:8080/",
[main] "NODE_LABELS=ansible docker docker-local-dace45f6a860 linux stable",
[main] "GIT_COMMIT=c690358ed6678d11fe96684690ab00c103c218c3",
- name: Set serviceName for ingress rules
debug: msg="{{ definition.spec.rules[sub_index] }}"
with_subelements:
- "{{ definition.spec.rules }}"
- http.paths
loop_control:
index_var: sub_index
when: type == 'ingress'
# ansible-playbook -i inventory playbook.yml -vv
all:
vars:
ansible_connection: local
var1: "value from all"
group1:
vars:
var1: "value from group1"
hosts:
@tairov
tairov / .inventory
Created May 10, 2018 12:50
Ansible vars
k8s-host:
vars:
definition: "definition from k8s-host"
hosts:
k8s-deployment-host:
vars:
definition: "definition from k8s-deployment-host"
k8s-deployment-host:
vars: