Skip to content

Instantly share code, notes, and snippets.

<?php
/**
*
* Origin: http://forums.steampowered.com/forums/showthread.php?t=1430511
*
* @package Steam Community API
* @copyright (c) 2010 ichimonai.com
* @license http://opensource.org/licenses/mit-license.php The MIT License
*
@samjaninf
samjaninf / cors-nginx.conf
Created March 4, 2016 08:42 — forked from michiel/cors-nginx.conf
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@samjaninf
samjaninf / Deploying on Amazon AWS (Free-Tier) with EC2, RDS & S3.md
Created November 2, 2016 20:29 — forked from pcm211/Deploying on Amazon AWS (Free-Tier) with EC2, RDS & S3.md
This Is a step by step way to deploy Sharetribe to Amazon AWS Free Tier in Development Mode (Not Production)

Prerequisites

  1. Have an AWS Account
  2. Spin up an EC2 Instance of Ubuntu Server and Make sure that your instance's security groups allow incoming connections on TCP ports 22 and 3000
  3. Use an Elastic IP to bind your Instance to it --- You would not be paying for this -- Till the time the EC2 Instance is running
  4. Add the IP Allocated to your A Record --- with your registrar
  5. Have a SSH Connection to your EC2 Instance with the Key Pairs
  6. Connect to the EC2 Instance

STEP 1 -- Setting up the Playground

@samjaninf
samjaninf / back-res.sh
Created June 3, 2017 19:18 — forked from zekus/back-res.sh
a backup script for ispconfig-3
#!/bin/bash
version="0.9.6 from 2014-02-04"
# Always download the latest version here: http://www.eurosistems.ro/back-res
# Thanks or questions: http://www.howtoforge.com/forums/showthread.php?t=41609
#
# CHANGELOG:
# -----------------------------------------------------------------------------
# version 0.9.6 - 2014-02-04 (by Yavuz Aydin - Vrij Media)
# --------------------------
# - Changed mysql import routine to create database if it doesn't exist
@samjaninf
samjaninf / .htaccess
Created August 25, 2017 07:10 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@samjaninf
samjaninf / zimbra-letsencrypt-renew.md
Created September 18, 2017 17:05 — forked from ugurerkan/zimbra-letsencrypt-renew.md
Zimbra 8.6.0 Letsencrypt SSL renew walkthrough.
@samjaninf
samjaninf / nginx.conf
Created February 14, 2018 06:58 — forked from nrollr/nginx.conf
NGINX config for SSL with Let's Encrypt certs
# Advanced config for NGINX
server_tokens off;
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options nosniff;
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
@samjaninf
samjaninf / 00README.md
Created February 20, 2018 06:48 — forked from mwpastore/00README.md
Lightning Fast WordPress: Caddy+Varnish+PHP-FPM

README

This gist assumes you are migrating an existing site for www.example.com — ideally WordPress — to a new server — ideally Ubuntu Server 16.04 LTS — and wish to enable HTTP/2 (backwards compatibile with HTTP/1.1) with always-on HTTPS, caching, compression, and more. Although these instructions are geared towards WordPress, they should be trivially extensible to other PHP frameworks, other FastCGI backends, and even non-FastCGI backends (using proxy in lieu of fastcgi in the terminal Caddyfile stanza).

Quickstart: Use your own naked and canonical domain names instead of example.com and www.example.com and customize the Caddyfile and VCL provided in this gist to your preferences!

These instructions target Varnish Cache 4.1, PHP-FPM 7.0, and Caddy 0.10. (I'm using MariaDB 10.1 as well, but that's not relevant to this guide.)

https://www.google.com/fusiontables/DataSource?docid=1qwHuS2zIBqK_xxTtg-j_loRHqCVpcld-a2Q6kM0#rows:id=1
Emergency Preparedness
Pioneering Wireless
Offbeat Internet
Application Software
@samjaninf
samjaninf / Blockchain.jl
Created August 16, 2018 17:33 — forked from TestSubjector/Blockchain.jl
A very basic implementation of a blockchain in Julia.
using SHA
"""
An individual block structure
"""
struct Block
index::Int
timestamp::DateTime
data::String
previous_hash::String