Skip to content

Instantly share code, notes, and snippets.

@lysender
lysender / sha256-self-signed-cert.sh
Created August 28, 2015 09:17
Create a sha256 self-signed certificate
openssl req -x509 -nodes -sha256 -days 365 -newkey rsa:2048 -keyout server.key -out server.crt
[vagrant@localhost path2dx]$ php testuniqid.php
ECL00002-7f01-547c7274-5002
ECL00002-0801-547c7274-5002
ECL00002-0c65-547c7274-5002
ECL00002-f4fb-547c7274-5002
ECL00002-fafa-547c7274-5002
[vagrant@localhost path2dx]$
NameVirtualHost *
<VirtualHost *>
ServerName owncloud.mydomain.com
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<?php
class SomeUniqueId {
protected $strId = '';
public function __construct($ip, $timestamp = null)
{
$ids = array(
$this->generateLocationId(),
@lysender
lysender / .vimrc
Created January 20, 2015 08:19
My VIM config
set history=100
set undolevels=50
syntax enable
set backup
set backupdir=$HOME/.vim/backup
set directory=$HOME/.vim/temp
set nonumber
set tabstop=4
set softtabstop=4
set shiftwidth=4
@lysender
lysender / .bash_profile
Created January 20, 2015 08:22
My Bash Profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/.local/bin:$HOME/bin
@lysender
lysender / .bashrc
Created January 20, 2015 08:25
My Bash RC
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
@lysender
lysender / mongo-init.sh
Last active August 29, 2015 14:16
Custom Script for Running of Mongo DB
#!/bin/bash
#
# chkconfig: - 80 15
# description: mongodb
start() {
mongod --replSet myawesomedb --dbpath=/home/lysender/.local/mongo/db --fork --logpath /home/lysender/.local/mongo/db.log --logappend --nojournal --smallfiles
#mongod --replSet myawesomedb --dbpath=/home/lysender/.local/mongo/db2 --fork --logpath /home/lysender/.local/mongo/db2.log --logappend --port 28017 --nojournal --smallfiles
#mongod --replSet myawesomedb --dbpath=/home/lysender/.local/mongo/db3 --fork --logpath /home/lysender/.local/mongo/db3.log --logappend --port 29017 --nojournal --smallfiles
echo "Starting MongoDB";
@lysender
lysender / create-mongo-replica-set
Created February 25, 2015 08:19
Create Mongo DB Replica Set
# login to mongo and paste below config
> rsconf={"_id" : "myawesomedb","version" : 1,"members" : [{"_id" : 1, "host" : "localhost:27017"}]}
> rs.initiate(rsconf);
> rs.status();
@lysender
lysender / docker-noob-commads.txt
Last active August 29, 2015 14:16
Docker noob commands
# Build an image based on docker file (--rm to delete intermediate containers)
docker build --rm -t mmage/app .
# Run the container (create a name for it as well)
# run as daemon, map 8080 to containers 80 port
docker run --name=mmage_app -d -p 8080:80 mmage/app
# Stop a named container
docker stop mmage_app