Skip to content

Instantly share code, notes, and snippets.

View famousgarkin's full-sized avatar
🐐

Ján Dzurek famousgarkin

🐐
View GitHub Profile
@famousgarkin
famousgarkin / git-pull-or-clone.sh
Created June 19, 2017 12:00
Git pull or clone
git -C repo pull || git clone [email protected]:repo.git repo
@famousgarkin
famousgarkin / read-ssl-cert-from-console.sh
Last active May 29, 2017 19:43
read SSL cert file from console
openssl x509 -text -noout -in cert.crt
@famousgarkin
famousgarkin / my-travis-branch.sh
Last active May 22, 2017 11:16
Travis CI workaround for $TRAVIS_BRANCH contains target branch on PR, not source branch
# NOTE: $TRAVIS_BRANCH contains target branch on PR, not source branch
# ref https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables
export MY_TRAVIS_BRANCH=${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}
tar -czp path | s3cmd --access_key=ASDF --secret_key=1234 put - s3://bucket/path-$(date +%F).tar.gz
@famousgarkin
famousgarkin / aws-route53-export.yml
Created May 4, 2017 08:19
Ansible AWS Route 53 export playbook
- hosts: localhost
gather_facts: no
tasks:
- name: get hosted zones
route53_facts: query=hosted_zone
register: hosted_zone
- name: get record sets
route53_facts: query=record_sets hosted_zone_id={{item.Id}}
with_items: '{{hosted_zone.HostedZones}}'
@famousgarkin
famousgarkin / sse-proxy.conf
Created March 22, 2017 07:43
Nginx SSE proxy snippet
# http://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive
proxy_http_version 1.1;
proxy_set_header Connection '';
# also consider:
# http://stackoverflow.com/questions/13672743/eventsource-server-sent-events-through-nginx
# http://serverfault.com/questions/801628/for-server-sent-events-sse-what-nginx-proxy-configuration-is-appropriate
@famousgarkin
famousgarkin / websocket-proxy.conf
Created March 22, 2017 07:40
Nginx WebSocket proxy snippet
# https://www.nginx.com/blog/websocket-nginx/
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
@famousgarkin
famousgarkin / concatenate.sh
Created March 19, 2017 11:41
ffmpeg concatenate files
ffmpeg -f concat -i in.txt -c copy out.mp4
@famousgarkin
famousgarkin / convert.sh
Created March 18, 2017 18:37
ffmpeg convert to mp4
ffmpeg -i "in.avi" "out.mp4"
@famousgarkin
famousgarkin / fix.sh
Created March 18, 2017 18:10
ffmpeg fix "Video uses a non-standard and wasteful way to store B-frames ('packed B-frames'). Consider using the mpeg4_unpack_bframes bitstream filter without encoding but stream copy to fix it."
ffmpeg -i "in.avi" -bsf:v mpeg4_unpack_bframes -vcodec copy "out.avi"