Each afternoon, Imahmed Esheiban rushes home from his day job as an air force supply officer to collect Kalashnikov rifles from his neighbours.
He sits behind a battered desk in the local police station in front of a big ledger book, carefully writes out a receipt for each weapon and marks it with the thumbprint of the man who turns it in.
"We just want everything to get back to normal," said Mr. Esheiban, a small harried-looking man, as he crossed off another name from a list of 270 suspected arms hoarders in the Shuhada abdul Jaleel area of western Tripoli. "We're not here to run things permanently, just to reassure people that they are safe."
Mr. Esheiban is part of a volunteer army of clerks, dentists, shopkeepers and students who are running the day-to-day affairs of the capital – street by street and neighbourhood by neighbourhood.
While the national rebel leadership is trying to form an interim government and put down the last bastions of resistance outside of Tripoli, ordinary Libyans have taken charge of their lives in ways that were never possible before.
Barely three weeks after rebels fought their way into Tripoli, ending Libyan leader Moammar Gadhafi's 42-year rule, local governing committees have instilled a sense of stability in this city of nearly two million people.
Each neighbourhood now has its own citizens' council, some selected in secret during the uprising and others elected in the days following the fall of the Gadhafi regime. They are collecting trash, compiling lists of suspected Gadhafi loyalists, hunting for hidden weapons and feeding the fighters who man checkpoints.
But in the absence of a formal government, they are also dealing with the thornier issues that face Libya as a whole in deciding whether to purge or pardon those who co-operated with the former regime.
"We all knew each other here. We played football together. We went to school together," said Abdul Hamid Magafa, who normally works in the post office but now spends his days running the volunteers who oversee the 30,000 people living in Shuhada abdul Jaleel.
"We can distinguish between those who loved Gadhafi and those who didn't," he added. "And we don't have a problem with people who loved him. Our problem is with those who killed people or took up arms on his behalf."
The citizens' committee operates out of a compound that once housed the tourism police, who acted as guards and minders for visiting foreigners. The old squad room is filled with mattresses for volunteer gunmen who patrol the streets. The parking lot outside contains, incongruously, a golf cart along with a collection of pick-up trucks and confiscated cars spray-painted with anti-Gadhafi slogans.
Mr. Magafa and his fellow committee members, led by an army colonel who was known to side with the rebels, started working together in secret during the six-month-long uprising.
They met in each others' houses to pass messages from the rebel commanders outside the city. Men they trusted were approached and armed to fight once the attack on Tripoli began. A plan was devised for what they hoped would be an orderly transition once Colonel Gadhafi was gone.
The first few days were more chaotic in the neighbourhood than they expected, in part because the northern reaches of the neighbourhood border on a seaside compound of luxury apartment buildings used by Col. Gadhafi's relatives. There was shooting and some looting there.
This week, a few young men were picked up after firing weapons into the air from the abandoned villas by the sea. They were just drunk, according to Mr. Magafa. But two men from the neighbourhood, who had bragged openly of fighting with Gadhafi forces in the uprising in eastern Libya, were nabbed and turned over to the rebel military command in Tripoli.
The past weeks have been tense. Watching foreign television channels during the uprising was grounds for arrest. Neighbours denounced neighbours. The imam in the local mosque parroted Col. Gadhafi's exhortations against the "rats" and "American spies" he said were trying to steal Libya from Libyans.
In the final days, high-school students were rounded up and loaded onto buses to be taken for a few days of weapons training. Mr. Esheiban, the committee member who is in charge of logging in weapons, said he appealed to a doctor friend to admit one of his sons to the hospital to keep him from being drafted.
Now, scores are being settled. The imam who railed against the rebels, for example, was told forcefully to leave his post and not return.
"In every mosque they were monitoring and spying and collecting information, and sending it all to the internal security," said Colonel Fadil bin Mahdi Abubakr, the commander of the citizens' committee. "We know they were ordered to do it by Gadhafi. We are focusing instead on those who volunteered to do his dirty work or who have blood on their hands. Those we are going to treat very harshly."
Each neighbourhood also had its open spies in the form of internal security agents whose job was to report each sign of disrespect toward the Libyan leader and any hint of criticism of the regime. They were especially active during the six-month uprising, when people suspected of supporting the rebels were jailed and, in hundreds of cases, killed.
So Mr. Magafa said he was not surprised to find his name on a file when he leafed through the archives of the neighbourhood branch of the internal security service. "I knew the guy there well," he said. "I saw that he accused me of inciting people to demonstrate against Gadhafi."
But he said he was taken aback to find documents showing that his boss at the post office was also a secret spy. "We never knew that," he said. "I knew he was incompetent. He knew nothing about communications and had his job because he supported Gadhafi. But, frankly, I didn't realize he was on the payroll of internal security."
He said he has since confronted the man, who pleaded that he was obliged to denounce at least some of his underlings or his own superior in the security agency would denounce him.
The chief activity of the citizens' group is now the search for weapons that were distributed by the regime in the weeks before the attacks, when Col. Gadhafi threw open weapons depots and urged people in the city to arm themselves to repel the rebels.
The committee in Shuhada abdul Jaleel has already sent letters to people it believes took weapons. Once three days have passed, it sends out a team led by a fierce-looking shopkeeper named Haitham al Tayari, whose wide girth and bushy beard made him a natural choice to be the enforcer.
He said he rarely has to use force to get people to give up their guns, but takes armed men with him all the same.
The spirit of solidarity could evaporate with time. But for the moment, the neighbours appear firmly supportive of their self-governance.
As the sun began to set earlier this week, three pick-up trucks loaded with volunteers in camouflage uniforms and T-shirts took off in a screech of tires to serve their rotation on checkpoints in the area.
As they sped away, two little girls waving flags cheered them on as their father waved. "Too bad for you, Gadhafi," they chanted, as the rebel gunmen passed. "You'll never get the country back."