Skip to content

Instantly share code, notes, and snippets.

View hostmaster's full-sized avatar
🏠
Working from home

Igor Khomyakov hostmaster

🏠
Working from home
  • Russia, Saint Petersburg
View GitHub Profile
#!/bin/bash -e
####
# based on https://gist.github.com/jeffery/1115504
# Helper script to update the Last modified timestamp of files in a Git SCM
# Projects working Copy
#
# When you clone a Git repository, it sets the timestamp of all the files to the
# time when you cloned the repository.
#
# This becomes a problem when you want the cloned repository, which is part of a

Playbook:

- hosts: all
  gather_facts: no
  remote_user: root
  roles:
  - { role: test_become_r2, sudo_user: testing }
  tasks:
 - command: whoami

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

@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 \
@hostmaster
hostmaster / addsite.sh
Created April 5, 2012 08:26
Ubuntu 10.04 (nginx + php5-fpm): Install MODX 2.2 including user, virtual host, database
#!/bin/bash
# MySQL root password
ROOTPASS="password"
TIMEZONE="Europe/Moscow"
MYSQLPASS=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12`
SFTPPASS=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12`
##############
pid = /var/run/stunnel.pid
socket = a:SO_REUSEADDR=1
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
debug = 2
[ssl_frontend]
client = no
key = /WOO/server1024.key
cert = /WOO/server1024.crt
- name: Set the hostname in rc.conf
lineinfile: dest=/etc/rc.conf regexp="^hostname" line='hostname="{{ hostname }}"'
register: hostnamestatus
- name: Set the hostname
command: hostname {{ hostname }}
when: hostnamestatus.changed
#!/usr/bin/env python
# encoding: utf-8
"""
greenparser.py
A simple test script to measure the difference between
regular urllib2 downloads and gevent-based downloads.
"""
from gevent import monkey
monkey.patch_socket()
# Steps for turning on squid monitoring (until I have an rpm)
cat > /etc/collectd.d/squid << EOF
LoadPlugin exec
<Plugin exec>
Exec deploy "/var/lib/releng/monitoring/squid"
</Plugin>
EOF
mkdir -p /var/lib/releng/monitoring
@hostmaster
hostmaster / btsync.supervisor.conf
Last active December 26, 2015 21:29 — forked from MartinBrugnara/btsync.supervisor.conf
supervisord configuration for btsync
[program:btsync]
command=/opt/BTSync/bin/btsync --nodaemon --config /home/<%= btuser %>/.btsync/config
user=<%= btuser %>
umask=002
directory=/home/<%= btuser %>
redirect_stderr=true
stdout_logfile=/home/<%= btuser %>/.btsync/error.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=3
autorestart=true