Por donde amargan los pepinos

By the ass, by the butt (when referring to unpleasant situations where you are screwed). Examples: "Como no se espabile, le van a dar por donde amargan los pepinos".