This file contains hidden or 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 python3 | |
import string | |
import random | |
## characters to generate password from | |
characters = list(string.ascii_letters + string.digits + "!@#$%^&*()") | |
def generate_random_password(): | |
## length of password from the user |
This file contains hidden or 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
// limit post revision (wp-config) | |
define( 'WP_POST_REVISIONS', 3 ); | |
// disable post revision | |
define('WP_POST_REVISIONS', false ); | |
// delete revisions MySQL query | |
DELETE FROM wp_posts WHERE post_type = "revision"; |
This file contains hidden or 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
# redirect all users to maintenance page | |
RewriteCond %{REQUEST_URI} !^/maintenance.php$ [NC] | |
RewriteRule ^(.*)$ /maintenance.php [R=302,L] |
This file contains hidden or 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 | |
## https and www rewrite | |
# https to www. | |
RewriteCond %{HTTP_HOST} !^www\. [NC] | |
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
# https (no Cloudflare proxied) | |
RewriteCond %{HTTP:X-Forwarded-Proto} !https |
This file contains hidden or 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
# Enable and Disable Browser Caching with .htaccess | |
## Enable Examples | |
### 1 MONTH for static assets | |
<filesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$"> | |
Header set Cache-Control "max-age=2592000, public" | |
</filesMatch> | |
### 1 DAY for rss feeds and robots |
This file contains hidden or 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
Bacon ipsum sit amet duis occaecat et corned beef, fugiat pastrami velit magna shoulder ad short ribs in dolore incididunt ribeye. Flank velit short loin ea beef prosciutto, sint jerky ball tip spare ribs. Consectetur pancetta ex, venison frankfurter est qui nulla chuck flank boudin sausage esse magna andouille. Ex frankfurter cow strip steak ground round, incididunt hamburger ad reprehenderit esse. | |
Ullamco meatball salami, ut tail dolore sunt brisket veniam ex adipisicing. Dolore pariatur short ribs pancetta, exercitation andouille magna eiusmod tempor cillum. Ut bresaola pork belly, velit eiusmod meatloaf tongue chuck reprehenderit shankle. Pariatur frankfurter shankle, leberkas elit pastrami turkey. Irure eiusmod ullamco tenderloin. Esse duis frankfurter excepteur tenderloin ad incididunt pastrami magna dolore jowl, sausage pig ea tempor. Dolore hamburger nostrud cow in. | |
Prosciutto reprehenderit t-bone commodo ullamco ham. Dolore meatball biltong est esse ribeye, minim exercitation pastrami anim short lo |
This file contains hidden or 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
# Enable and Disable Browser Caching with .htaccess | |
## Enable Examples | |
### 1 MONTH for static assets | |
<filesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$"> | |
Header set Cache-Control "max-age=2592000, public" | |
</filesMatch> | |
### 1 DAY for rss feeds and robots |
This file contains hidden or 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
topic: ~pets (dog cat pet animal bird fish snake) | |
?: ( << you like snake >>) | |
I love pythons except ^"Python" (the programming language) | |
?: ( << you ~like ~animals >>) | |
I love all animals. | |
t: Do you have any pets? |
This file contains hidden or 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> | |
<!-- http://www.w3schools.com/jsref/prop_select_selectedindex.asp --> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>tst</title> | |
<script type="text/javascript"> | |
function ShowDiv() { | |
if (document.getElementById('Country').selectedIndex != 0 ) { | |
document.getElementById('Show').style.display = 'block'; |
This file contains hidden or 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 | |
# remove vm snapshots | |
# change your path /path_to_your/disc.vmdk | |
# | |
# source: http://snipurl.com/maggini_vmdisc_osx | |
cd '/Applications/VMware Fusion.app/Contents/Library' | |
# defrag | |
./vmware-vdiskmanager -d path_to_your/disc.vmdk |
NewerOlder