This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo vi /etc/httpd/conf/httpd.conf | |
Listen 8080 | |
NameVirtualHost *:8080 | |
$ sudo vi /etc/httpd/conf.d/sites-enabled/*.conf | |
<VirtualHost *:8080> | |
// https://www.varnish-cache.org/installation/redhat | |
$ sudo rpm --nosignature -i http://repo.varnish-cache.org/redhat/varnish-3.0/el6/noarch/varnish-release-3.0-1.el6.noarch.rpm | |
$ sudo yum check-update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// quick simple way to detect mobile device | |
function is_touch_device() { | |
return !!('ontouchstart' in window) // works on most browsers | |
|| !!('onmsgesturechange' in window); // works on ie10 | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
// Apply once | |
Drupal.behaviors.customOnce = { | |
attach: function (context, settings) { | |
} | |
}; | |
}(jQuery)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getCookie(name) { | |
name = name.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); | |
var regex = new RegExp('(?:^|;)\\s?' + name + '=(.*?)(?:;|$)','i'), | |
match = document.cookie.match(regex); | |
return match && unescape(match[1]); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
### BEGIN INIT INFO | |
# Provides: memcached | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start memcached daemon |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fail2Ban configuration file | |
# | |
# Author: Charles Chou | |
# Modified: Norman Yee | |
# fix original cloudflare-blacklist.conf | |
# $Revision$ | |
# | |
[Definition] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install "pecl" via php-pear | |
$ sudo apt-get install -y php-pear | |
# Install build dependencies | |
$ sudo apt-get install -y build-essential php5-dev | |
# Install Zend OpCache | |
$ sudo pecl install zendopcache-7.0.3 | |
# 12.04 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# swapused.sh | |
# -- Get current swap usage for all running processes | |
# -- | |
# -- rev.0.4, 2014-04-11, Chin Kiong Ng - sort kb asc | |
# -- rev.0.3, 2012-09-03, Jan Smid - alignment and intendation, sorting | |
# -- rev.0.2, 2012-08-09, Mikko Rantalainen - pipe the output to "sort -nk3" to get sorted output | |
# -- rev.0.1, 2011-05-27, Erik Ljungstrom - initial version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Use this to identify possible table needs to be updated | |
// SELECT DISTINCT TABLE_NAME | |
// FROM INFORMATION_SCHEMA.COLUMNS | |
// WHERE COLUMN_NAME IN ('language') | |
// AND TABLE_SCHEMA='<YOUR_DATABASE>'; | |
// include other custom fields | |
$tables = array( |