Skip to content

Instantly share code, notes, and snippets.

View poysama's full-sized avatar

poysama poysama

View GitHub Profile
@poysama
poysama / rtmp.conf
Created May 3, 2018 15:14
RTMP Nginx Twitch and Facebook Live
rtmp {
server {
listen 1935;
chunk_size 4096;
application live {
live on;
record off;
push rtmp://live-sin.twitch.tv/app/your_secret;
push rtmp://live-api.facebook.com:80/rtmp/your_secret;
@poysama
poysama / centos_python.sh
Created January 11, 2017 08:15 — forked from selfboot/centos_python.sh
CentOS 6.8: Install Python 2.7.10, pip, virtualenv, and virtualenvwrapper on CentOS
#!/bin/bash
# According to:
# How To Set Up Python 2.7.6 and 3.3.3 on CentOS 6.4
# https://www.digitalocean.com/community/tutorials/how-to-set-up-python-2-7-6-and-3-3-3-on-centos-6-4
yum -y update
yum groupinstall -y 'development tools'
yum install -y zlib-devel openssl-devel sqlite-devel bzip2-devel xz-libs
wget http://www.python.org/ftp/python/2.7.10/Python-2.7.10.tar.xz
xz -d Python-2.7.10.tar.xz
### Given a configuration file for rails named app.yml which contains whatever dynamic content
# init.pp
class rails (
$configs = {},
) {
create_resources('rails::config', $configs, {})
}
define rails::config (
@poysama
poysama / testing
Last active August 29, 2015 14:06
testing
#!/usr/bin/env ruby
describe Adder do
before(:each) do
@adder = Adder.new
end
it "should add 2 numbers" do
expect { @added.add(1,2) }.to equal 3
end
Cablefile
# REST source
source "http://10.48.30.75:5984/chronic/account"
# adjust template path
# default is config/templates
template_path 'config/templates'
# simple template
$VAR1 = bless( {
'_protocol' => 'HTTP/1.1',
'_content' => '{"status":-3,"appstatus":-128,"statusstring":"No connections.","appstatusstring":null,"results":[]}',
'_rc' => 200,
'_headers' => bless( {
'connection' => 'close',
'content-type' => 'application/json;charset=utf-8',
'client-response-num' => 1,
'server' => 'Jetty(7.6.1.v20120215)'
}, 'HTTP::Headers' ),
# Nagions check_pm2 command
#
# define command {
# command_name check_pm2
# command_line $USER1$/check_pm2 --host=$HOSTADDRESS --name=translation_engine
#
# Nagios service example check for translation_engine
#
# define service{
# use tech-service
@poysama
poysama / gist:5947716
Last active December 19, 2015 11:29
How do you access a class that is inside a module in another module without specifying its scope?
#!/usr/bin/env ruby
module AwesomeProject
module Models
class User
def intialize
end
end
end
end
family "smith" do
mother "rose" do
age "60"
end
father "bob" do
age "65"
occupation "software developer"
end