Skip to content

Instantly share code, notes, and snippets.

XCode

  • Install XCode from App Store.
  • Open XCode and agree to terms and conditions.

XCode CLI Tools

  • xcode-select --install

Install Homebrew

1. add-apt-repository ppa:ubuntu-toolchain-r/test
2. apt-get update
3. apt-get upgrade
4. apt-get dist-upgrade
5. apt-get install php7.0-odbc
6. cd /usr/src
7. wget https://download.microsoft.com/download/2/E/5/2E58F097-805C-4AB8-9FC6-71288AB4409D/msodbcsql-13.0.0.0.tar.gz
8. tar zxvf msodbcsql-13.0.0.0.tar.gz && cd msodbcsql-13.0.0.0
9. sudo ./build_dm.sh --libdir=/usr/lib/x86_64-linux-gnu --accept-warning
user www-data;
worker_processes 8;
pid /var/run/nginx.pid;
worker_rlimit_nofile 10240;
events {
worker_connections 4096;
multi_accept on;
use epoll;
}
@boynoiz
boynoiz / dump.sh
Last active September 18, 2017 07:48 — forked from andsens/dump.sh
Backup all MySQL databases into separate files
#!/bin/sh
## backup each mysql db into a different file, rather than one big file
## as with --all-databases. This will make restores easier.
## To backup a single database simply add the db name as a parameter (or multiple dbs)
## Putting the script in /var/backups/mysql seems sensible... on a debian machine that is
## Create the user and directories
# mkdir -p /var/backups/mysql/databases
# useradd --home-dir /var/backups/mysql --gid backup --no-create-home mysql-backup
## Remember to make the script executable, and unreadable by others
@boynoiz
boynoiz / Dockerfile
Created June 5, 2017 05:20
This is a part of PDO MSSQL Driver setup in docker
..........
# Add PHP MSSQL Driver Extension
RUN curl ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.1.tar.gz --create-dirs -o /usr/src/phpmssql/unixODBC-2.3.1.tar.gz
RUN tar -zxf /usr/src/phpmssql/unixODBC-2.3.1.tar.gz -C /usr/src/phpmssql/
RUN sudo -i export CPPFLAGS="-DSIZEOF_LONG_INT=8"
RUN echo "Configuring the unixODBC 2.3.1 Driver Manager"
RUN cd /usr/src/phpmssql/unixODBC-2.3.1 && ./configure --prefix=/usr --libdir=/usr/lib64 --sysconfdir=/etc --disable-gui --disable-drivers --enable-iconv --with-iconv-char-enc=UTF8 --with-iconv-ucode-enc=UTF16LE
RUN echo "Building and Installing the unixODBC 2.3.1 Driver Manager"
RUN cd /usr/src/phpmssql/unixODBC-2.3.1 && sudo make && sudo make install
@boynoiz
boynoiz / Dockerfile
Created June 25, 2017 11:22
ChromeDriver for Laravel Dusk in Docker #memo
# Install ChromeDriver for Laravel Dusk testing
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y libxpm4 libxrender1 libgtk2.0-0 libnss3 libgconf-2-4
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y chromium
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y xvfb gtk2-engines-pixbuf
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y xfonts-cyrillic xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable
ADD conf/chromium/xvfb-chromium /usr/bin/xvfb-chromium
RUN ln -s /usr/bin/xvfb-chromium /usr/bin/google-chrome \
&& chmod +x /usr/bin/google-chrome \
&& ln -s /usr/bin/xvfb-chromium /usr/bin/chromium-browser \
&& chmod +x /usr/bin/chromium-browser
const path = require('path');
const webpack = require('webpack');
const {mix} = require('laravel-mix');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
mix.config.postCss = require('./postcss.config').plugins;
mix.webpackConfig({
output: {
@boynoiz
boynoiz / UserTable.vue
Last active April 29, 2018 08:37
My User DataTable Snippet (BoostrapVue + VueJS + Vee-validate + Ziggy + Axios on Top Laravel API)
<template>
<!-- Main table element -->
<div class="main-content">
<div class="card">
<header class="card-header">
<h4 class="card-title">
<strong>User</strong> List
</h4>
<div class="card-header-actions">
<div class="btn-group btn-group-sm">
{
"env": {
"development" : {
"presets": [
["env", {
"targets": {
"browsers": ["last 2 versions", "> 5% in BE"],
"uglify": false
},
"modules": false
#!/bin/sh
ps -ylC apache2 --sort:rss | awk '{ s += $8; } END { print "Average Size:", s/(NR-1)/1024, "MB,", NR-1, "Processes, Total usage:", (s/(NR-1)/1024)*(NR-1), "MB, Max Servers:", 6500/(s/(NR-1)/1024) }'