User Tools

Site Tools


nndocs:reference

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
nndocs:reference [2013/02/19 16:29] – move LAMP stuff to nndocs:lamp naptasticnndocs:reference [2017/08/07 02:27] (current) – None of this is necessary anymore naptastic
Line 1: Line 1:
-===== Remember: Victory starts with "vi". ===== 
  
-=== Good .htaccess rules; thank you Kyle Luzny. === 
-<code> 
-#security 
-#obscure server versions 
-ServerSignature Off 
- 
-#disable directory browsing 
-Options All -Indexes 
- 
-#Enable rewrites 
-RewriteEngine on 
- 
-#block nasty data 
-#proc/self/environ? no way! 
-RewriteCond %{QUERY_STRING} proc/self/environ [OR] 
-#Block out any script trying to set a mosConfig value through the URL 
-RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR] 
-#Block out any script trying to base64_encode crap to send via URL 
-RewriteCond %{QUERY_STRING} base64_encode.*(.*) [OR] 
-#Block out any script that includes a <script> tag in URL 
-RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR] 
-#Block out any script trying to set a PHP GLOBALS variable via URL 
-RewriteCond %{QUERY_STRING} GLOBALS(=|[|\%[0-9A-Z]{0,2}) [OR] 
-#Block out any script trying to modify a _REQUEST variable via URL 
-RewriteCond %{QUERY_STRING} _REQUEST(=|[|\%[0-9A-Z]{0,2}) 
-#Send all blocked request to homepage with 403 Forbidden error! 
-RewriteRule ^(.*)$ index.php [F,L] 
- 
-#secure htaccess file 
-<Files .htaccess> 
-order allow,deny 
-deny from all 
-</Files> 
- 
-#secure file types 
-<FilesMatch ".(htaccess|htpasswd|ini|phps|fla|psd|log|sh)$"> 
-Order Allow,Deny 
-Deny from all 
-</FilesMatch> 
- 
-#redirect errors 
-ErrorDocument 403 /index.php 
-ErrorDocument 404 /index.php 
-ErrorDocument 500 /index.php 
- 
-#rewrite rules 
-#everything on www version 
-RewriteCond %{HTTP_HOST} !^www\. 
-RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] 
- 
-#disable hotlinking 
-#RewriteCond %{HTTP_REFERER} !^$ 
-#RewriteCond %{HTTP_REFERER} !^(www.)?hyperlinkz.org/.*$ [NC] 
-#RewriteRule \.(gif|jpg|swf|flv|png)$ http://www.hyperlinkz.org/images/170px-pirate.png [R,NC,L] 
- 
-#disable hotlinking 
-#RewriteCond %{HTTP_REFERER} !^$ 
-#RewriteCond %{HTTP_REFERER} !^(www.)?%{SERVER_NAME}/.*$ [NC] 
-#RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?%{SERVER_NAME} [NC] 
-#RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?%{SERVER_NAME}/.*$ [NC] 
-#RewriteRule \.(gif|jpg|swf|flv|png)$ http://%{SERVER_NAME}/images/170px-pirate.png [R,NC,L] 
- 
-#cache 
-ExpiresActive On 
-ExpiresDefault A604800 
-ExpiresByType image/x-icon A2419200 
-ExpiresByType application/x-javascript A600 
-ExpiresByType text/css A600 
-ExpiresByType text/html A600 
- 
-#disable caching for scripts and other dynamic files 
-#<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$"> 
-<FilesMatch "\.(php|cgi|fcgi|rb|erb)$"> 
-ExpiresActive Off 
-</FilesMatch> 
- 
-#compress files 
-AddOutputFilterByType DEFLATE text/plain 
-AddOutputFilterByType DEFLATE text/html 
-AddOutputFilterByType DEFLATE text/xml 
-AddOutputFilterByType DEFLATE text/css 
-AddOutputFilterByType DEFLATE application/xml 
-AddOutputFilterByType DEFLATE application/xhtml+xml 
-AddOutputFilterByType DEFLATE application/rss+xml 
-AddOutputFilterByType DEFLATE application/javascript 
-AddOutputFilterByType DEFLATE application/x-javascript 
-</code> 
-=== Default Route === 
-Add a default route: 
- 
-  route add default gw <gateway ip address> dev <device name> 
- 
-To make this route persist, add these lines to /etc/sysconfig/network: 
- 
-  GATEWAY=<gateway IP address> 
-  GATEWAYDEV=<device name> 
- 
-=== Changing the @%$#! scrollbar color in Ubuntu!!! === 
-Add these lines to ~/.gtkrc-2.0: 
- 
-  style "gnome-color-chooser-scrollbar" 
-  { 
-    bg[NORMAL] = "#F07746" 
-    bg[PRELIGHT] = "#D76A3E" 
-    bg[ACTIVE] = "#BD5D37" 
-  } 
-  widget_class "*Scrollbar" style "gnome-color-chooser-scrollbar" 
- 
-Change the hex color values to what you like. Prelight is the color while the mouse is hovering over the scrollbar, and active is the color while it's being held down. 
nndocs/reference.1361291369.txt.gz · Last modified: 2013/02/19 16:29 by naptastic