Skip to content

Instantly share code, notes, and snippets.

View Oxicode's full-sized avatar

Christian QH ✔ Oxicode

View GitHub Profile
@Oxicode
Oxicode / README.md
Created March 1, 2017 21:35 — forked from brunogaspar/README.md
Install wkhtmltopdf on Ubuntu 14.04 64-bit

Install wkhtmltopdf on Ubuntu

This was tested on:

  • Ubuntu 14.04 x64
  • Ubuntu 16.04 x64

Step 1

Install the xvfb server by running

@Oxicode
Oxicode / migration.sh
Last active September 15, 2016 15:15 — forked from briantissue/gist:1c8b15c80d472c41ffa6
Migrate Linux UIDs and GIDS to new box excluded system IDs
#!/bin/bash
#This shell script is moving uids and gids to new server without grabbing the system accounts
#The one caveat with this script is confirming the UID start limit and upper limit for your distro
#This can be confirmed by checking the /etc/libuser.conf it is denoted there in RHEL distros
#This script is to be ran from the /tmp directory as denoted in BASE
#This script is valid for 6.5 RHEL and down as is. Change UGIDLIMIT to 1000 for v7.0
#Create directory for migration files
BASE=/tmp
if [ -d ${BASE}/move ]
tail -fn0 /var/log/auth.log | \
while read line ; do
echo "$line" | grep "password check failed for user"
if [ $? = 0 ]
then
echo "Wrong Login Attempt" | mail -s "Login Password Wrong - GigoLinux" mail@gmail.com
fi
done
@Oxicode
Oxicode / README-Template.md
Created June 13, 2016 17:38 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisities

@Oxicode
Oxicode / README.md
Created June 13, 2016 17:38 — forked from nickmoorman/README.md
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

<?php
/*
Increase or decrease value in CakePHP with little footprint.
Add this to your AppModel.
Usage:
(in Controller)
$this->Model->increase('field_name', 1);
@Oxicode
Oxicode / gulpfile.js
Created May 9, 2016 22:02 — forked from csrui/gulpfile.js
Generic gulpfile for CakePHP apps. Compiles and minifies sass. Minifies and lints javascript. Generates documentation with yuidoc
var gulp = require('gulp');
// Include Our Plugins
var jshint = require('gulp-jshint');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var minifyCSS = require('gulp-minify-css');
var rename = require('gulp-rename');
var yuidoc = require("gulp-yuidoc");
.col-ms-1,
.col-ms-2,
.col-ms-3,
.col-ms-4,
.col-ms-5,
.col-ms-6,
.col-ms-7,
.col-ms-8,
.col-ms-9,
.col-ms-10,
public function afterFilter(){
parent::afterFilter();
if (class_exists('ConnectionManager') && class_exists('ChromePhp') && Configure::read('debug') > 1) :
$logs = ConnectionManager::getDataSource('default');
$this->Oxicode->logs_console($this->request->here, array_reverse($logs->getLog()));
endif;
}
#!/bin/bash
echo -e "\nbenchmark.sh -n<number of requests> -c<number of concurrency> <URL1> <URL2> ..."
echo -e "\nEx: benchmark.sh -n100 -c10 http://www.google.com/ http://www.bing.com/ \n"
## Gnuplot settings
echo "set terminal png
set output 'benchmark_${1}_${2}.png'
set title 'Benchmark: ${1} ${2}'