- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
I type "rm -rf" all the time, and as a Linux sysadmin, it always makes me twitch. What's scary is how fast I can type those exact chars in the blink of any eye, from typing them so often.
Admin
Not so trivial. That's how the Great Depression started.
:)
Admin
I always start the line with "-- DELETE", type the rest of the line, CTRL-A to go back to the beginning, delete the comment marker, then run it.
Admin
I just pulled a good one the other day. We had a server sitting idle that a cow-orker and I had wiped and installed ESXi on, and renamed SUPERNOVA. It had no network cables running to it, so I put in a datacenter ticket to have them run and have the server relabeled from FOOBAR1 to SUPERNOVA. Came in the next day to an e-mail from the ex-Marine DC manager: "I ran the cables but there's no link light, I think your server's not configured like you think it is."
I confirmed with the network guys that the switch ports were active, then I went down to the datacenter to have a look. As soon as I stepped in front of the rack I realized my mistake: the server we reformatted was FOOBAR2, not FOOBAR1. Fortunately FOOBAR1 was an idle, powered-off server that we had scavenged parts from (which is why its name was in my head), so it wasn't a live production box or anything, but it could easily have been.
I sent a mea culpa e-mail and took my well-deserved razzing from the DC manager.
Admin
I'm not sure if there are any tools that have this kind of support for the controller you use, but I feel like I have to add the following ;-) <snark> ProTip use a development environment that gives you the tools you need. </snark>
Admin
Back before I happily earned my living with programming I worked at PC hardware shop during college. It was when most people had already upgraded from Windows 3.1 to Windows 95. A customer brought us a PC with Windows 3.1 which had some kind of a problem that I don't remember. Relying only on my experience in school's computer class I decided to simply reinstall. I have rarely seen anyone as angry as my manager was after he found out. It turns out that people tend to, you know, keep stuff on their computers that they don't want to lose, but that was the least of the problems. Back in those days you got drivers on floppies and those floppies were usually lost and drivers hard to replace. So in the end there was a freshly installed PC without files and with devices not working for the customer to enjoy.
Admin
rm * .o versus rm *.o
Maybe there's a reason most modern build scripts put the .o files in a different directory than the source files.
Admin
I have two nits to pick on the second story. First, not giving a food pellet is not negative reinforcement. Negative reinforcement is when you punish the wrong behavior (like shocking the poor critter). Second, one of the few things I remember from being a psych minor is that inconsistent positive reinforcement is more effective than consistent reinforcement. Meaning it's better to only sometimes give out the food pellet.
So it's a feature, not a bug!
Admin
I once deleted all of the images from my office's product database. (Due to the magic of Windows 2000 symlinks, I thought I was cleaning up an unnecessary extra copy.) Fortunately, the IT manager had arbitrarily decided that the night before was a good time to randomly back everything up for the first time in six months.
Related, at my current office, we lost 2 disks of our raid array simultaneously, then discovered that our automated system had been backing up a symlink to our precious files, rather than the precious files themselves.
Admin
Admin
The article never says "negative reinforcement"; it just says "negative feedback", which, AFAIK, doesn't have a specific psychological meaning.
No it isn't. That's called punishment. (Specifically, the addition of a negative consequence to undesirable behavior is punishment.)
Negative reinforcement is the removal of something bad as a response to correct behavior.
(From wikipedia: "Turning off (or removing) an annoying song when a child asks their parent is an example of negative reinforcement (if this results in an increase in asking behavior of the child in the future). Another example is if a mouse presses a button to avoid shock. Do not confuse this concept with punishment.")
And you were a psych minor? This is like psych 101 stuff, albeit psych 101 stuff that is commonly misunderstood.
Admin
< start general rant :D >
Why do you people seem to insist that the problem is just not selecting the correct tool and that I have a choice when developing industrial solutions.The only choice I have is to not work in the field. There is no choice of tools. At the control systems level it is all vendor driven, proprietary and tied to the hardware. Microsoft would give its virtual left nut to have the sort of lock-in that occurs in industry.
Yes the major players all implement IEC 61131-3, but that doesn't mean jack. You can't just up and replace one brand of PLC with another like you can replace an HP server with a Dell server. So you are stuck with a vendor and stuck with the tools that a vendor will provide. < / end general rant>
Admin
dont know if this was said yet, but i always end my delete queries with 'limit 1' just incase
Admin
The PLC equivalent to #ifdef or #debug is using a programming tool to force boolean bit values (or external I/O bit values) to True or False. Sometimes, these bits control the operation of huge, expensive pieces of machinery.
The PLC equivalent of leaving the debug code in, is forgetting to unforce the bits. With some programming products this is real easy to do.
Admin
My big oops. Back in the Windows 2000 Active Directory days, there was a bug that the sysvol share did not replicate properly. The fix from Microsoft was to backup the sysvol share, delete a folder from every domain controller and then copy the folder back to one domain controller and replicate. Once I deleted the folder from one domain controller without backing up the sysvol share. I immediately noticed my mistake and check the other domain controllers but no folders where found. Right when I deleted the folder, the domain synced. I basically replicated death and wiped out the whole Active Directory structure in the matter of minutes. Needless to say, we didn't have any backups and I spent a couple days running scripts to rebuild AD.
Admin
I have a "rm -rf" one as well.
I was deploying something on a production server. An ant script was used to do this. I had edited a variable in the ant script to point at current user's home directory, "~/whatever", where some files were to be copied.
The ant script didn't seem to work. After wondering why, I noticed ant had created a subdirectory "~" instead of referring to the home directory. And before I even noticed, I had typed "rm -rf ~".
Admin
begin transaction delete from table -- oh noes! rollback transaction -- whew!
I've done that numerous times.... just gotta make sure you're not locking down some important table with the transaction.
Admin
by "that" I ONLY mean't using the "begin transaction" trick, BTW I also have used the appending a where clause.
Admin
Back circa 1995, when a Unix server was no longer required for its job of verifying accounts, handling print queues emails and all the other things that take 5 windows boxes to do, it often got demoted to a low impact application server.
One of these was handed to us, but it was low on free space, and I noticed it hadn't been properly wiped. So I decided to clear out financial and purchasing records, which was when I realised I wasn't telnetted onto that box, but was on the new main box.
Si I did a restore, did a CHOWN to put the ownership back as it should, changed the permission back.
It didn't quite work, but I covered up my tracks enough that the central sysadmin couldn't figure out who had f***ed up and I learned not to do that again
Admin
I've had 2 big cock-ups, both caused by executing shell commands with super user priviliges.
The first was a series of commands that included a mv (something like mkdir tmp; for FILE in
find .
; do mv ${FILE} tmp/${FILE}; done. ) As it wasn't working with my permissions, i changed to superuser, forgetting that with the change of account, I was suddenly in the root directory. All of sudden, the error "command not found" started to come up (and pretty soon end users were ringing to ask why they were having a whole host of issues logging in)... Doing things as root is never a good thing, nor is using relative paths, nor is not echoing output as we go....Second f-up, was as (non-root) but user with ownership of most of our applications file. I was retrieving logs that are tarred with their absolute path prefixed by . (period) , so that when they are untarred, they hold their original directory structure below the current directory. When deleting these logs, I forgot to use the ., and instead started to remove entire directories in the original path....Things very quickly went pear shaped.... lesson: Use Absolute, Absolute paths, avoid super users when possible, and, mos importantly THINK
Admin
Just ask yourself, what would Jessica Simpson and Megan Fox do in a situation like this?
Admin
I have a bank related nightmare too. I worked on an app that processed large value wholesale currency transfers. These transfers entered out system and were processed straight away, that is, unless they were future dated.
In this case, they were saved to a database.
Every morning a process started up to detect if there were any future dated transactions that were due for payment today and if there were it sent them off to the payments system for processing.
Well, day one, the system goes online for the first time and everyone was amazed that all our hard work had paid off. The system churned through about 1 Billion dollars worth of transactions and despite a few memory leaks and server restarts, everything worked perfectly.
Day two was pretty much the same as day 1, all good.
Day three, the sh1t hits the fan.... The process that looks for and pays any future dated transactions starts and processes not only todays payments, but also those that had been paid yesterday. I had forgot to update the paid status of those future dated payments, that had already been processed the day before.
What resulted was a really shitty day, $6 million had been over paid and my only comeback was 'it should have been tested'. Anyway, eventually we got the money back, but lost $50K on interest. My boss was pretty good about the whole mess, and apparently there was money in our budget for such a problem.
It didn't stop me from going to the pub, buying and smoking a whole pack of ciggies ( and forgetting to remove my nicotine patch ) that night.
Admin
Admin
Wanted to add my own OOPS.
Forming a URL query string, and somewhere I forgot to put in a ampersand. >.<
Admin
Mine was on our Sharepoint servers... which were still waiting to get a staging and live environment, so we were editing on live.
For those of you familiar with Sharepoint, the 'Delete this site' feature is dangerous, and something that IMO really shouldnt be on the web front end.
Especially when you forget to check the URL of the site you think you are deleting, and instead, destroy the whole site collection.
Admin
Admin
I read the same thing. The cliche'd Pavlovian response that everyone hears about isn't the most effective situation. You want to only SOMETIMES reward the desired behavior. I'll leave it to the psych majors to explain that one.
Admin
Is this your first day on this site?
It's filled with naive, idealistic kids who think "WTF? Just change the toolset, environment, platform, vendor agreements, SLAs, policies and procedures, and get on with it."
To those of you that fall into that category, please wait until you've spent some time working for big companies. Or until you have a mature system that can't be easily re-written because of dependencies or other reasons. Oftentimes, you can't just say to your boss "The real WTF is this Java shenanigans. Who cares if it's business critical. Just throw out the entire system that hundreds of thousands of man hours and millions of dollars was spent building. I'll re-do it in .NET! And I know I'll do it right because I'll use the tools that I prefer; which is what matters..."
Admin
Probably lean forward over a desk, slowly.
Admin
I created a robocopy batch file to mirror a directory from a primary domain controller to a backup server. My script set the working directory using an administrative share, then ran the robocopy command using the current working directory as the destination.
This all worked fine in testing, so I set it as a scheduled job in Windows under our scheduled tasks user and gave it another test run, unfortunately the scheduled tasks user cannot access administrative shares so the command to set the working directory failed leaving it as the windows 2000 default: C:\
The robocopy command ran and since it was a mirror, it proceeded to delete all files from C:\ on the PDC, I went to check the log and saw it deleting everything and cancelled the job, but not before it had deleted half the files from the server.
Restored from a backup, but didn't realise that Backup Exec stores the Windows boot files in System State and not in C:\ so when the server came back up after the restore I got the dreaded "NTOSKRNL.EXE is missing or corrupt", by this time it was 8:00 PM, so I went home (09:00-17:00 support service). I spent that night making a boot CD and had the server back up by 9:30 the next morning.
Needless to say, I now triple check all my robocopy scripts.
Admin
I start by typing the WHERE clause, then move to the beginning and fill in the UPDATE/DELETE...
Admin
Admin
Yes.. They help.... (lawsuits do not fix problems).
Admin
Google for "always mount a scratch monkey" for really classic WTFs in this vein.
Admin
I think SQL is a total screw-up as a language. I managed to delete 3000 customer records by the same mistake.
I think someone should redesign the language so that every statement starts with WHERE.
Besides, WTF with "IS [NOT] NULL" as opposed to "[!]=NULL"? How many wasted lines of code does this generate? Why is it a big difference if the value is null and we can't use a generic binary comparison operator on it?
Admin
One idea my old boss had which I think people can learn from. (This is not a joke)
Disable the watchdog during testing.
If it fails: find the bugs in the code and fix them.
Don't use the watchdog to recover from bugs in the code. Use it to recover from "gravity has failed" kinds of faults. Like when the CPU locks up, network controller freezes the bus etc.
After testing, (there are no bugs for a week/month/etc of testing ) THEN enable the watchdog.
Your mileage will not vary significantly. Should your boss not be interested in this kind of reliability, get it in writing. Then the next time a $1.5M system breaks, you keep your job.
Admin
What a nice bloke! Makes a change on this site!
Admin
At last we have found the cause of the banking crisis!
Admin
Admin
I am in Thailand. We are an agricultural company. In the springtime we buy from farmers. The operator types in the farmer code and then operates the program to put in bale weight and quality. It creates records and pay slips.
One winter I modified the program so it has a list of the farmers codes and names. When you type in the code, it shows you the name, and prints the name on the pay slips. I tested it extensively, many times, and it always worked. Code goes in, name comes up.
The first day of actual buying: hundreds of farmers are there to see how much we're paying; top management is there to make speeches. Finally we start. First farmer comes up, the operator types in his code number. Up pops his name. Operator says (in Thai), "That's not him!" Oops.
After two seconds of thought I knew what caused the bug. I asked them to wait an hour. Fortunately I had my notebook computer with me, and in that hour I was able to find and fix the bug and give them a new version of the program. Then all went well.
The bug was that in my farmer code hash table I had a modulo that was too small. Short test lists of farmers did not hit the modulo. On tests of long lists of farmers, a Thai name came up and I had no idea whether it was the right name. Hey, I got a name, right?
So that's the phrase that keeps me awake at night: "That's not him!"
Admin
Admin
At one point, after having downloaded the Windows Beta, not wanting to waste a consumable (blank DVD) "USB install" I think.
Following some randomly pulled up guide from google I get to the part where you repartiton the flash drive and mark it as bootable.
Disk ### Status Size Free Dyn Gpt
Disk 0 Online 298 GB 0 B Disk 1 Online 298 GB 511 MB Disk 2 Online 4 GB 0 B
"Hmm.. why is this taking so long... and why is my hard drive light flashing"
The operation completed successfully.
I get a balloon from µTorrent telling me it can't find a file. Then another one. And another. My music stops playing. My email client crashes. Process Explorer goes away. My desktop goes blank.
"Oh. Oh Shit!"
...
Note to self: just because it has a number in megabytes doesn't mean it's not a hard drive.
...
After some frantic googling, I find a program called "TestDisk". Press a few buttons, it recreate partition table.
Everything is right in the world.
I still don't have any backups. Oh well, it's my box I'm screwing =P
Admin
Admin
I've been at my current company for several years now and have had no major production failures. Unfortunately, this is at least in part due to the fact that we've never managed to sell our product to anyone.
Admin
That doesn't stop you from running m4 (or even gcc -E) over your sources before you feed them to the embedded tool.
Complaining about an environment that only takes source code for input and doesn't provide a macro language is just kind of silly given all the macro processors available.
Admin
That sounds like quite a feat.
Admin
How do you say "That's not him!" in Thai?
Admin
You're still better off testing your where clause with select first. Even if it only deletes one row, are you sure it deleted the right one row?
Admin
Admin
Yeah, I normally used to write my where, then my delete. I'd start with "where userid=40;" and then I add "update users set password=sha1('whatever')" before that. Then one day I hit the semicolon by instinct just before enter.
update users set password=sha1('whatever'); where userid=40;
ERROR: There is a syntax error near "where userid=40;"
in short order, I