Skip to content

Instantly share code, notes, and snippets.

View dimitardanailov's full-sized avatar

Dimitar Danailov (a.k.a Mitco) dimitardanailov

View GitHub Profile
@dimitardanailov
dimitardanailov / Vagrant
Last active March 9, 2016 15:27
Vagrant configuration for yii framework (CentOS)
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@dimitardanailov
dimitardanailov / rails.md
Created March 7, 2016 12:50
Rails tips and tricks
# Install pg gem
# Source http://excid3.com/blog/installing-postgresql-and-pg-gem-on-mac-osx/
PATH=$PATH:/Library/PostgreSQL/9.5/bin/ gem install pg

Database

# Update database (-c is context name)
dnx ef database update -c EntityFramework.Models.CycleSalesContext
# Add a new migration (-c is context name)
dnx ef migrations add Features -c EntityFramework.Models.CycleSalesContext
@dimitardanailov
dimitardanailov / react-materials.md
Last active February 26, 2016 17:26
Materials for react.js
# Start python
PYSPARK_DRIVER_PYTHON=ipython pyspark
# Verify input data
hdfs dfs -ls input/
# Read shows files
show_views_file = sc.textFile("input/join2_gennum?.txt")
# view first two lines
@dimitardanailov
dimitardanailov / mongo-commands.md
Last active December 8, 2022 18:38
MongoDB - Commands
# Get documents, where writters are Joel Coen and Ethan Coen.
db.movieDetails.find({ "writters" : ["Joel Coen", "Ethan Coen"] }).count()
# Get documents, where Jeff Bridges is playing leading role.
> db.movieDetails.find({ "actors.0": "Jeff Bridges" }).pretty()
@dimitardanailov
dimitardanailov / Splunk - Coursera.md
Last active January 8, 2016 07:00
Splunk Example commands
sourcetype=access_* status=200 action=purchase [search
sourcetype=access_* status=200 action=purchase | top limit=3 clientip |
table clientip] | stats COUNT AS "Total Purchased", dc(productId) as "Total Products", values(productName) as "Product Names" by clientip | 
rename clientip AS "VIP Customers"
@dimitardanailov
dimitardanailov / centos_install_git.sh
Last active November 19, 2015 14:32
CentOS: Git from Source
# Source
# https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
# Step 1
sudo yum -y install curl-devel expat-devel gettext-devel openssl-devel perl-devel zlib-devel
# Step 2 _ Enable docbook2X
# In order to be able to add the documentation in various formats (doc, html, info),
# these additional dependencies are required
# https://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F
@dimitardanailov
dimitardanailov / centos_install_nginx.sh
Last active February 23, 2019 09:04
CentOS: How To Compile Nginx from Source
# Source: https://www.digitalocean.com/community/tutorials/how-to-compile-nginx-from-source-on-a-centos-6-4-x64-vps
# Step 1
# We have few pre-requisites to be installed to compile which include development libraries along with source code compilers.
yum -y install gcc gcc-c++ make zlib-devel pcre-devel openssl-devel
# Step 2
mkdir -p ~/src && cd ~/src
# Step 3