User Tools

Site Tools


nndocs:reference

This is an old revision of the document!


Remember: Victory starts with "vi".

Good .htaccess rules; thank you Kyle Luzny.

#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

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.

Wifi at Arcainum

3096668561

nndocs/reference.1361916384.txt.gz ยท Last modified: 2013/02/26 22:06 by naptastic