You may have heard that several vulnerabilities came out recently for Flash, thus Mozilla decided to deactivate the Flash plugin in Firefox.
How to remove Flash completely?
$ sudo dpkg --remove flashplugin-installer
Goodbye Flash, you won’t be missed!
No sound problem
In Firefox, playing HTML5 videos I had no sound. Here is how to fix it. Install the program “pavucontrol” and start it. On the Playback tab, HDMI was selected by default. Changing it to “Built-in Audio Analog Stereo” the sound came back.
You know the URL of a webpage and you want to take a screenshot of it. For instance you want a thumbnail about the webpage.
It can be done very nicely with PhantomJS.
What is PhantomJS?
How to install PhantomJS?
Follow the instructions here. Under Ubuntu I compiled it from source to get the latest version. Note that it takes a lot of time (about 30 minutes). Under Manjaro I could install it via
yaourt and it took 1 minute (and got the newest version). The good news is that installation is not a problem.
How to take a screenshot?
If you download the source, you get a lot of example scripts. One of them is called
rasterize.js, and this is exactly what we need.
$ phantomjs rasterize.js Usage: rasterize.js URL filename [paperwidth*paperheight|paperformat] [zoom] paper (pdf output) examples: "5in*7.5in", "10cm*20cm", "A4", "Letter" image (png/jpg output) examples: "1920px" entire page, window width 1920px "800px*600px" window, clipped to 800x600
phantomjs rasterize.js http://raphaeljs.com/polar-clock.html clock.png
phantomjs rasterize.js https://www.reddit.com/ red.png
It produced an image with dimension 600×3304. It’s too narrow, let’s fix that.
phantomjs rasterize.js https://www.reddit.com/ red.png 1024px
Its dimension is 1024×2432. Looks much better.
The previous image was too high. Let’s take a photo of that part that would be visible on our screen. For this we need to clip a window.
phantomjs rasterize.js https://www.reddit.com/ red.png "1024px*768px"
Great. Now scale it down to get a thumbnail.
Scaling down an image to thumbnail size
$ phantomjs rasterize.js https://www.reddit.com/ screenshot.png "1024px*768px" $ convert -resize 250 screenshot.png thumb.jpg
convert comes from the ImageMagick package. Here we resize the image to width 250px. Convert will keep the image ratio, i.e. it figures out the height value.
This text editor is developed by GitHub. I remember the early versions didn’t exist for Linux, so I was disappointed, but this is no longer an issue. The editor is cross-platform and since version 1.0 came out, I decided to give it a try.
It’s very similar to the excellent Sublime Text editor. It’s visible that they copied lots of things from it :) However, ST is not open source and there is one guy behind ST, Jon Skinner. Atom is fully open source with a large community behind it that is hard to beat…
How to use Atom for Python editing?
I found a blog post that can get you started: http://www.marinamele.com/install-and-configure-atom-editor-for-python . In addition, I also installed the package ‘
script‘ that lets you run your script inside Atom.
Atom has the nice feature to change your settings via a GUI. In ST you need to edit JSON files directly.
All in all, Atom seems to be a nice editor. It’s still version 1.0, so I’m sure it’ll improve a lot, but I already like it.
“16 free data science books for the aspirational data scientist, covering statistics, Python, machine learning, the data science process, and more.”
reddit comments here
If you want to get info about a movie (e.g. rating, cast, etc.), there is imdbpy, which collects data from IMDb. I just found that Rotten Tomatoes has an API too: http://developer.rottentomatoes.com/.
Update (20150622): about two weeks ago I asked for an API key. I’ve got no response since then…
Update (20150623): I got an answer from them! Here it is:
Thank you for your interest in the Rotten Tomatoes API. Unfortunately, we are unable to grant access at this time. Due to changes in our syndication program, we're currently only offering free API access to domestic students. This may change in the future as we add additional tiers to the program. -The Rotten Tomatoes Team