Skip to content

Instantly share code, notes, and snippets.

@sixone74
sixone74 / .htaccess
Created October 1, 2010 20:38
301 redirect with match for htaccess
RedirectMatch 301 ^.*$ http://www.example.com/
@sixone74
sixone74 / .sync_things.yaml
Created November 15, 2011 08:57 — forked from awalker/sync_things.rb
Simple Ruby script to sync Basecamp and Things to-dos.
---
url: yoursubdomain.basecamphq.com
username: your_api_token
password: X
current_user: your_current_user_id (pull it out of your edit URL)
basecamp_project: your_project_id (in URL)
@sixone74
sixone74 / jquery.plugin.js
Created March 19, 2012 18:41
jQuery Boilerplate for plugins
// keep all your code in a closure
(function($)
{
// provide default settings
var defaultSettings = {
position : 'mouse',
color : 'black'
};
// name your plugin - try to make it unique
@sixone74
sixone74 / .htaccess
Created September 9, 2014 01:06
Perishable Press 5G Blacklist
# 5G BLACKLIST/FIREWALL (2013)
# @ http://perishablepress.com/5g-blacklist-2013/
# 5G:[QUERY STRINGS]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} (\"|%22).*(<|>|%3) [NC,OR]
RewriteCond %{QUERY_STRING} (javascript:).*(\;) [NC,OR]
RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3) [NC,OR]
RewriteCond %{QUERY_STRING} (\\|\.\./|`|=\'$|=%27$) [NC,OR]
@sixone74
sixone74 / fullbackup.php
Created October 9, 2014 08:48
cPanel Backup Cronjob
Using the script* provided below you will be able to make automatic backup of your hosting account (domains and MySQL databases). This backup script includes SSL support. This is not necessary if you run the script on the server for which you are generating the backup; but the SSL support could be important if you are running the script somewhere else to connect to your cPanel hosting account.
<?php
// PHP script to allow periodic cPanel backups automatically, optionally to a remote FTP server.
// This script contains passwords. It is important to keep access to this file secure (we would ask you to place it in your home directory, not public_html)
// You need create 'backups' folder in your home directory ( or any other folder that you would like to store your backups in ).
var gr = new GlideRecord('u_focus_group');
var strQuery = 'u_expiration>=javascript:gs.beginningOfToday()^u_active=true';
gr.addEncodedQuery(strQuery);
gr.query();
while (gr.next()) {
// Reset user profile and password
var gruser = new GlideRecord('sys_user');
gruser.get(gr.u_user);