Skip to content

Instantly share code, notes, and snippets.

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

Vagrant.configure("2") do |config|
config.vm.box = "mwrock/Windows2016"
config.vm.hostname = "host-win"
winClientIP = "192.168.99.103"
config.vm.network "private_network", ip: winClientIP
end
@031nna
031nna / maintenance-page.php
Last active July 24, 2019 03:06
maintenance page
<?php
$message = '<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
@031nna
031nna / ngrok-installation.md
Created January 16, 2019 10:58 — forked from wosephjeber/ngrok-installation.md
Installing ngrok on Mac

#Installing ngrok on OSX

  1. Download ngrok
  2. Unzip it to your Applications directory
  3. Create a symlink (instructions below)

Creating a symlink to ngrok

Run the following two commands in Terminal to create the symlink.

# cd into your local bin directory
@031nna
031nna / gist:8a0ef7cc7483701621939bc32d14af5e
Created August 11, 2018 01:56 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.

Using self-signed certificate.

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
@031nna
031nna / setup_mailcatcher.sh
Last active July 21, 2018 02:32 — forked from shark0der/setup_mailcatcher.sh
Mailcatcher installation script for Ubuntu 16.04 (14.04 commands commented out)
#!/bin/bash
# Install dependencies
# older ubuntus
#apt-get install build-essential libsqlite3-dev ruby1.9.1-dev
# xenial
sudo apt install build-essential libsqlite3-dev ruby-dev
# Install the gem
sudo gem install mailcatcher --no-ri --no-rdoc
@031nna
031nna / countries.php
Created June 14, 2018 19:32 — forked from JeffreyWay/countries.php
Country Names + Codes
[
"United States" => "us",
"Afghanistan" => "af",
"Albania" => "al",
"Algeria" => "dz",
"American Samoa" => "as",
"Andorra" => "ad",
"Angola" => "ad",
"Anguilla" => "ai",
"Antarctica" => "aq",
@031nna
031nna / install.sh
Created May 29, 2018 04:06 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
@031nna
031nna / atom-editor-offscreen-fix-windows.md
Created May 14, 2018 14:34
Fix atom editor displaying offscreen in windows
Solution:

I just found a solution to my problem. The atom window was rendered outside any screen >coordinates. I did the following steps to solve it:

Alt + Tab to choose the atom window
Alt + Space to open the context menu
Press 'm' to select move
Press any arrow key once
@031nna
031nna / mysql.md
Created May 11, 2018 19:25
mysql commands

Prompt for password:

mysql -u <username> -p <databasename> < <filename.sql> Enter password directly (not secure):

mysql -u <username> -p<PlainPassword> <databasename> < <filename.sql> Example:

mysql -u root -p wp_users &lt; wp_users.sql