Select all Google Photos (or Videos)

TL;DR – Code available on GitHub here.

Few weeks ago my uncle told me that he was unable to receive any new emails. A quick investigation led us to the idea that he had no more space left in his Google account, and that was caused by the hundreds and hundreds of photos and videos he was taking, that were automatically being backed up to Google Photos service.

So the solution was simple, all he had to do is deleting some of the old photos to clear some space. but simple as that sound at first, turned out it wasn’t that an easy task after all.

While Google Photos easily and automatically uploads all your photos and videos, removing the files is a hard, Sisyphean task.
The closest available solution online is to manually select a range by holding Shift button, then scroll a little and select more. And while this is fine when you have few hundreds of photos, when you deal with tens of thousands of photos this doesn’t hold water.

Since I couldn’t find an automatic solution to the process. I’ve decided to use some of my spare time to write some script to automate the it.

How does it work?

The script is pretty simple. It selects all available photos/videos on the visible page, then scrolls down the page and repeats this process, until it arrives at the requested limit.

How to use it?

My solution is a JavaScript snippet that you should execute on Google Photos page. so if you’re familiar with web development just grab the code here.

For those who aren’t familiar with JavaScript:

  1. Grab the code from here. just select all the the content of the file and copy it. then browse Google Photos and wait for the page to load.
  2. Press Ctrl+Shift+J (or Command+Shift+J on MacOS) on your keyboard to open the Console and press anywhere on the console to change focus from the page itself to the newly opened console
  3. paste the content of the script you just copied into the console and press Enter to execute the code.
    What we just did was to define the function of selecting the photos/videos.
  4. On the console now type :
    selectPhotos(300, 'any');
    make sure to replace 300 with the number of photos limit you want to select. if you wish to select photos or videos only, you can replace ‘any’ with ‘photos’ or ‘videos’, respectively.

Now just press Enter again and let the magic (code) begin 🙂

I really hoped I saved some people’s time and frustration. If you have any questions on how the code works i’d be happy to answer, and as always I’m glad to have pull requests.

Dor.

Awesome!!

Hey guys (and girls),

For a long while I’ve been happily using Fluxbox, and actually I must say, that I started to get a little bored. The reason I moved to Fluxbox is to stay away from limiting-WM, like Unity or GNOME3. but after a while using Fluxbox, I felt I want something even more hardcore, that will give me even more control on my computer.

After a talk with my roommate (which just recently installed Linux, and quite quickly became a Linux master :D), We decided both to switch to Awesome WM, which from the current point of view, seems like a great decision!

Awesome is acutally named after Barney Stinson!

Awesome is acutally named after Barney Stinson!

Few words about Awesome and what makes it so awesome:
Awesome is a very lightweight, dynamic WM, in which you are able to modify just about anything. You have one (very long) configuration file named rc.lua, and yes, all the configuration is in Lua. actually the configuration is way more than just configuration, it’s the whole WM: widgets, toolbars, the way windows work, act and move, shortcuts, mouse actions, menus and more and more and more – everything is lua scripts, extremely configurable.

As I mentioned above, the configuration is huge lua file, containing just about anything in the wm, which makes it hard to read, and easy to mess. for that reason one of the first things I did after installing Awesome, is to split the configuration to several files, and by that making it very easy to understand and modify.
Of course that if I can think of something, probably it’s already in the internet, so after some googling I found phyber’s splitted rc.lua, which gave me a great something to start with 🙂

Some more stuff I wrote for my configuration:
Language switcher (which made me write a patch for xkb-switcher)
– extremely generic startup autorun
hacked Calendar35 a little bit to work with my local configuration

might wanna have a peek in my Github repository.

Anyways – any awesome users out there? I’m looking for tips, ideas, and mostly people for showing off from time to time (my gf isn’t impressed too much from my geeky shit :P)

Dor 🙂

Download all dependencies of a package on Ubuntu/Debian

UPDATE: Thanks To Julian, Now I know you can simply use

aptitude download ‘?reverse-depends(PKGNAME)’

Awesome.


Hey there!

Several days ago a colleague asked me if there’s a way to download the dependencies of a package in a Debian based distribution, for an offline use.
Sound like an easy task, and after a while of thinking, i got remembered in a tool that used to ship with Ubuntu back in the days, called “Synaptic”, that used to have that tool.

However, there are some cons to that tool. first of all it’s a GUI one (GUI? Eeeeww!”), and second, it downloads only the packages missing to your current installation, so if you’re offline installation dismatch your own one, you’ve got a problem.

So I decided to take it as a challenge, and ended up with a little script I hope will help ya’ll. And you may find it in my github of course…

https://github.com/Ddorda/dl-deb-deps/blob/master/dl-deb-deps.sh

I think it’s pretty much straight-forward code, but if you have any questions you’re more than welcome to ask.

Dor.

Back to Flux

Hey there all,

It’s been a while since i wrote last time. sorry for that, i’ve been really busy recently… Hope to find some more time to write in the future.

I decided to write again for a really good reason: After a really long time that i’ve been using a standard plain Ubuntu installation on my laptop, I decided to change back to Fluxbox! Hurray!

I hear many people saying how Ubuntu is getting lame lately, and how Unity is the worst WM ever. I extremely disagree. Ubuntu is going very straight forward toward their great goal: bringing Linux everywhere, and you can’t say they’re not trying their best. every time a new Ubuntu version is released the whole network is buzzing, once again Canonical broke the rules when playing with something that should never be touched in the UNIX world (Pidgin? GDM? GNOME? Xorg? remember all those?). Canonical has a vision, and they do w/e they can to get there. I don’t always agree with what they do, but they touch any taboo they can, and that’s awesome.

A word about Unity: it coud be better. for ex. i can’t see why they removed the 2d version, since compiz is a resources killer. I hate that they removed all the configurations gnome had, every time I enter Unity i feel in some kind of virtual prison, can’t touch anything can’t change anything, what’s linux in that?? 🙁
However, i fell in love with the HUD (Menus search), and probably will find a way to use it outside unity sometime soon.

So as i said, even though Unity has it’s own awesome features, for a long time I felt I no longer control my machine, and wanted to switch back to Fluxbox, but couldn’t find time.. Until now 🙂

Of course using anything different from Unity on Ubuntu isn’t always an easy task, and I had my own challanges on the way. I promise to publish some notes on hacks i’ve done to make my Linux work faster and look better.

Dor.