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
| DELIMITER // | |
| DROP PROCEDURE IF EXISTS `auto_partition_manager`; | |
| CREATE DEFINER = `root` @`localhost` PROCEDURE `auto_partition_manager`( | |
| in partition_frequency varchar(100), | |
| in db_schema varchar(100), | |
| in input_table_name varchar(100), | |
| in partition_column varchar(100) | |
| ) BEGIN -- Author - Code Monk |
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
| #!/usr/bin/python | |
| import requests | |
| import re | |
| url = 'https://www.facebook.com/zuck' | |
| idre = re.compile('"entity_id":"([0-9]+)"') | |
| page = requests.get(url) | |
| print idre.findall(page.content) |
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
| [mergetool] | |
| prompt = false | |
| keepBackup = false | |
| keepTemporaries = false | |
| [merge] | |
| tool = winmerge | |
| [mergetool "winmerge"] | |
| name = WinMerge |
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
| server { | |
| server_name cdn.example.com; | |
| listen 80; | |
| access_log /var/log/nginx/cdn.example.com-access.log; | |
| error_log /var/log/nginx/cdn.example.com-error.log info; | |
| add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; | |
| add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"; |
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
| # | |
| # /etc/monit.d/beanstalkd | |
| # | |
| # CentOS notes: | |
| # CentOS beanstalkd doesn't have pid file. | |
| # in /etc/init.d/beanstalkd modify the daemonize line with a -p /var/run/beanstalk.d | |
| # daemon /usr/sbin/daemonize -p /var/run/beanstalkd.pid -u ${BEANSTALKD_USER} $exec $options | |
| # | |
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
| ### IMPROVE SYSTEM MEMORY MANAGEMENT ### | |
| # Increase size of file handles and inode cache | |
| fs.file-max = 2097152 | |
| # Do less swapping | |
| vm.swappiness=10 | |
| vm.vfs_cache_pressure = 50 | |
| vm.dirty_ratio = 60 | |
| vm.dirty_background_ratio = 2 |
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
| cd /var/www/mautic | |
| mkdir app/spool/ | |
| find . -type d -exec chmod 755 {} \; | |
| find . -type f -exec chmod 644 {} \; | |
| chmod -R g+w app/cache/ | |
| chmod -R g+w app/logs/ | |
| chmod -R g+w app/config/ | |
| chmod -R g+w media/files/ | |
| chmod -R g+w media/images/ | |
| chmod -R g+w translations/ |
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
| #!/usr/bin/env bash | |
| if [[ $UID != 0 ]]; | |
| then | |
| echo "Please run this script with sudo or as root:" | |
| echo | |
| echo "sudo $0 $*" | |
| exit 1 || return 1 | |
| fi |
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
| rem execute as an Administrator | |
| rem based on http://www.windowsdevcenter.com/pub/a/windows/2005/02/08/NTFS_Hacks.html | |
| ram based on https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-2000-server/cc938961(v=technet.10) | |
| rem http://archive.oreilly.com/cs/user/view/cs_msg/95219 (some installers need 8dot3 filenames) | |
| rem disable 8dot3 filenames | |
| ram Warning: Some applications such as incremental backup utilities rely on this update information and do not function correctly without it. | |
| fsutil behavior set disable8dot3 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
| # Paste this entire script into NuGet Package Manager Console with an open solution in Visual Studio. | |
| # This script will locate projects with duplicate dependencies in packages.config and remove them. | |
| Function Get-Duplicate { | |
| param([Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true)]$array, [switch]$count) | |
| begin { | |
| $hash = @{} | |
| } | |
| process { | |
| $array | %{ $hash[$_] = $hash[$_] + 1 } |