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
| <VirtualHost *:80> | |
| ServerAdmin webmaster@localhost | |
| ServerName site.lvh.me | |
| ServerAlias www.site.lvh.me | |
| DocumentRoot /var/www/site | |
| <Directory /var/www/site> | |
| Options Indexes FollowSymLinks MultiViews | |
| AllowOverride All | |
| Order allow,deny | |
| allow from all |
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
| en: | |
| hello: "Hello world" | |
| time: | |
| formats: | |
| date_only1: "%a, %m/%d/%Y" | |
| date: | |
| formats: | |
| date_only1: "%a, %m/%d/%Y" |
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
| window.ie = (function() { | |
| var undef, | |
| v = 3, | |
| htmlClass = document.documentElement.className, | |
| div = document.createElement('div'), | |
| all = div.getElementsByTagName('span'); | |
| do { | |
| div.innerHTML = '<!--[if gt IE ' + (++v) + ']><span></span><!endif]-->'; | |
| } while (all[0]); |
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 | |
| $in = file_get_contents('input.sql'); | |
| // change domain(s) | |
| $in = preg_replace('/old.example.com/', 'new.example.com', $in); | |
| $in = preg_replace('/older.example.com/', 'newer.example.com', $in); | |
| // recalculate string lengths in serialized arrays | |
| $out = preg_replace('/s:(\d+):\\\"(.*?)\\\";/e', "'s:'.strlen('$2').':\"$2\";'", $in); |
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
| SSH_ENV="$HOME/.ssh/environment" | |
| # start the ssh-agent | |
| function start_agent { | |
| echo "Initializing new SSH agent..." | |
| # spawn ssh-agent | |
| ssh-agent | sed 's/^echo/#echo/' > "$SSH_ENV" | |
| echo succeeded | |
| chmod 600 "$SSH_ENV" | |
| . "$SSH_ENV" > /dev/null |
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 | |
| function custom_url_rewrite_outbound(&$path, &$options, $original_path) { | |
| global $base_url; | |
| if (strstr($base_url, 'https')) { | |
| switch (true) { | |
| case ((bool) strstr($path, 'cart/checkout')): | |
| case ((bool) strstr($path, 'uc_js_util')): | |
| case ((bool) strstr($path, 'admin_menu')): | |
| $options['base_url'] = str_replace('http','https',$options['base_url']); | |
| break; |
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 | |
| # MAKE A BACKUP OF THE SITE! | |
| # change directory to webroot | |
| cd /var/www/hackedwordpresssite.com/html | |
| # Get a list of files that contain the string "god_mode_off" and save it to a file | |
| # command switches may differ depending on linux release | |
| find . -type f -iname "*.php" | xargs -I{} grep -il god_mode_off {} > bad.list |
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
| def strip_tags(text) | |
| return text.gsub(/<\/?[^>]*>/, "") | |
| end | |
| def text_trim(text, len, trail = '...') | |
| if len < text.size then | |
| text.scan(/.{1,#{len}} /) do |match| | |
| return match.rstrip + trail | |
| break | |
| end |
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
| " Add the map below to .vimrc as one long line. | |
| " Restart vim, open horribly formatted css, press F9 | |
| " Then gg=G to fix formatting | |
| " Win. | |
| map <F9> :%s/\n\+\s*//g<CR>:%s/:[ ]*/:/g<CR>:%s/}/}\r\r/g<CR>:%s/;/;\r\t/g<CR>:%s/[ ]*{/ {\r\t/g<CR>:%s/\(\t\)\?\/\*\(.*\)\*\//\1\/\*\r\1\2\r\1\*\/\r\1/ge<CR>:%s/\(\t\)\?\/\*/\1\/\*\r\1/ge<CR>:%s/\(\n\+\)\?\(\t\)\?\*\//\r\2\*\/\r\2\1\2/ge<CR>:%s/^\t}/}/g<CR>:%s/\t\([^:]\+\):/\t\1: /g<CR>:%s/[ ]*!important/ !important/ge<CR>:%s/\t\n//ge<CR>:%s/\n\{3,\}/\r\r/ge<CR>:%s/\(\n^$\)\{2,\}//ge<CR>:let err=0<CR>:while err == 0<CR>try<CR> %s/^\([^,\t]\+\),\([^$]\)/\1,\r\2/g<CR>catch /^Vim\%((\a\+)\)\=:E/<CR>endtry<CR>:endwhile<CR>gg=G<CR> | |
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
| wp-content/uploads/ | |
| wp-conten/files_mf/ | |
| stats/ | |
| wp-config.php | |
| sitemap.xml | |
| *.gz | |
| *.sql | |
| *.mysql | |
| *.zip |