Showing posts with label bash. Show all posts
Showing posts with label bash. Show all posts

Saturday, December 29, 2012

Recovering Android Photos with Linux

As noticed by others on the Internet, it is possible to recover photos from an Android phone that were deleted. It is impossible, as far as I know, to recover the full resolution photos. You may, however, recover the thumbnails and those are often large. This also allows you to recover photos which weren't saved, like those from text messages. The problem though is that methods I found while googling require you to edit the image files in a hex editor. For example, as demonstrated in this video. I've instead written a python script which automates this greatly simplifying the fact that you need to recover all the pictures to find one in particular.


Friday, July 15, 2011

Latex to PNG to Blogger

I just wanted to put at the top what you need to follow along with this post. Everything below is written assuming you're using a Unix terminal and you have pdflatex and imagemagick installed. For Ubunu, the de facto linux distribution, type this into your terminal window to get these programs:

sudo apt-get install imagemagick
sudo apt-get install pdflatex

Due to my failure in making nice looking equations in my last posts, I worked on discovering a solution. Naturally, I tried to google Latex and Blogger. Latex is what I usually use for formatting equations, so that is what I was hoping to find. Unfortunately, most of the ideas I found for inserting equations into Blogger relied on hosted scripts and random people providing image hosting. I tried two solutions described in blogs and both didn't work, due to the site hosting the rendering engine being down. If you would like to convert LaTeX code directly into PNGs on the web, you can try codecogs, but I find the website to appear pretty Spammy and you cannot have very much control over your results. But, hey, it works.

Next idea: use Latex to write equations, use pdflatex to turn them into PDFs, and then use ImageMagick to convert the PDFs into PNGs. Easy, right? Well, here are the results: