If you haven't already, install fail2ban and ufw:
sudo apt-get install fail2ban ufw
Now make a copy of the fail2ban configuration, and name it jail.local:
| # Automatically instal the latest nginx | |
| wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add - | |
| #Make a backup copy of your current sources.list file | |
| sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak | |
| #Now copy the following repositories to the end of ` /etc/apt/sources.list` | |
| echo "deb http://nginx.org/packages/mainline/debian/ jessie nginx" | tee -a /etc/apt/sources.list | |
| echo "deb-src http://nginx.org/packages/mainline/debian/ jessie nginx" | tee -a /etc/apt/sources.list |
Based on this links:
$ cd /usr/share/nginx/html/
| ffmpeg -i rtsp://${SOURCE} -vcodec copy -f flv\ | |
| -acodec libmp3lame -ar 44100 -threads 6 -qscale 3 -b:a 712000 -bufsize 512k\ | |
| rtmp://a.rtmp.youtube.com/live2/${KEY} |
This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.
Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.
Use the Raspberry Pi Configuration tool or sudo raspi-config to:
I've been playing with jq, and I've been having a hard time finding examples of how it works with output from a service like AWS (which I use a lot).
Here is one I use a lot with vagrant-ec2.
When we're launching and killing a lot of instances, the AWS API is the only way to track down which instances are live, ready, dead, etc.
To find instances that are tagged with e.g. {"Key" = "Name", "Value" = "Web-00'} in the middle of a vagrant dev cycle, or a prod launch/replace cycle, you can do something like this:
| #!/bin/bash | |
| # settings | |
| # Login information of freenom.com | |
| freenom_email="main@address" | |
| freenom_passwd="pswd" | |
| # Open DNS management page in your browser. | |
| # URL vs settings: | |
| # https://my.freenom.com/clientarea.php?managedns={freenom_domain_name}&domainid={freenom_domain_id} | |
| freenom_domain_name="domain.name" |
| # save it as /etc/profile.d/ssh-telegram.sh | |
| # use jq to parse JSON from ipinfo.io | |
| # get jq from here http://stedolan.github.io/jq/ | |
| USERID="<target_user_id>" | |
| KEY="<bot_private_key>" | |
| TIMEOUT="10" | |
| URL="https://api.telegram.org/bot$KEY/sendMessage" | |
| DATE_EXEC="$(date "+%d %b %Y %H:%M")" | |
| TMPFILE='/tmp/ipinfo-$DATE_EXEC.txt' | |
| if [ -n "$SSH_CLIENT" ]; then |
| " Vundle config | |
| set nocompatible " be iMproved, required | |
| filetype off " required | |
| " set the runtime path to include Vundle and initialize | |
| set rtp+=~/.vim/bundle/Vundle.vim | |
| call vundle#begin() | |
| " alternatively, pass a path where Vundle should install plugins | |
| "call vundle#begin('~/some/path/here') |