Skip to content

Instantly share code, notes, and snippets.

@elivz
elivz / wordpress-w3tc-site.conf
Created March 20, 2011 18:06
Nginx configuration for WordPress with W3 Total Cache plugin. See http://elivz.com/blog/single/wordpress_with_w3tc_on_nginx/
server {
# Redirect yoursite.com to www.yoursite.com
server_name yoursite.com;
rewrite ^(.*) http://www.yoursite.com$1 permanent;
}
server {
# Tell nginx to handle requests for the www.yoursite.com domain
server_name www.yoursite.com;
@ziadoz
ziadoz / awesome-php.md
Last active July 13, 2024 05:29
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@valvallow
valvallow / csv2sql.scm
Last active April 6, 2022 17:11
convert csv to insert|update sql query string
#!/usr/local/bin/gosh
(use srfi-1)
(use text.csv)
(use file.util)
(use util.list)
(use gauche.parseopt)
(define (usage)
(print "Usage: csv2sql [options ...] <csv-file>")
@srbs
srbs / updateall.sh
Last active May 17, 2016 07:36
Update all git/svn/mercurial repositories in any child directory of this script
#! /bin/bash
#guarantee you are in the directory you are in (src: http://stackoverflow.com/a/246128)
cd -P "$(dirname "$0")"
# basically traverse down all directories until you run across a
# .git/.svn/.hg/.fslckout/CVS directory/file, then update/pull the directory (stop traversing)
#updaterepo <folder type found> <path name to display>
@srbs
srbs / od.sh
Created October 7, 2012 07:16
diff any file using opendiff (svn, git, mercurial, fossil)
# function for .bash-profile or .bashrc
# od <file> [<file2>]
# diff's the given file using opendiff based on the file's vcs
# supports svn, git, mercurial, fossil, & CVS
# can specify any path, checks are done where the file is
# when file2 is specified, fall back to default opendiff behavior
od()
{
#include "mysql_connection.h"
#include <cppconn/driver.h>
#include <cppconn/exception.h>
#include <cppconn/resultset.h>
#include <cppconn/statement.h>
#include <cppconn/prepared_statement.h>
#include <memory>
#include <fstream>
#include <vector>
#include <cstring>
@aido
aido / Polipo-adblocker.sh
Created June 12, 2013 18:01
Use wget and sed to update Polipo forbidden file from http://easylist-downloads.adblockplus.org/easylist.txt
#!/bin/bash +xv
declare WGET=/usr/bin/wget
declare SED=/bin/sed
declare INVOKE=/usr/sbin/invoke-rc.d
#declare TORIFY=/usr/bin/torify
#declare TORRESOLVE=/usr/bin/tor-resolve
declare -i EXIT_VALUE=0
@SeanTRobinson
SeanTRobinson / ConfluenceBackup.sh
Last active June 6, 2022 14:58
Backup Atlassian Jira and Confluence from the command line.
#!/bin/bash
USERNAME=<username>
PASSWORD=<password>
INSTANCE="<company>.atlassian.net"
LOCATION="./Backups/"
mkdir "Backups"
# Grabs cookies and generates the backup on the UI.
'''
Easy Mac
Copyright (2015) Sean Beck
Licensed under Creative Commons Attribution-ShareAlike 4.0 International
See: https://creativecommons.org/licenses/by-sa/4.0/
Easily change your MAC address on Linux using `ifconfig`
'''
#!/usr/bin/python2.7