Saturday, March 22, 2008

Disable Sharing of Documents and Remote Desktop In XP

Disable Shared Documents

Added 11/23/02

To disable the Shared Documents folder that shows up on the network

  1. Start Regedit

  2. Go to HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Policies \ Explorer \

  3. Create a new DWORD Value

  4. Give it the name NoSharedDocuments

  5. Give it a value of 1

  6. Log off or reboot


Disable the Remote Desktop Sharing (RDS) icon's menu

Submitted 11/23/02

To Disable the Remote Desktop Sharing (RDS) icon's menu:

  1. Start regedit.exe
  2. Go to HKEY_LOCAL_MACHINE\Software\Microsoft\Conferencing\Mcpt
  3. Create a new string value (Click on Edit > New > String Value).
  4. Name the value Nx
  5. Double-click on it and set it's value to 1
  6. Close the registry

Now the menu options will be grayed out.

To the Ladies: How to date a geek guy?

To the Ladies: How to date a geek guy?

by penguinpetes

Yes, it's not a common question, but I see this question pop up often enough that it warrants a HOWTO for those who want to know. So, how to get a geek guy - and keep him.

#1: Be a straight female. Now, before you gay and lesbian geeks rush me, calm down. Yes, I know same-sex-oriented geeks exist. They're scarce. No, don't write to yell that you're a gay geek and so are four of your friends and that proves me wrong. You're rare. Anyway, this post is how to land a straight male geek.

#2: Be direct. Geek guys tend to be in a shell. They are generally defensive and aloof. They aren't cold in the least; they're just extremely polite. Geeks tend to live by "do unto others". A geek guy who doesn't kiss you is worried about forcing himself. Grab him and plant one. Let him stagger and shake it off, but if he shows signs of recovering too quickly, grab him and plant one again. Subtlety and coyness completely fails with geeks; they'll be confused and expect that you're not on Pon Farr or are a nun or something. Where other guys need no provocation, a geek guy has to be brained on the noggin a couple of times, then he'll get the idea.

#3: Be smart and/or funny. At least don't hide your smarts. Unlike some other breeds of men, geek guys have no insecurities about their masculinity and so do not feel threatened by a smart, capable female. Show him that you can be a good "teammate" in life - yes, geek guys think that logically and practically. As for funny, consider that geeks are cerebral and introverted - they rarely laugh out loud. Make a geek guy laugh, and you'll be on his mind for the rest of the day.

#4: Don't cling. That is to say, geek guys are amazingly low maintenance. You need what attention you need, and of course should make it known. When you're thinking of doing something just for him, surprising him with small, thoughtful gestures and little favors go a lot farther than constant adoration.

#5: Humor his "shop talk". If he works as a freelance coder or consultant or has a small start-up, he might not have a lot of people to talk about work with. If so, expect that he'll dump about ten minutes per day of incomprehensible babble at you. Put on your "I'm listening" face and wait til the stream of talk about his latest programming language pet peeve or hardware frustration or anti-DRM rant passes, then relax. You're done with it for another day, and geek guys need to share this kind of stuff as a way to explain it to themselves. Keep him in mind that you're not his debugger, however.

#6: While respecting his work, do try to pry him off his computer or his Star Trek DVDs or his Dungeon-Mastering and get him outside in the fresh air every now and then. If his protests aren't in the shrieking range, it wasn't that important; he'll perk up as soon as you have him off the machine. Bonus points if you prowl town for interesting fun places to drag him to.

That's all I can think of. I'm married 12 years, now, and this is how she's bagged and kept me.

From Microsoft 10 tips for improving your wireless network

From Microsoft 10 tips for improving your wireless network


If Windows ever notifies you about a weak signal, it probably means your connection isn't as fast or as reliable as it could be. Worse, you might lose your connection entirely in some parts of your home. If you're looking to improve the signal for your wireless network, try some of these tips for extending your wireless range and improving your wireless network performance.

1.

Position your wireless router (or wireless access point) in a central location.

When possible, place your wireless router in a central location in your home. If your wireless router is against an outside wall of your home, the signal will be weak on the other side of your home. Don't worry if you can't move your wireless router, because there are many other ways to improve your connection.

Bad router and good router comparison

2.

Move the router off the floor and away from walls and metal objects (such as metal file cabinets).

Metal, walls, and floors will interfere with your router's wireless signals. The closer your router is to these obstructions, the more severe the interference, and the weaker your connection will be.

3.

Replace your router's antenna.

The antennas supplied with your router are designed to be omni-directional, meaning they broadcast in all directions around the router. If your router is near an outside wall, half of the wireless signals will be sent outside your home, and much of your router's power will be wasted. Most routers don't allow you to increase the power output, but you can make better use of the power. Upgrade to a hi-gain antenna that focuses the wireless signals only one direction. You can aim the signal in the direction you need it most.

Standard antenna and hi-gain antenna examples

4.

Replace your computer's wireless network adapter.

Wireless network signals must be sent both to and from your computer. Sometimes, your router can broadcast strongly enough to reach your computer, but your computer can't send signals back to your router. To improve this, replace your laptop's PC card-based wireless network adapter with a USB network adapter that uses an external antenna. In particular, consider the Hawking Hi-Gain Wireless USB network adapter, which adds an external, hi-gain antenna to your computer and can significantly improve your range.

Laptops with built-in wireless typically have excellent antennas and don't need to have their network adapters upgraded.

5.

Add a wireless repeater.

Wireless router and wireless repeater

Wireless repeaters extend your wireless network range without requiring you to add any wiring. Just place the wireless repeater halfway between your wireless access point and your computer, and you'll get an instant boost to your wireless signal strength. Check out the wireless repeaters from ViewSonic, D-Link, Linksys, and Buffalo Technology.

6.

Change your wireless channel.

Wireless channels

Wireless routers can broadcast on several different channels, similar to the way radio stations use different channels. In the United States and Canada, these channels are 1, 6, and 11. Just like you'll sometimes hear interference on one radio station while another is perfectly clear, sometimes one wireless channel is clearer than others. Try changing your wireless router's channel through your router's configuration page to see if your signal strength improves. You don't need to change your computer's configuration, because it'll automatically detect the new channel.

7.

Reduce wireless interference.

If you have cordless phones or other wireless electronics in your home, your computer might not be able to "hear" your router over the noise from the other wireless devices. To quiet the noise, avoid wireless electronics that use the 2.4GHz frequency. Instead, look for cordless phones that use the 5.8GHz or 900MHz frequencies.

8.

Update your firmware or your network adapter driver.

Router manufacturers regularly make free improvements to their routers. Sometimes, these improvements increase performance. To get the latest firmware updates for your router, visit your router manufacturer's Web site.

Similarly, network adapter vendors occasionally update the software that Windows XP uses to communicate with your network adapter, known as the driver. These updates typically improve performance and reliability. To get the updates, visit Microsoft Update, and then under Select by Type click Hardware, Optional. Install any updates relating to your wireless network adapter. It wouldn't hurt to install any other updates while you're visiting Microsoft Update, too.

Note When you go to Microsoft Update, you have two options: the Express Install for critical and security updates and Custom Install for high priority and optional updates. You may find more driver updates when you use Custom Install.

9.

Pick equipment from a single vendor.

While a Linksys router will work with a D-Link network adapter, you often get better performance if you pick a router and network adapter from the same vendor. Some vendors offer a performance boost of up to twice the performance when you choose their hardware: Linksys has the SpeedBooster technology, and D-Link has the 108G enhancement.

10.

Upgrade 802.11b devices to 802.11g.

802.11b is the most common type of wireless network, but 802.11g is about five times faster. 802.11g is backward-compatible with 802.11b, so you can still use any 802.11b equipment that you have. If you're using 802.11b and you're unhappy with the performance, consider replacing your router and network adapters with 802.11g-compatible equipment. If you're buying new equipment, definitely choose 802.11g.

Wireless networks never reach the theoretical bandwidth limits. 802.11b networks typically get 2-5Mbps. 802.11g is usually in the 13-23Mbps range. Belkin's Pre-N equipment has been measured at 37-42Mbps.

How to Center a lay-out in CSS

The following is documented in order to provide a neat and tidy way of responding to a frequently asked question here at SimpleBits:

How do I center a fixed-width layout using CSS?

For those that know, it’s simple. For those that don’t, finding the two necessary rules to complete the job can be frustrating. So here it goes.

centering diagramIn the markup, we’ll need a container to hold everything. In this container will sit the entire layout that we’d like to center on the page. We’ll suspiciously name this container: “container”:



...entire layout goes here...

Using CSS, the following two rules force whatever is contained within #container to be centered:

body {
text-align: center;
}

#container {
margin: 0 auto;
width: xxxpx;
}

We’re aligning everything within body to be centered, while giving the #container a specific width (whatever you’d like). The margin: 0 auto; is the second piece which makes it all work. We’re specifying 0 pixels on top and bottom, with auto margins on the left and right.

That’s it. The only problem we’ll run into now is that, because we haven’t specfied otherwise, everything on the page will be centered. We’ll want to override that from the container level down with the addition of the following rule:

#container {
margin: 0 auto;
width: xxxpx;
text-align: left;
}

With that single declaration, everything within #container will be left-aligned, yet leaving our centered layout unhindered. The same principle could be applied not only in centering entire layouts, but other block-level elements and page components.

Now I’ll just need to keep the URL for this entry handy the next time the question is posed, helping me respond to emails that inquire about this seemingly simple goal. And these days, anything that helps me respond to email is a true asset, as I’ve been absolutely terrible at the task lately.

Update: Several people have written in, either to ask why text-align: center; is necessary, or that using that rule is plain wrong. The reason it’s used, is for the benefit of IE5/Win users. Without the rule, most browsers will still center the layout just fine using auto left and right margins — but not IE5/Win.

20 very Useful OS X tips and tricks

20 Useful OS X Tips

by Chris Howard

Because we are all different, operating system developers always put more than one way of doing things in their systems. One example is there’s often keyboard shortcuts, menus and toolbars in applications for doing the same thing. Consequently, it’s very easy to get into the habit of doing things a particular way without ever learning other ways.

Hopefully for the average user there might be at least one tip here that you weren’t aware of and that will be useful to you. Otherwise, I officially re-title this article: “20 Useful OS X Tips for Beginners and Switchers”.

By the way, if you have a single button mouse, where it says “right click”, substitute with “control-click” .

1. Pressing Esc while typing in most applications pops up a list of suggested completions of the word you’re typing. (Does anyone know if there’s a way to toggle the permanent display of this?)

2. Image Capture lets you manage photos on your camera before you download them (as explained in last week’s article).

3. Right click on an open PDF in Safari to get the a context menu which includes the option to open the PDF in Preview.

4. Pressing the Tab key in Exposé cycles through open applications.

5. Press the ` key in Exposé to cycle backwards as per the previous tip. ( ‘ is the key Tab and left of the 1 key).

6. Press Command-Q to close applications when command-tabbing. This is possibly the fastest way you’ll find to close several applications in quick succession.

7. Macs with remote controls can be put to sleep by holding down the play button on the remote. (I use my Mac as a reading light so find this quite handy. Maybe Apple could include a clapper for me in Leopard.smile)

8. Triple click selects a whole paragraph of text.

9. To select a block of text, click the start position, then Shift-click the end position. Significant;y, this doesn’t just work in editing applications like Word (where you might be already doing it anyway), but it also works with non-editable text, such as a webpage in Safari. Where has this been all my life? The number of times I’ve selected pages and pages of text by click and drag, when this is so much quicker. (My Hackmeister friend knew this one of course - but never had told me. smile )

10. In TextEdit, Option-click & drag selects a rectangle of text. (When you need it, selecting a rectangle of text is really useful, so if anyone knows other applications that have this functionality, let us know.)

11. We all know Command-shift-4 to capture a selection of the screen, but don’t forget pressing the Spacebar will toggle between selection mode and select whole window mode.

12. Command click the jelly bean found in the top right corner of some applications to cycle through toolbars.

13. In Safari, Command-Shift-click a link opens it in a new tab and immediately displays the page. (If anyone knows a way in Safari to force a page to open in the same window, do tell.)

The Option key is a hidden treasure trove. Experiment with it often. Here’s a few:

14. Hold the Option key will clicking the Zoom button (green button, rightmost of three in the top left corner of windows) switches the zoom state of all windows in the selected application.

15. Option-click the minimize button minimizes all windows in the application - and makes for a really cool animation (hold the shift key too if you want to slow it down to see it more easily).

16. Option-click on a minimized window will restore all windows for that application.

17. Option-click on a running application in the Dock hides the front-most application and brings the clicked application to the front (unless it already was).

18. Option-click on the close tab icon in Safari, closes all other tabs. Handle this one with care - there’s no warning dialog.

19. Option-arrow moves cursor by word. One for the Windows switchers who are used to using ctrl-arrow.

20. When menus are selected, press the option key to reveal alternative functions. Eg In the File menu of Finder, the Get Info item becomes Show Inspector which is like a context sensitive info pane.

Now, if you are like “The Hackmeister of OS X”, rather than scoffing, let us know a few of your favorite lesser known tips.

htaccess tips and tricks

.htaccess tips and tricks


clever stuff here

introduction to .htaccess

This work in constant progress is some collected wisdom, stuff I've learned on the topic of .htaccess hacking, commands I've used successfully in the past, on a variety of server setups, and in most cases still do. You may have to tweak the examples some to get the desired result, though, and a reliable test server is a powerful ally, preferably one with a very similar setup to your "live" server. Okay, to begin..

..a win32 Apache mirror of corz.org

.htaccess files are invisible

There's a good reason why you won't see .htaccess files on the web; almost every web server in the world is configured to ignore them, by default. Same goes for most operating systems. Mainly it's the dot "." at the start, you see?

If you don't see, you'll need to disable your operating system's invisible file functions, or use a text editor that allows you to open hidden files, something like bbedit on the Mac platform. On windows, showing invisibles in explorer should allow any text editor to open them, and most decent editors to save them too**. Linux dudes know how to find them without any help from me.

that same folder, as seen from Mac OS X


In both images, the operating system has been instructed to display invisible files. ugly, but necessary sometimes.

By the way; the windows screencap is more recent than the mac one, moved files are likely being handled by my clever 404 script.

** even notepad can save files beginning with a dot, if you put double-quotes around the name when you save it; i.e.. ".htaccess". You can also use your ftp client to rename files beginning with a dot, even on your local filesystem; works great in FileZilla.

What are .htaccess files anyway?

Simply put, they are invisible plain text files where one can store server directives. Server directives are anything you might put in an Apache config file (httpd.conf) or even a php.ini**, but unlike those "master" directive files, these .htaccess directives apply only to the folder in which the .htaccess file resides, and all the folders inside.

This ability to plant .htaccess files in any directory of our site allows us to set up a finely-grained tree of server directives, each subfolder inheriting properties from its parent, whilst at the same time adding to, or over-riding certain directives with its own .htaccess file. For instance, you could use .htacces to enable indexes all over your site, and then deny indexing in only certain subdirectories, or deny index listings site-wide, and allow indexing in certain subdirectories. One line in the .htaccess file in your root and your whole site is altered. From here on, I'll probably refer to the main .htaccess in the root of your website as "the master .htaccess file", or "main" .htaccess file.

There's a small performance penalty for all this .htaccess file checking, but not noticeable, and you'll find most of the time it's just on and there's nothing you can do about it anyway, so let's make the most of it..

** Your main php.ini, that is, unless you are running under phpsuexec, in which case the directives would go inside individual php.ini files

What can I do with .htaccess files?

Almost any directive that you can put inside an httpd.conf file will also function perfectly inside an .htaccess file. Unsurprisingly, the most common use of .htaccess is to..

control access

.htaccess is most often used to restrict or deny access to individual files and folders. A typical example would be an "includes" folder. Your site's pages can call these included scripts all they like, but you don't want users accessing these files directly. In that case you would drop an .htaccess file in the includes folder with content something like this..

NO ENTRY!
# no one gets in here!
deny from all

which would deny ALL direct access to ANY files in that folder. You can be more specific with your conditions, for instance limiting access to a particular IP range, here's a handy top-level rule for a local test server..

NO ENTRY outside of the LAN!
# no nasty crackers in here!
order deny,allow
deny from all
allow from 192.168.0.0/24
# this would do the same thing..
#allow from 192.168.0

Generally these sorts of requests would bounce off your firewall anyway, but on a live server (like my dev mirror sometimes is) they become useful for filtering out undesirable IP blocks, known risks, lots of things. By the way, in case you hadn't spotted; lines beginning with "#" are ignored by Apache; handy for comments.

Sometimes, you will only want to ban one IP, perhaps some persistent robot that doesn't play by the rules..

post user agent every fifth request only. hmmm. ban IP..
# someone else giving the ruskies a bad name..
order allow,deny
deny from 83.222.23.219
allow from all

The usual rules for IP addresses apply, so you can use partial matches, ranges, and so on. Whatever, the user gets a 403 "access denied" error page in their client software (browser, usually), which certainly gets the message across. This is probably fine for most situations, but in part two I'll demonstrate some cooler ways to deny access.

custom error documents

I guess I should briefly mention that .htaccess is where most folk configure their error documents. Usually with sommething like this..

the usual method. the "err" folder (with the custom pages) is in the root
# custom error documents
ErrorDocument 401 /err/401.php
ErrorDocument 403 /err/403.php
ErrorDocument 404 /err/404.php
ErrorDocument 500 /err/500.php

You can also specify external URLs, though this can be problematic, and is best avoided. One quick and simple method is to specify the text in the directive itself, you can even use HTML (though there is probably a limit to how much HTML you can squeeze onto one line). Remember to begin with a ", but DO NOT end with one.

measure twice, quote once..
# quick custom error "document"..
ErrorDocument 404 "NO!

There is nothing here.. go away quickly!


Using a custom error document is a Very Good Idea, and will give you a second chance at your almost-lost visitors. I recommend you download mine. But then, I would.

password protected directories

The next most obvious use for our .htaccess files is to allow access to only specific users, or user groups, in other words; password protected folders. a simple authorisation mechanism might look something like this..

a simple sample .htaccess file for password protection:
AuthType Basic
AuthName "restricted area"
AuthUserFile /usr/local/var/www/html/.htpasses
require valid-user

You can use this same mechanism to limit only certain kinds of requests, too..

only valid users can POST in here, anyone can GET, PUT, etc:
AuthType Basic
AuthName "restricted area"
AuthUserFile /usr/local/var/www/html/.htpasses

require valid-user


You can find loads of online examples of how to setup authorization using .htaccess, and so long as you have a real user (or create one, in this case, 'jimmy') with a real password (you will be prompted for this, twice) in a real password file (the -c switch will create it)..

htpasswd -c /usr/local/var/www/html/.htpasses jimmy

..the above will work just fine. htpasswd is a tool that comes free with Apache, specifically for making and updating password files, check it out. The windows version is the same; only the file path needs to be changed; to wherever you want to put the password file.

Note: if the Apache bin/ folder isn't in your PATH, you will need to cd into that directory before performing the command. Also note: You can use forward and back-slashes interchangeably with Apache/php on Windows, so this would work just fine..

htpasswd -c c:/unix/usr/local/Apache2/conf/.htpasses jimmy

Relative paths are fine too; assuming you were inside the bin/ directory of our fictional Apache install, the following would do exactly the same as the above..

htpasswd -c ../conf/.htpasses jimmy

Naming the password file .htpasses is a habit from when I had to keep that file inside the web site itself, and as web servers are configured to ignore files beginning with .ht, they too, remain hidden. If you keep your password file outside the web root (a better idea), then you can call it whatever you like, but the .ht_something habit is a good one to keep, even inside the web tree, it is secure enough for our basic purpose..

Once they are logged in, you can access the remote_user environmental variable, and do stuff with it..
the remote_user variable is now available..
RewriteEngine on
RewriteCond %{remote_user} !^$ [nc]
RewriteRule ^(.*)$ /users/%{remote_user}/$1

Which is a handy directive, utilizing mod_rewrite; a subject I delve into far more deeply, in part two.

get better protection..

The authentication examples above assume that your web server supports "Basic" http authorisation, as far as I know they all do (it's in the Apache core). Trouble is, some browsers aren't sending password this way any more, personally I'm looking to php to cover my authorization needs. Basic auth works okay though, even if it isn't actually very secure - your password travels in plain text over the wire, not clever.

If you have php, and are looking for a more secure login facility, check out pajamas. It's free. If you are looking for a password-protected download facility (and much more, besides), check out my distro machine, also free.

500 error

If you add something that the server doesn't understand or support, you will get a 500 error page, aka.. "the server did a boo-boo". Even directives that work perfectly on your test server at home may fail dramatically at your real site. In fact this is a great way to find out if .htaccess files are enabled on your site; create one, put some gibberish in it, and load a page in that folder, wait for the 500 error. if there isn't one, probably they are not enabled.

If they are, we need a way to safely do live-testing without bringing the whole site to a 500 standstill.

Fortunately, in much the same way as we used the tag above, we can create conditional directives, things which will only come into effect if certain conditions are true. The most useful of these is the "ifModule" condition, which goes something like this..

only if PHP is loaded, will this directive have any effect

php_value default_charset utf-8


..which placed in your master .htaccess file, that would set the default character encoding of your entire site to utf-8 (a good idea!), at least, anything output by PHP. If the PHP4 module isn't running on the server, the above .htaccess directive will do exactly nothing; Apache just ignores it. As well as proofing us against knocking the server into 500 mode, this also makes our .htaccess directives that wee bit more portable. Of course, if your syntax is messed-up, no amount of if-module-ing is going to prevent a error of some kind, all the more reason to practice this stuff on a local test server.

groovy things to do with .htaccess

So far we've only scratched the surface. aside from authorisation, the humble .htaccess file can be put to all kinds of uses. If you've ever had a look in my public archives you will have noticed that that the directories are fully browsable, just like in the old days before adult web hosts realized how to turn that feature off! a line like this..

bring back the directories!
Options +Indexes +MultiViews +FollowSymlinks

will almost certainly turn it back on again. And if you have mod_autoindex.c installed on your server (probably, yes), you can get nice fancy indexing, too..

show me those files!

IndexOptions FancyIndexing

..which, as well as being neater, allows users to click the titles and, for instance, order the listing by date, or file size, or whatever. It's all for free too, built-in to the server, we're just switching it on. You can control certain parameters too..

let's go all the way!

IndexOptions FancyIndexing IconHeight=16 IconWidth=16

Other parameters you could add include..

NameWidth=30
DescriptionWidth=30
IconsAreLinks SuppressHTMLPreamble (handy!)

I'm not mentioning the "XHTML" parameter in Apache2, because it still isn't! Anyways, I've chucked one of my old fancy indexing .htaccess file onsite for you to have some fun with. Just add readme.html and away you go! note: these days I use a single header files for all the indexes, and only drop in local "readme" files. Check out the example, and my public archives for more details.

It really is worth scouting around the Apache documentation, often you will find controls for things you imagined were uncontrollable, thereby creating new possibilities, better options for your website. My experience of the magic "LAMP" (Linux-Apache-MySQL-PHP) has been.. "If you can imagine that it can be done, it can be done". Swap "Linux" for any decent operating system, the "AMP" part runs on most of them.

Okay, so now we have nice fancy directories, and some of them password protected, if you don't watch out, you're site will get popular, and that means bandwidth..

save bandwidth with .htaccess!

If you pay for your bandwidth, this wee line could save you hard cash..

save me hard cash! and help the internet!

php_value zlib.output_compression 16386


All it does is enables PHP's built-in transparent zlib compression. This will half your bandwidth usage in one stroke, more than that, in fact. Of course it only works with data being output by the PHP module, but if you design your pages with this in mind, you can use php echo statements, or better yet, php "includes" for your plain html output and just compress everything! Remember, if you run phpsuexec, you'll need to put php directives in a local php.ini file, not .htaccess. See here for more details.

hide and deny files

Do you remember I mentioned that any file beginning with .ht is invisible? .."almost every web server in the world is configured to ignore them, by default" and that is, of course, because .ht_anything files generally have server directives and passwords and stuff in them, most servers will have something like this in their main configuration..

Standard setting..

Order allow,deny
Deny from all
Satisfy All


which instructs the server to deny access to any file beginning with .ht, effectively protecting our .htaccess and other files. The "." at the start prevents them being displayed in an index, and the .ht prevents them being accessed. This version..

ignore what you want

Order allow,deny
Deny from all
Satisfy All


tells the server to deny access to *.log files. You can insert multiple file types into each rule, separating them with a pipe "|", and you can insert multiple blocks into your .htaccess file, too. I find it convenient to put all the files starting with a dot into one, and the files with denied extensions into another, something like this..

the whole lot
# deny all .htaccess, .DS_Store $hî†é and ._* (resource fork) files

Order allow,deny
Deny from all
Satisfy All


# deny access to all .log and .comment files

Order allow,deny
Deny from all
Satisfy All


would cover all ._* resource fork files, .DS_Store files (which the Mac .">Finder creates all over the place) *.log files, *.comment files and of course, our .ht* files. You can add whatever file types you need to protect from direct access. I think it's clear now why the file is called ".htaccess".

These days, using is preferred over , mainly because you can use regular expression in the conditions (very handy), produce clean, more readable code. Here's an example. which I use for my php-generated style sheets..

parse file.css and file.style with the php machine..
# handler for phpsuexec..

SetHandler application/x-httpd-php


Any files matching the regular expression statement, that is files with a *.css or *.style extension, will now be handled by php, rather than simply served up by Apache. Any statements you come across can be advantageously replaced by statements. Good to know.

more stuff

At the end of my .htaccess files, there always seems to be a section of "stuff"; miscellaneous commands, mainly php flags and switches; so it seems logical to finish up the page with a wee selection of those..

php flags, switches and other stuff..
# let's enable php (non-cgi, aka. 'module') for EVERYTHING..'
AddType application/x-httpd-php5 .htm .html .php .blog .comment .inc
# legacy php4 version..'
AddType application/x-httpd-php .htm .html .php .blog .comment .inc

# don't even think about setting this to 'on'
php_value register_globals off

# no session id's in the URL PULEEZE!
php_value session.use_trans_sid 0
# should be the same as..
php_flag session.use_trans_sid off
# using both should also work fine!

# php error logs..
php_flag display_errors off
php_flag log_errors on
php_value track_errors on
php_value error_log /home/cor/errors/phperr.log

# if you like to collect interesting php system shell access and web hack scripts
# get yourself a SECURE upload facility, and just let the script-kiddies come …
# in no time you will have a huge selection of fascinating code. If you want folk to
# also upload zips and stuff, you might want to increase the upload capacities..
php_value upload_max_filesize 12M
php_value post_max_size 12M

# php 5 only, afaik. handy when your server isn't where YOU are.
php_value date.timezone Europe/Aberdeen
# actually, Europe/Aberdeen isn't a valid php timezone, so that won't work.
# I recommend you check the php manual for this function, because many crazy places ARE!

Note: For most of the flags I've tested, you can use on/off and true/false interchangeably, as well as 0/1, also php_value and php_flag can be switched around while things continue to work as expected! I guess, logically, booleans should always be php_flag, and values, php_value; but suffice to say, if some php erm, directive isn't working, these would all be good things to fiddle with!

Of course, the php manual explains all. The bottom line is; both will work fine, but if you use the wrong type in .htaccess, say, set a php_flag using php_value, a php ini_get() command, for instance, would return true, even though you had set the value to off, because it reads off value as a string, which of course evaluates to not-zero, i.e. 1, or "true". If you don't rely on get_ini(), or similar, it's not a problem, though clearly it's better to get it right from the start. By the way; one of the values above is incorrectly set. Did you spot it?

Most php settings, you can override inside your actual scripts, but I do find it handy to be able to set defaults for a folder, or an entire site, using .htaccess.

over to you..

That should get you started with .htaccess, quite easy when you know how. If you really want to bend your brain out of shape, follow the link below for part two of the series, where I delve into the arcane mysteries of URL rewriting.

;o)

Windows Services that you can safely disable

Services You Can Disable

Whoa! We can disable these? Yes my friend, would it be just simplier to go to your taskmanager and end the process of this mofos who is eating up a lot of bandwidth and resources from your beloved PC. Or even take them out from the start up menu by doing a command MSCONFIG in your run prompt.

There are quite a few services you can disable from starting automatically.
This would be to speed up your boot time and free resources.
They are only suggestions so I suggestion you read the description of each one when you run Services
and that you turn them off one at a time.

Some possibilities are:

* Alerter - Sends alert messages to specified users that are connected to the server computer.

* Application Management - Allows software to tap directly into the Add/Remove Programs feature via the Windows Installer technology.

* Background Intelligent Transfer Service - The Background Intelligent Transfer service is used by programs (such as Windows AutoUpdate) to download files by using spare bandwidth.
* Clipbook - ClipBook permits you to cut and paste text and graphics over the network.

* Error Reporting Service - Allows applications to send error reports to Microsoft in the event of an application fault.

* Fast User Switching - Windows XP allows users to switch quickly between accounts, without requiring them to log off.

* Help and Support - Allows the XP Built-in Help and Support Center to run.

* IMAPI CD-Burning COM Service - You don't need this if you have other software to create CDs.

* Indexing Service - Indexes contents and properties of files on local and remote computers; provides rapid access to files through flexible querying language.

* IP SEC - Manages IP security policy and starts the ISAKMP/Oakley (IKE) and the IP security driver. If you are not on a domain, you likely don't need this running.

* Messenger - Transmits net send and Alerter service messages between clients and servers. This is how a lot of pop-up windows start appearing on your desktop.

* Net Logon - Supports pass-through authentication of account logon events for computers in a domain. If you are not on a domain, you don't need this running

* Network DDE - Provides network transport and security for Dynamic Data Exchange (DDE) for programs running on the same computer or on different computers.

* NT LM Security Support Provider - Provides security to remote procedure call (RPC) programs that use transports other than named pipes.

* Performance Logs and Alerts - Collects performance data from local or remote computers based on preconfigured schedule parameters, then writes the data to a log or triggers an alert. If you don't need to monitor your performance logs, then you don't need this service.

* Portable Media Serial Number - Retrieves the serial number of any portable music player connected to your computer

* QOS RSVP - Provides network signaling and local traffic control setup functionality for QoS-aware programs and control applets.

* Remote Desktop Help Session Manager - Manages and controls Remote Assistance. If you are not using Remote Desktop you don't need this service.

* Remote Registry - Enables remote users to modify registry settings on this computer.

* Routing & Remote Access - Offers routing services to businesses in local area and wide area network environments. Allows dial-in access.

* Secondary Login - Enables starting processes under alternate credentials. This is what allows you to run an application as another user.

* Smart Card - Manages access to smart cards read by this computer.

* Smart Card Helper - Enables support for legacy non-plug and play smart-card readers used by this computer.

* SSDP Discovery Service - Enables discovery of UPnP devices on your home network.

* TCP/IP NetBIOS Helper - Enables support for NetBIOS over TCP/IP (NetBT) service and NetBIOS name resolution. This should not be needed in today's network environment.

* Telnet - Enables a remote user to log on to this computer and run programs, and supports various TCP/IP Telnet clients.

* Uninterruptible Power Supply Service - Manages an uninterruptible power supply (UPS) connected to the computer.

* Universal Plug and Play Device Host - Provides support to host Universal Plug and Play devices

* Upload Manager - Manages synchronous and asynchronous file transfers between clients and servers on the network.

* Volume Shadow Copy Service - Manages and implements Volume Shadow Copies used for backup and other purposes.

* Web Client - Enables Windows-based programs to create, access, and modify non-local files across the Internet.

* Wireless Zero Configuration - Provides automatic configuration for the 802.11 adapters

* WMI Performance Adapter - Provides performance library information from WMI HiPerf providers.