Skip to content

Instantly share code, notes, and snippets.

@samjaninf
samjaninf / httpd_trace_log
Created October 11, 2017 16:16
httpd trace log
7f9c8bfeb000-7f9c8c1eb000 ---p 00060000 ca:01 4304415 /usr/lib64/libpcre.so.1.2.0
7f9c8c1eb000-7f9c8c1ec000 r--p 00060000 ca:01 4304415 /usr/lib64/libpcre.so.1.2.0
7f9c8c1ec000-7f9c8c1ed000 rw-p 00061000 ca:01 4304415 /usr/lib64/libpcre.so.1.2.0
7f9c8c1ed000-7f9c8c20e000 r-xp 00000000 ca:01 4271978 /usr/lib64/ld-2.17.so
7f9c8c223000-7f9c8c235000 rw-s 00000000 00:04 558417 /dev/zero (deleted)
7f9c8c377000-7f9c8c3f5000 rw-s 00000000 00:04 723009 /dev/zero (deleted)
7f9c8c3f5000-7f9c8c3f9000 r-xp 00000000 ca:01 4304377 /usr/lib64/libsystemd-daemon.so.0.0.12
7f9c8c3f9000-7f9c8c3fa000 ---p 00004000 ca:01 4304377 /usr/lib64/libsystemd-daemon.so.0.0.12
7f9c8c3fa000-7f9c8c3fb000 r--p 00004000 ca:01 4304377 /usr/lib64/libsystemd-daemon.so.0.0.12
7f9c8c3fb000-7f9c8c3fc000 rw-p 00005000 ca:01 4304377 /usr/lib64/libsystemd-daemon.so
@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.
So today I'm going to be a little different and talk about one technical aspect of my game [TinyKeep](http://tinykeep.com/), that is random procedural dungeon generation. It's pretty over-engineered, but hopefully will give anyone interested some ideas on generating dungeon layouts for their own games.
###The interactive demo can be found here: [Dungeon Generation Demo](http://tinykeep.com/dungen/)
####Here's how I do it, step by step:
1. First I set the number of cells I want to generate, say 150. This is an arbitrary amount really, but the higher the number the larger the dungeon and in general more complexity.
2. For each "cell" I spawn a Rectangle of random width and length within some radius. Again the radius doesn't matter too much, but it should probably be proportionate to the number of cells.
*Instead of using uniformly distributed random numbers (the default Math.random generator in most languages), I'm using [Park-Miller Normal Distribution](https://en.wikipedia.org/wiki/Normal_distribution). Th
@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/
#!/bin/bash
set -ex
echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d
echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99force-ipv4
rm -rf /var/lib/apt/lists/* preseed.txt
echo "postfix postfix/main_mailer_type string Internet site" > preseed.txt
#!/bin/sh
set -e
dir="$1"
if [ -z "$dir" ]; then
{
echo 'This script is for destroying old /var/lib/docker directories more safely than'
echo ' "rm -rf", which can cause data loss or other serious issues.'
echo
@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
oc delete daemonsets.extensions docker-registry
delete serviceaccount registry
delete clusterrolebinding registry-registry-role
delete all -l docker-registry=default
oadm registry --config=/etc/origin/master/admin.kubeconfig --service-account=registry
https://files.zimbra.com/downloads/8.7.6_GA/zcs-8.7.6_GA_1776.RHEL7_64.20170326144124.tgz
@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