Ultrasurf likes to disconnect when there's no traffic in a long time. here is a bash script that you can run in order to prevent that.
Ultrasurf as a Linux daemon
There's a bash script called ghostship that automatically installs/updates Ultrasurf and runs it like a Linux daemon (no GUI).
It also tries to keep Ultrasurf connected and restarts it when it is not.
5. Run Ultrasurf from within its prefix. At the first start, you are better off disabling the "golden lock" icon which is not really helpful anyway.
6. To do this, click "Option" a hundred times until a new gui comes up (you really need to click a few times, because while the lock is activated, the gui does not quite get all the clicks).
7. Click "Hide Golden Lock" as well as "Do not use IE" until the boxes are checked
8. Click "OK" until the gui disappears
9. Click "Exit" until the main gui is also gone
10. Restart Ultrasurf as in 5. and you are ready to go.