A judge has sentenced a San Francisco Chinatown gang leader known as "Shrimp Boy" to life in prison for killing a rival.