Skip to content

Instantly share code, notes, and snippets.

@lucasff
lucasff / dumpoverssh.sh
Created October 10, 2015 18:32 — forked from kirkegaard/dumpoverssh.sh
pipe a mysql dump through gzip and send it over ssh
mysqldump -u MYSQL_USERNAME -p YOUR_DATABASE | gzip -c | ssh USERNAME@YOUR_TO_HOST 'cat > ~/dump.sql.gz'
@lucasff
lucasff / javascript.js
Created October 12, 2014 06:43
Riddle Animate
var parent, ink, d, x, y;
$(".riddle-animate").click(function(e){
parent = $(this).parent();
//create .ink element if it doesn't exist
if(parent.find(".ink").length == 0)
parent.prepend("<span class='ink'></span>");
ink = parent.find(".ink");
//incase of quick double clicks stop the previous animation
ink.removeClass("animate");
@lucasff
lucasff / index.html
Created August 27, 2014 21:57
Welcome page ISPConfig
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Welcome!</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="shortcut icon" href="/favicon.ico" />
<meta name="robots" content="noindex" />
<style type="text/css"><!--
@lucasff
lucasff / .htaccess
Created August 27, 2014 19:10
monster .htaccess
# Apache configuration file
# httpd.apache.org/docs/2.2/mod/quickreference.html
# Note .htaccess files are an overhead, this logic should be in your Apache
# config if possible: httpd.apache.org/docs/2.2/howto/htaccess.html
# Techniques in here adapted from all over, including:
# Kroc Camen: camendesign.com/.htaccess
# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
# Sample .htaccess file of CMS MODx: modxcms.com
@lucasff
lucasff / db-error.php
Last active August 29, 2015 14:05
Perishable Press WordPress database error
<?php // custom WordPress database error page tutorial @ digwp.com
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 3600'); // 1 hour = 3600 seconds
mail("spamless@domain.tld", "Database Error", "There is a problem with teh database!", "From: Montgomery Scott");
?>
<!DOCTYPE HTML>
<html dir="ltr" lang="en-US">
@lucasff
lucasff / simple.dns
Last active August 29, 2015 14:04
cPanel custom defaults
; cPanel %cpversion%
; Zone file for %domain%
$TTL %ttl%
@ %nsttl% IN SOA %nameserver%. %rpemail%. (
%serial% ; serial, todays date+todays
3600 ; refresh, seconds
600 ; retry, seconds
1209600 ; expire, seconds
3600 ; minimum, seconds
)
@lucasff
lucasff / default.html
Last active August 29, 2015 14:04
cPanel defaults
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Default Web Site Page</title>
<style type="text/css">
body {font-family:arial;margin:0;padding:0;background:url(/img-sys/bg.jpg) repeat-x #dff4fe;color:#6f6f6f;font-size:12px;}
a {color:#0075a9;}
* {margin:0;padding:0;}
h1 {background:url(/img-sys/header.jpg) no-repeat; height:83px;text-indent:-9999px;}
@lucasff
lucasff / cpanel-amazon-2.sh
Created July 29, 2014 19:20
cPanel on Amazon IP Update
for i in `cat /etc/trueuserdomains | cut -d: -f1`
do
/usr/local/cpanel/bin/swapip OLDIP NEWIP $i;
done;
@lucasff
lucasff / change_charset.php
Created July 29, 2014 19:18
Change charset of MySQL
<?php
function MysqlError()
{
if (mysql_errno())
{
echo "<b>Mysql Error: " . mysql_error() . "</b>\n";
}
}
@lucasff
lucasff / add_prefix_sql.sh
Last active August 29, 2015 14:04
Add a prefix on tables of a SQL dump
#!/bin/sh
#
# Simple script for setting table prefixes in SQL-dump
if [ $# != 2 ]; then
cat >&2 << EOH
This is Drupal database prefixer.
Usage:
$0 prefix original_db.sql > prefixed_db.sql
- all tables will be prefixed with 'prefix'
EOH