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 | |
DB_USER="root" | |
DB_PASSWORD="yourdbrootpassword" | |
MAIL_NOTIFICATION="[email protected]" | |
BACKUP_FOLDER="/root/mysql_backup" | |
NUM_COPIES=7 | |
for db in $(mysql -u${DB_USER} -p${DB_PASSWORD} -e 'show databases;' | grep -Ev "^(Database|mysql|information_schema)$") | |
do |
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
<FilesMatch "\.(php|php5|php4|php3|pl|py|sh|cgi)$"> | |
order deny,allow | |
deny from all | |
</FilesMatch> |
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
<?php | |
putenv("HTTP_HOST=".@$_SERVER["HTTP_HOST"]); | |
putenv("SCRIPT_NAME=".@$_SERVER["SCRIPT_NAME"]); | |
putenv("SCRIPT_FILENAME=".@$_SERVER["SCRIPT_FILENAME"]); | |
putenv("DOCUMENT_ROOT=".@$_SERVER["DOCUMENT_ROOT"]); | |
putenv("REMOTE_ADDR=".@$_SERVER["REMOTE_ADDR"]); | |
?> |
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
<?php | |
function print_labels($files) | |
{ | |
$cmd = '/usr/bin/lpr -PDYMO_LabelWriter_450_Turbo -o PageSize=w102h252.1 -o PageRegion=w102h252.1 -o landscape -o page-left=10 -o page-top=10 -o page-right=0 -o page-bottom=0 -o Resolution=300dpi -o cupsDarkness=Normal -o scaling=100 '.$files; | |
$output = system($cmd, $ret); | |
if($ret!=0 || $output!='') | |
{ | |
return 'ERR ['.$ret.']: '.$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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Print this page example</title> | |
</head> | |
<body> | |
<h1>Print this page example</h1> | |
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras consequat pretium quam in commodo. Morbi non bibendum turpis, id sodales ipsum. Mauris fermentum eget dui ac suscipit. Vestibulum feugiat tempus neque sed accumsan. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras lacinia ac tellus quis suscipit. Nulla facilisi. Sed dapibus nibh sapien, eu lobortis dolor imperdiet sit amet. Vestibulum ut faucibus augue. Cras placerat nisi id dui suscipit, quis vehicula erat tincidunt. Quisque et felis eget dui congue ultricies vel in nunc. Praesent sollicitudin velit mi. Mauris justo magna, vehicula bibendum viverra at, aliquet vel lectus. Mauris adipiscing in nunc in pulvinar. Nullam metus nunc, facilisis nec rutrum sit amet, vehicula eu turpis. Praesent consectetur, lorem ac suscipit rutrum, ante felis mollis tellus, a viverra ipsum urna u |
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 | |
usage() | |
{ | |
cat << EOF >&2 | |
Usage: ${0} [options] | |
-m [pwd] : set mysql root password | |
-d [domain] : setup a domain for ngnix | |
-h : print usage | |
EOF |
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
<?php | |
/********************* START CONFIGURATION *********************/ | |
$DB_SRC_HOST='localhost'; | |
$DB_SRC_USER='root'; | |
$DB_SRC_PASS='password'; | |
$DB_SRC_NAME='database1'; | |
$DB_DST_HOST='localhost'; | |
$DB_DST_USER='root'; |
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
#!/usr/bin/env python2 | |
import Crypto.Cipher.DES as des | |
import Crypto.Cipher.DES3 as des3 | |
def mac_x919(key,data): | |
while len(data) % 8 != 0: | |
data += '\x00' | |
des_key1 = des.new(key[0:8],des.MODE_CBC) | |
des_key2 = des.new(key[0:8],des.MODE_ECB) |
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
#!/usr/bin/env python | |
import sys,pwd,os | |
pw = pwd.getpwnam(sys.argv[1]) | |
os.initgroups(sys.argv[1],pw.pw_gid) | |
env={"TERM":"xterm","USER":pw.pw_name,"HOME":pw.pw_dir,"SHELL":pw.pw_shell,"LOGNAME":pw.pw_name,"PATH":"/usr/bin:/bin:/opt/bin"}; | |
os.setgid(pw.pw_gid); | |
os.setuid(pw.pw_uid); | |
os.execve(sys.argv[2],[],env); |
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
#include <stdio.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <pwd.h> | |
int main(int argc, char* argv[]) | |
{ | |
if(argc != 3) | |
{ | |
printf("Usage: %s [USERNAME] [COMMAND]\n",argv[0]); |