This file contains 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 | |
a=0 | |
while read line | |
do a=$(($a+1)); | |
echo $line; | |
mkdir $line; | |
cd $line; | |
ncftpget -u USER -p PASSWORD -R -d stdout -t 300 "ftp://[HOST]/$line" | |
cd ".."; | |
done < "../dir-list" |
This file contains 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
//Matches [email protected] | |
preg_match('/^[^@]+@[a-zA-Z0-9._-]+\.[a-zA-Z]+$/', $_POST['email']) |
This file contains 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
autoload -U colors && colors | |
PS1="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% " |
This file contains 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
alias la="ls -a" | |
alias ll="ls -l" | |
alias lal="ls -al" | |
bindkey '^[[1;5C' emacs-forward-word | |
bindkey '^[[1;5D' emacs-backward-word | |
alias pbcopy='xsel --clipboard --input' | |
alias pbpaste='xsel --clipboard --output' |
This file contains 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
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES | |
ON databasename.* | |
TO 'username'@'localhost' IDENTIFIED BY 'password'; |
This file contains 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
Copy database and schema | |
--- | |
mysqldump -u [user] -p[password] -h localhost --databases [databases] -Ccqf --no-data | mysql -u [user] -p -h [host] -P 3306 | |
Copy data | |
--- | |
mysqldump -u [user] -p[password] -h localhost --databases [databases] -Ccqf --no-create-db --no-create-info | mysql -u [user] -p -h [host] -P 3306 |
This file contains 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
127.0.0.1 localhost.localdomain localhost | |
::1 [hostnane] localhost6.localdomain6 localhost6 | |
127.0.1.1 [hostname] | |
# The following lines are desirable for IPv6 capable hosts | |
::1 localhost ip6-localhost ip6-loopback | |
fe00::0 ip6-localnet | |
ff00::0 ip6-mcastprefix | |
ff02::1 ip6-allnodes | |
ff02::2 ip6-allrouters |
This file contains 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/sh | |
if [ "$(id -u)" -ne "0" ] ; then | |
echo "This script must be run as root" | |
else | |
if [ -z "$2" ] ; then | |
echo Usage ./create-vhost.sh [full path to site root directory] [url of vhost without http://] | |
exit 1; | |
else | |
DIRECTORY=$1; |
This file contains 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 { | |
listen 81; | |
server_name | |
[www.example.com] | |
[example.com] | |
; | |
rewrite ^(.*) https://[www.example.com]$1 permanent; | |
} | |
server { |
This file contains 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
chkconfig sphinx off | |
chkconfig sphinx on |
OlderNewer