Images corrupt after git push

I had this issue too – here’s a generic .gitattributes that looks generally safe for php web repos that worked for me: https://github.com/Danimoth/gitattributes/blob/master/Web.gitattributes running git check-attr –all — path/to/png before and after adding the new gitattributes showed that the image file was originally treated as a text file, and now it’s binary (note I had … Read more

SQLite3 database or disk is full / the database disk image is malformed

To repair a corrupt database you can use the sqlite3 commandline utility. Type in the following commands in a shell after setting the environment variables: cd $DATABASE_LOCATION echo ‘.dump’|sqlite3 $DB_NAME|sqlite3 repaired_$DB_NAME mv $DB_NAME corrupt_$DB_NAME mv repaired_$DB_NAME $DB_NAME This code helped me recover a SQLite database I use as a persistent store for Core Data and … Read more

How to fix corrupt packet error for with rsync for (relatively) large files?

I’m not sure what might cause the corrupt packet problem that drops your connection, but you might find rsync’s –partial or –partial-dir option helpful when transferring large files so that when you restart the transfer it will continue where the transfer left off instead of having to start over transferring the whole file again: –partial-dir=.rsync-partial … Read more

Mercurial repository corruption

Recent versions of Mercurial (since 1.5) support validation of incoming data. Add [server] validate = True to your server’s hg config (either .hg/hgrc or the hgwebdir config should work fine) to have the server verify incoming data and refuse invalid pushes. The client will then see an error akin to: remote: abort: missing file data … Read more