Do they belong to you? Claim these comments.
qmchenry
Is this you? Claim Profile »
10 months ago
in Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes on Tech-Recipes
It can definitely be tough finding the culprit, particularly in a big set of scripts that you didn't write. Since the output has been sent already, it should be present above the error message in the page source that has been sent, so when you see the error, use your browser's View Source to look at what was sent before the error message and you might get something to search for in your source code. If it's something like <head> then you're in luck since you probably only have one of those in a file. If it's a
then it may be a little tougher, but at least it's something.
One additional tip is to exclude the final ?> tag in a file. This tag isn't necessary and if it isn't present, then there cannot be any whitespace after it.
Good luck!
then it may be a little tougher, but at least it's something.
One additional tip is to exclude the final ?> tag in a file. This tag isn't necessary and if it isn't present, then there cannot be any whitespace after it.
Good luck!
3 years ago
in Move your Documents And Settings USERNAME profile off of the C: drive | Windows | Tech-Recipes on Tech-Recipes
Oh, yeah.. this is an important thing to be able to do. If anything, MS should make this task simple and an option when creating/modifying a user. Outstanding recipe, by the way!
Q
Q
3 years ago
in Generate passwords with openssl | OpenSSL | Tech-Recipes on Tech-Recipes
This is a great use for openssl that I didn't know about. I recently implemented a password generator in a shell script that I wasn't thrilled with. I'm upgrading it tonight. Thanks!
3 years ago
in Mac OS X recover lost root password | Apple Mac | Tech-Recipes on Tech-Recipes
Sorry that didn't work.. what version of OS X are you running? There should be a way to prevent that service from starting. There may also be an easier way for your specific version.
3 years ago
in Mac OS X recover lost root password | Apple Mac | Tech-Recipes on Tech-Recipes
This worked for me on 10.3:
Restart the system (Apple menu -> Restart)
Hold down Command-S while restarting -> lots of white on black text
From the command prompt issue these commands:
I believe that in some other versions of OSX, the second and third steps are not required because SystemStarter configures networking in those versions. In 10.3, several services will not start without active networking including opendirectory which stores the passwords.
If you get to the command prompt and run 'passwd root' and it sits for 10-15 seconds and then returns to a command prompt, this is indicative of a timeout waiting for connection to a service that is not running. If you didn't do all of the steps above, try them in that order and see if that helps.
Q
Restart the system (Apple menu -> Restart)
Hold down Command-S while restarting -> lots of white on black text
From the command prompt issue these commands:
mount -uw /
/usr/libexec/register_mach_bootstrap_servers /etc/mach_init.d
netinfod -s local
SystemStarter
passwd rootI believe that in some other versions of OSX, the second and third steps are not required because SystemStarter configures networking in those versions. In 10.3, several services will not start without active networking including opendirectory which stores the passwords.
If you get to the command prompt and run 'passwd root' and it sits for 10-15 seconds and then returns to a command prompt, this is indicative of a timeout waiting for connection to a service that is not running. If you didn't do all of the steps above, try them in that order and see if that helps.
Q
3 years ago
in Mac OS X recover lost root password | Apple Mac | Tech-Recipes on Tech-Recipes
Do you have the password to an account on the system that is an administrative account? Only those accounts can use sudo (which is quite the cool, recipe-worthy command when I or someone else has the time). Sudo is essentially a way to prevent users from having to become the root user to do root user activities. Many people tend to log into unix systems as root with all the gui weapons -- I mean tools -- at their disposal, ready to wipe out their system. It's a nasty habit, one which makes a unix system one step closer to a windows box. Speaking of boxes, I'll get off my soap one now..
If you have an account that is privileged (can use sudo), and there can be several on a system, then you can login as that user and use the sudo passwd root command. The password it will ask you for is the current, privileged user's password. Then it will ask for the new root password twice and you should be set. If you do not have an administrative account, let me know.. there are other ways....
Q
If you have an account that is privileged (can use sudo), and there can be several on a system, then you can login as that user and use the sudo passwd root command. The password it will ask you for is the current, privileged user's password. Then it will ask for the new root password twice and you should be set. If you do not have an administrative account, let me know.. there are other ways....
Q
3 years ago
in Uploading Ringers via Hiptones XP | Hiptones XP Tips (CSK and SK2) | HipTop Sidekick | Tech-Recipes on Tech-Recipes
It's actually pretty comical..
3 years ago
in Sending multiple lines of input to a program | UNIX shell scripting | Tech-Recipes on Tech-Recipes
I can never remember the term for this technique, but Rex, one of the many who have contributed recipes to Tech-Recipes has a recipe describing this and I look to it to remember that they are called here documents. I think it is one of the more obscure but useful tips in shell scripting.
Anyone who knows about here docs definitely has a strong background in UNIX. If you are willing to share any more tips, you can add them as an official recipe in the category hierarchy that you feel is appropriate. If they are new recipes, we'll validate them and you'll be compensated... A hint to any recipe authors and future Tech Chefs out there, it's a good idea to do a little search first to see if your idea for a recipe is in our cookbook of over a thousand recipes.
Quinn
Anyone who knows about here docs definitely has a strong background in UNIX. If you are willing to share any more tips, you can add them as an official recipe in the category hierarchy that you feel is appropriate. If they are new recipes, we'll validate them and you'll be compensated... A hint to any recipe authors and future Tech Chefs out there, it's a good idea to do a little search first to see if your idea for a recipe is in our cookbook of over a thousand recipes.
Quinn
3 years ago
in Hide password entry in Bourne/bash shell script | Bourne shell scripting | Tech-Recipes on Tech-Recipes
Awesome! I've never used trap before, but I'll be using it from now on. That's a great solution to a very annoying problem. Thanks for sharing! Use of the trap command would make a great recipe..
Q
Q
3 years ago
in Remove ^M characters at end of lines in vi | UNIX | Tech-Recipes on Tech-Recipes
If you want to remove all blank lines in your file, search for empty lines and replace them with nothing.. since ^ means beginning of line and $ means end of line, ^$ means a blank line, so
will find blank lines and make them disapear.
:%s/^$//gwill find blank lines and make them disapear.
3 years ago
in Send HTML formatted mail from Unix using Sendmail | UNIX | Tech-Recipes on Tech-Recipes
I tried to find a definitive reference out there on the boundary string, but couldn't. In some IETF documents on MIME they use Content-Type: Multipart/Related; boundary=example-1. To my knowledge, it only needs to be unique within the email and probably only exists to allow multiple boundaries in an email.
4 years ago
in Kill the undesired UNIX processes in one go | UNIX | Tech-Recipes on Tech-Recipes
That's a good question. Using grep has a brief but steep learning curve. Most UNIX commands do. Once you get the basics, you can put grep to powerful use.
In the most basic usage, grep will search through text looking for the search string. If you want to look for commands containing the string 'http' you would simply use:
Grep stands for global regular expression parser and is a magnificently powerful tool. The important thing to take out of that mouthful is 'regular expression' which is a formal language for representing elaborate wildcards for searching. For example, a period matches any single character, so .at would match bat, cat, rat, and so on. Used in a grep statement, it would match that regular expression anywhere in the line, so it would also match brat and bats. Regular expressions would be a great idea for a series of rec.pes.
In the most basic usage, grep will search through text looking for the search string. If you want to look for commands containing the string 'http' you would simply use:
..... | grep http | .... Grep stands for global regular expression parser and is a magnificently powerful tool. The important thing to take out of that mouthful is 'regular expression' which is a formal language for representing elaborate wildcards for searching. For example, a period matches any single character, so .at would match bat, cat, rat, and so on. Used in a grep statement, it would match that regular expression anywhere in the line, so it would also match brat and bats. Regular expressions would be a great idea for a series of rec.pes.
4 years ago
in Create a TAR archive of a directory | UNIX | Tech-Recipes on Tech-Recipes
Yeah, even with GNU tar, the hyphen is optional as indicated by the square brackets around the hyphen like [ - ] .. there are so many scripts and old timers like me around who user tar with the old hyphenless syntax that it would be miserable if it didn't work anymore.
4 years ago
in Configure Cisco router as a basic DHCP server | Cisco router | Tech-Recipes on Tech-Recipes
If I'm understanding what you are asking, the answer is that hosts that provide services such as DNS or HTTP need to have statically assigned IP addresses. While this can be done by configuring the DNS server to map a static IP address to the MAC address of the DNS server and have DHCP assign this IP address to the server when it asks, but it may be easier and safer to manually configure the IP address of the DNS server rather than use DHCP. One reason to do this is so that, in the event that you have to change the ethernet card in the DNS server, you won't have to rememeber to change the MAC address in your DHCP server.
The command
In the configuration above sets the values for DNS servers that the DHCP sends to clients for use in the client resolution of names.
If this doesn't help you, let me know what you are looking for and I'll try to help.
The command
dns-server 192.168.1.5 192.168.1.6In the configuration above sets the values for DNS servers that the DHCP sends to clients for use in the client resolution of names.
If this doesn't help you, let me know what you are looking for and I'll try to help.
4 years ago
in Hide password entry in Bourne/bash shell script | Bourne shell scripting | Tech-Recipes on Tech-Recipes
Neat trick! Beware that this is OS dependent. It works on all the Linux flavors I've tried but not a Solaris 8 system. If you are writing a script to run on many platforms, the old school method above may be more generic. But if writing a script for a specific system, this is a much slicker method. Thanks for sharing!
4 years ago
in Understanding Solaris runtime control scripts | Solaris system administration | Tech-Recipes on Tech-Recipes
You are exactly right. Great catch. Thanks for pointing out the error. I've fixed it in the recipe.
4 years ago
in Install a Windows 2003 DNS server | Windows networking | Tech-Recipes on Tech-Recipes
Wow, you guys are cold. To be fair, we'd need to read some of the critic's recipes to see how they compare. I bet that msman meant to add the recipes that you were looking for, but was discouraged by the flames. I think that small, focused recipes are great, install this, configure that.
msman, if you haven't been scared off and are still willing to share what you know, please add more recipes. If you do, we'll send you a Tech-Recipes t-shirt.
Q
msman, if you haven't been scared off and are still willing to share what you know, please add more recipes. If you do, we'll send you a Tech-Recipes t-shirt.
Q
4 years ago
in CMD: Determine the Mail Server for Any Domain | Windows | Tech-Recipes on Tech-Recipes
Oh, no.. I'd just gotten the dead smelly fish smell off my face from the last time..
4 years ago
in CMD: Determine the Mail Server for Any Domain | Windows | Tech-Recipes on Tech-Recipes
This is a great technique for getting the mail exchanger(s) for a domain. Most UNIX flavors also have nslookup, so this will work there, too. The dig command, where available, can be used to do this, too (dig mx domain.com).
It's important to note that the mail exchanger for a domain may not be the same as the domain's mail server. These days, most organizations use mail relayers of one sort or another to block spam, check for viruses, add redundancy, and take processing load off their mail server.
It's important to note that the mail exchanger for a domain may not be the same as the domain's mail server. These days, most organizations use mail relayers of one sort or another to block spam, check for viruses, add redundancy, and take processing load off their mail server.
4 years ago
in Free Spell Checker for Internet Explorer and Clones | Windows | Tech-Recipes on Tech-Recipes
Oh, you all have no idea what a relief this will be!!! I've been toying with the idea of adding a spell checker to the recipe editor, but I was afraid your recipes would take too much CPU power...
4 years ago
in DNS/BIND resource record: PTR reverse lookup record | BIND and DNS | Tech-Recipes on Tech-Recipes
The DNS side of this situation is straightforward. You need to have an A record for both www.foo.com and foo.com that point to the same address. The PTR records are not necessary from the Apache perspective, but are a good idea.
The Apache side can be more complicated in that there are several ways to accomplish what you are doing. Are you hosting other domains on this server or just one? If just one, you shouldn't have to worry about virtual hosts. Givce us some more detail about what you are trying to do and we'll try to help.
The Apache side can be more complicated in that there are several ways to accomplish what you are doing. Are you hosting other domains on this server or just one? If just one, you shouldn't have to worry about virtual hosts. Givce us some more detail about what you are trying to do and we'll try to help.
4 years ago
in How to Enable Remote Desktop Web Connections in Windows XP Prof. | Windows networking | Tech-Recipes on Tech-Recipes
The recipe reads accurately to me and delivers instructions appropriate to its title. Perhaps you were hoping for something else. The author lets you know that the connection will work with IE5. It is sad to have to fire up that browser when you have seen the light and moved on to another browser. If you want to use an arbitrary OS to connect to a remote host, VNC would be a better fit as there is an impressive list of clients available.
Your information about the TCP ports to open in order to access the remote system behind a firewall is helpful. One of the toughest steps to do when using software remotely is digging through the docs to find what ports to open. But, yes, you must open TCP ports to access services behind a firewall. It's like a law of physics that can't be broken.
Your information about the TCP ports to open in order to access the remote system behind a firewall is helpful. One of the toughest steps to do when using software remotely is digging through the docs to find what ports to open. But, yes, you must open TCP ports to access services behind a firewall. It's like a law of physics that can't be broken.
4 years ago
in Master Boot Record (MBR) Fix and Repair | Windows | Tech-Recipes on Tech-Recipes
According to MS here, this command does rewrite the MBR. It's important to note that this command is not applicable for XP/2000 or later. For those operating systems, it is recommended to use the fixmbr command from the recovery console. Here is a recipe describing that procedure.
It is reasonable to advise folks to be very careful with commands like these because of the potential harm they can do. Of course, if you can't boot your system because the MBR is damaged, there aren't many other choices...
It is reasonable to advise folks to be very careful with commands like these because of the potential harm they can do. Of course, if you can't boot your system because the MBR is damaged, there aren't many other choices...
4 years ago
in XP: Small, Free Way to Use and Mount Images (ISO files) Without Burning Them | Windows | Tech-Recipes on Tech-Recipes
There was a typo in the original recipe that has been fixed. The link in the recipe works now. Thanks for pointing this out!
4 years ago
in XP/2K/2003: View uptime of Windows system | Windows | Tech-Recipes on Tech-Recipes
Oh, hmm. Yeah, your way is a little better because it shows the actual uptime and doesn't require mental algebra (and knowledge of what day it is, which I generally lack). Your way generates lots of extra stuff I wouldn't want to see. I really wish Windows had more command line tools like (ahem) UNIX so I could pipe it to grep and pull out the uptime line...
123Next