Skip to content

Instantly share code, notes, and snippets.

View hostmaster's full-sized avatar
:dependabot:
Drone pilot at work

Igor Khomyakov hostmaster

:dependabot:
Drone pilot at work
  • Sweden
  • 04:15 (UTC +02:00)
View GitHub Profile
---
- hosts: all
gather_facts: False
sudo: True
tasks:
- service:
name: revealcloud
enabled: no
state: stopped
- command: killall revealcloud
@hostmaster
hostmaster / Dockerfile
Last active August 29, 2015 14:26 — forked from ipmb/Dockerfile
Example wheel upload to simple PyPI on S3
FROM ubuntu:14.04
ENV BUCKET your-s3-bucket
RUN apt-get update && apt-get install -y wget \
build-essential python-dev \
libssl-dev libffi-dev \
libpcre3-dev \
libmemcached-dev \
libpq-dev \
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "web" do |web|
web.vm.box = "ubuntu/trusty64"
end
config.vm.define "db" do |db|
db.vm.box = "ubuntu/trusty64"
# dict key tranformation table
_ssh_to_ansible = {
'user': 'ansible_ssh_user',
'hostname': 'ansible_ssh_host',
'identityfile': 'ansible_ssh_private_key_file',
'port': 'ansible_ssh_port'
}
# host_config = config.lookup(box_name) # dict
temp = {}
@hostmaster
hostmaster / mysqldump_to_s3.sh
Last active August 29, 2015 14:24
Backing up RDS instance to s3 directly. s3cmd version > 1.5 is required. All credit goes to http://serverfault.com/a/690328/76773
mysqldump --host=$DB_HOSTNAME --user=$DB_USER $DB_NAME -p | gzip | s3cmd put - s3://YOU-S3-BUCKET-NAME/backup-$(date +%F).sql.gz

Live stream Xiaomi Ants Smart Camera via FFMPEG

This assumes you have a Xiaomi Ants Smart Camera that still has the open RTSP enabled. I think newer firmware might remove this capability. If you Google enough you can find instructions on how to downgrade.

FFMPEG

FFMPEG is where most of the magic happens. I use OSX and as such am a fan of using Homebrew to install free software. Here is my ffmpeg install command:

brew install ffmpeg --with-faac --with-fdk-aac --with-ffplay --with-fontconfig --with-freetype --with-frei0r --with-libass --with-libbluray --with-libcaca --with-libquvi --with-libsoxr --with-libssh --with-libvidstab --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-openssl --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools --with-webp --with-x265

Live stream Xiaomi Ants Smart Camera via FFMPEG

This assumes you have a Xiaomi Ants Smart Camera that still has the open RTSP enabled. I think newer firmware might remove this capability. If you Google enough you can find instructions on how to downgrade.

FFMPEG

FFMPEG is where most of the magic happens. I use OSX and as such am a fan of using Homebrew to install free software. Here is my ffmpeg install command:

brew install ffmpeg --with-faac --with-fdk-aac --with-ffplay --with-fontconfig --with-freetype --with-frei0r --with-libass --with-libbluray --with-libcaca --with-libquvi --with-libsoxr --with-libssh --with-libvidstab --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-openssl --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools --with-webp --with-x265

error_page 503 /during_build.html;
location / {
if (-f /var/www/during_build.html) {
return 503;
}
}

Playbook:

- hosts: all
  gather_facts: no
  remote_user: root
  roles:
  - { role: test_become_r2, sudo_user: testing }
  tasks:
 - command: whoami
@hostmaster
hostmaster / post-disconnect.sh
Created March 30, 2015 16:47
Tunnelblick VPN Configuration scripts https://code.google.com/p/tunnelblick/wiki/cUsingScripts. Disable DNScrypt beforу and enable back after.
#!/bin/sh
pushd /Library/PreferencePanes/DNSCrypt.prefPane/Contents/Resources/usr/scripts && ./switch-to-dhcp.sh