CAIRO – In every corner of the Egyptian capital, a bustling city of 18 million that rarely sleeps, people are locked up in their homes at night under a military-imposed curfew that has driven people up the walls, sometimes literally.

To kill time, one said he spent the night counting flowers on his wallpaper — a staggering 865. Another tested how many cucumbers he can fit in a refrigerator drawer. A third calculated the speed of an ant crawling on his balcony rail.

The curfew has been a shock to Cairo, a city where cafes stay packed into the night and parents routinely take their children out for dinners nearing midnight. The two-week-old military-backed government's curfew, after violent unrest following the July 3 coup that ousted President Mohammed Morsi, slashed the typical Cairo 24-hour life to just 13 hours.

Forced to close early, businesses and restaurants are hurting in a city where night life is a key source of income. The city's metro system reportedly loses $71,500 a day.

So how have people handled what some online have referred to as "British boarding school hell"?

A few have defiantly attempted to break the curfew, dodging the abundant police and military checkpoints on major highways and overpasses. They have organized underground slumber parties, publicized among friends via social media and mass text messages.

'Not used to sitting at home'

One cafe in the upscale neighborhood of Zamalek even opened for the first time less than two weeks ago and almost all its business has come after curfew hours.

"The first few days we were conforming to the curfew, but then people demanded we stay open later and so we did," said manager Mohammed, who asked his last name and the name of the cafe not be published to avoid reprisals. "People are just not used to sitting at home or adhering [to rules]."

Four students at the cafe studied for a marketing exam for their summer course. "Before the curfew I am home. After the curfew I go out," Mahmoud Emam, 20, said.

Others chose to flee the heat and turmoil in Cairo to the Mediterranean coastline, where the curfew doesn't exist.

Many find it a challenge to fill the time. Some predicted a baby boom next winter. Cynics suggest a hike in divorce rates — spouses are locked up together for longer hours.

The Arabic Twitter hashtag "discoveries of the curfew" has become a way for some to vent their frustration. One man discovered that his refrigerator drawer can take 78 lemons or 65 cucumbers standing upright, or 75 if laid horizontally. Another mused that he has found 33 positions to sleep at night and 12 different ways to hug a pillow.

'Stuffing our face'

"Boredom is the devil. It makes you do things that you can never imagine," an Egyptian on a popular online video says. "We are turning into toothpaste tubes because of how much we are stuffing our face with food."

One activist declared she's only now realized it's been three years since she's had a job.

This is the second government-called curfew in Cairo since Egypt's 2011 uprising against autocratic leader Hosni Mubarak. The army tried it in 2011 but hundreds of thousands held their ground in Tahrir Square, demanding Mubarak step down. This time has seen widespread compliance. Part of that comes from fear, as more than 1,000 people had been killed across Egypt in recent violence. Others view it as a stand with the military against the country's ousted president and the Muslim Brotherhood, blamed by the government for inciting much of the unrest.