Repelling invasions of Argentine ants.
In California, we periodically have problems with armies of Argentine ants invading houses at certain times of the year. It doesn't matter how clean you keep your house or how carefully you maintain it, they'll still find a way in. They're quite small and routinely squeeze through cracks less than 1mm in size, which is roughly the size of the gap between a baseboard and floor in most homes out here. They invade (and I use that word carefully) in extremely large numbers, often in the hundreds; often your first sign is an inch-wide column of ants marching down a hallway. They don't seem to care much for sweets, so they ignore things like cookie crumbs dropped on the floor. The times of year they seem to make a break for the inside are when it's fairly cold outside (low to mid 50's Fahrenheit) or after a few continuous weeks of drought. I'm not entirely sure what they look for during cold times (my guess is they're in it for the warmth), but I have observed them pass up food that's been left out and garbage during droughts and head straight for sources of moisture: Rinsed out bottles and cans, wet paper towels, and sinks. They're certainly not afraid to make use of drainpipes to enter a house - I've caught them coming up through the overflows of sinks and the bathtub more times than I care to think about.
WARNING: This strategy is for houses that have neither children nor pets. Liberally laying ant poison down in a house is dangerous to both, don't do it. If you have children or pets in the house, you're out of luck. I can't help you. Call an exterminator.
Here's how I take care of this problem. I don't want to shill for any particular product or manufacturer, but I do want to be specific enough that this blog post is useful. I use wet ant baits (basically containers of liquid ant killer) and an insecticide powder that is primarily boric acid. Read the ingredients, and get the biggest bottle you can because you're doing to go nuts with the stuff.
First up, figure out how long, roughly speaking, the ant phalanx is. If you can break it into thirds or quarters (or, ye gods, fifths), do so by placing liquid ant bait equidistantly. Make sure that you put each ant bait right on top of the column of ants so that they're sure to find it. This is so that you kill more of the ants faster; you'll prevent them from advancing any farther into the house and you'll basically be executing multiple kills simultaneously. Don't worry that you're wasting the stuff becuase you're not. Second, figure out where they're coming in from. You're probably going to have to get down on your hands and knees with a flashlight, and work backwards along the column of ants. When you find it (and you'll undoubtedly be cursing the day you were born by that point), drop another liquid ant trap right in front of the entry point. Then crack open that bottle of insecticide powder and wall off the entire area that they're coming in through. Be sure to pen them in along with that last liquid ant bait you laid down. You're going to make a mess. You already have a metric fuckton of ants in your house. This prevents any more ants from coming in: The ants that are sufficiently motivated to try to cross the line of insecticide are going to die in the attempt. The ants that manage to keep coming in from outside are, as before, going to head right for the liquid ant bait and carry little droplets of the stuff back outside to the nest, which is going to chop down the ant population considerably. Some of the ants will have a fine coating of insecticide powder on them, and they'll track it back through the walls of the house, and possibly back into the nest. See how I got the stuff on top of the baseboard? That's to keep them from climbing up the walls to avoid the insecticide (yes, they do that). While you're at it, take a look around for other large-ish gaps in the baseboards or walls and shoot some of the insecticide powder down inside of those, too.
Now, go do something else for a while. I recommend getting out of the house for the rest of the day to take your mind off the situation. You've no doubt spent an entire day coming up with creative new ways to swear, you need the break.
Some time during the next day, take another good look at the floor and see what kind of progress has been made. If all's gone according to plan, there will no longer be a conga line of hundreds of ants marching across the floor because the carpet bombing of ant poison you've carried out will have taken care of them. There should be lots of dead ants piled up around the liquid ant baits and lots of dead ants piled up in the insecticide powder you laid down. If not, figure out where you need to reinforce (maybe there's a low-hanging cable that they're using to avoid the boric acid powder? (yes, I've seen them do that)) and cut 'em off.
When you've gone a day without ants taking over your house, sweep and mop the floors with ammonia solution. This will remove the scent trails that ants use to self-organize. After the floor's dry, put the liquid ant baits back in the same positions and lay a somewhat more thin line of boric acid powder across the entry point you found.
If they're coming up through sink overflows, get the liquid ant bait that comes in an oversized syringe, and just squirt it into the overflows. It won't hurt you because water's supposed to go down those inlets if the sink's too full. Be sure to coat as much of the inside surface as you can so the ants are sure to find it. Individually, they're not terribly bright; en masse, they seem to opt for the path of least resistance. If you put what they're looking for directly on top of them, they'll stop advancing because there will be a ready source right there.