Skip to content

Instantly share code, notes, and snippets.

@ariia-git
ariia-git / SecureSessionHandler.php
Created October 12, 2015 05:39 — forked from eddmann/SecureSessionHandler.php
Secure session handler implementation.
<?php
class SecureSessionHandler extends SessionHandler {
protected $key, $name, $cookie;
public function __construct($key, $name = 'MY_SESSION', $cookie = [])
{
$this->key = $key;
$this->name = $name;
@ariia-git
ariia-git / install-ffmpeg-amazon-linux.sh
Last active June 11, 2016 22:06 — forked from gboudreau/install-ffmpeg-amazon-linux.sh
How to compile ffmpeg on Amazon Linux (EC2)
#!/bin/sh
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
#!/usr/bin/env python
import sys, getopt, csv, pprint
from pymongo import MongoClient
global_mongo = None
global_db = None
global_coll = None
def usage(msg):
@ariia-git
ariia-git / jira-behing-nginx-ssl
Created October 28, 2017 14:57 — forked from jtbonhomme/jira-behing-nginx-ssl
Atlassian JIRA behind nginx + SSL
# force HTTP to HTTPS - /etc/nginx/conf.d/nonssl.conf
server {
listen 80;
server_name jira.example.com;
access_log off;
return 301 https://$server_name$request_uri;
}
# /etc/nginx/conf.d/jira.conf
server {
@ariia-git
ariia-git / ca.md
Created January 22, 2018 17:44 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@ariia-git
ariia-git / chatServer.js
Created May 31, 2018 07:17 — forked from creationix/chatServer.js
A simple TCP based chat server written in node.js
// Load the TCP Library
net = require('net');
// Keep track of the chat clients
var clients = [];
// Start a TCP Server
net.createServer(function (socket) {
// Identify this client
@ariia-git
ariia-git / README.md
Created July 3, 2018 23:44 — forked from simenbrekken/README.md
Super simple Backbone + Express + MongoDB REST backend application

Requirements:

If you're on OSX you're probably best off using Homebrew to install this stuff:

$ brew install node mongodb

Usage:

@ariia-git
ariia-git / ddns-api.php
Created May 31, 2020 19:33 — forked from fredsted/ddns-api.php
Virtualmin Dynamic DNS (DDNS) server
<?php
// This script receives DDNS updates via HTTP
// example: http://server/ddns-api.php?name=home = updates home.domain.com to IP of requester
define('DDNS_DATA_FILE', '/home/ddns/ddns.json');
define('DDNS_DOMAIN', 'example.com');
header("Content-type: text/plain");
@ariia-git
ariia-git / ffmpeg.md
Created October 13, 2021 21:49 — forked from protrolium/ffmpeg.md
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with: