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/python | |
import os | |
import sys | |
HOME_DIR=os.path.dirname(__file__) | |
sys.path.append(HOME_DIR) | |
os.chdir(HOME_DIR) | |
import json | |
from bottle import get, post, put, route, app, run, request, response, hook, error, abort | |
from libpoll import * |
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
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . index.html [L] |
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
var isobject = function(x){ | |
return Object.prototype.toString.call(x) === '[object Object]'; | |
}; | |
var getkeys = function(obj, prefix){ | |
var keys = Object.keys(obj); | |
prefix = prefix ? prefix + '.' : ''; | |
return keys.reduce(function(result, key){ | |
if(isobject(obj[key])){ | |
result = result.concat(getkeys(obj[key], prefix + key)); |
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
#USER FOR DATAPUMP | |
create pumpuser identified by password; | |
grant EXP_FULL_DATABASE to pumpuser; | |
grant DATAPUMP_EXP_FULL_DATABASE to pumpuser; | |
grant DATAPUMP_IMP_FULL_DATABASE to pumpuser; | |
alter user pumpuser quota unlimited on system; | |
create directory DPDIR as 'dirpath'; | |
grant all on directory DPDIR to pumpuser; | |
#EXPDP | |
expdp pumpuser/password FULL=y DIRECTORY=DPDIR COMPRESSION=ALL FLASHBACK_TIME=systimestamp DUMPFILE="filename-$(date -I).dmp" LOGFILE="filename-$(date -I).dmp.log" |
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
openssl pkcs12 -export -out p12file.p12 -inkey cert.key -in cert.crt -chain -CAfile cabundle | |
#SELF SIGNED | |
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 3650 -nodes | |
keytool -importkeystore -deststorepass detpass -destkeystore store.jks -srckeystore p12file.p12 -srcstoretype PKCS12 -srcstorepass srcpass |
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/python | |
import re | |
import subprocess | |
import sys | |
regex = re.compile(r"^\s+t.*:(?P<name>\w+):(?P<percent>\d+).*$") | |
command=['/sbin/lvs','--noheadings','--separator',':','-o','lv_attr,lv_name,data_percent,metadata_percent'] | |
out=[] | |
WARN=90 | |
CRIT=95 |
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
RewriteEngine On | |
RewriteCond %{HTTP:Upgrade} =websocket | |
RewriteRule /(.*) ws://localhost:9001/api/$1 [P,L] | |
RewriteCond %{HTTP:Upgrade} !=websocket | |
RewriteRule /(.*) http://localhost:9001/api/$1 [P,L] |
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
SSLProtocol all -SSLv2 -SSLv3 | |
SSLHonorCipherOrder on | |
SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS | |
# HTTP Strict Transport Security | |
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains" |
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
RewriteEngine on | |
RewriteRule ^/.well-known/.* - [L,NC] | |
RewriteCond %{HTTPS} !=on | |
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=permanent,L] | |
#certbot certonly --webroot -w /var/www/html -d domain |
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
#IP | |
<FilesMatch "\.php$"> | |
SetHandler "proxy:fcgi://localhost:9000" | |
</FilesMatch> | |
DirectoryIndex index.html index.php | |
#UNIX SOCKET | |
<FilesMatch "\.php$"> | |
SetHandler "proxy:unix:/var/run/php-fpm/php-fpm.sock|fcgi://localhost/" | |
</FilesMatch> |