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.


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)’


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…

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


Highlight PHPS code on Nginx

Hey there all,

since I mostly develop in PHP language, I wanted a way to share my code for a while, just to show it to a friend or so, without pasting the code into pastebin.

For such situations PHP created the extension PHPS, which stands for “PHP Source”. on Apache for ex. all you have to do is to add to httpd.conf file the line “AddType application/x-httpd-php-source .phps”, and phps extensioned files will be highlighted.

On Nginx however, there’s no such thing, some will say for good. After a little search i found that many Nginx users already created their own code to highight their PHPS files. but if we make the highlight ourselves, why not to take it into a completely new level? I’ve decided to add more features, such as line numbering. I looked over the www if anyone already wrote such thing. the best solution i saw can be found here. I’ve decided to use it and to add more features, like anchoring the lines, so i’ll be able to point the viewer to a specific line.

I also created a demo, so you can try it without running it yourself.

At last, I uploaded my work, including the Nginx configurations into GitHub, and it can be viewed over here. If you have any ideas to improve the code or you found a bug, I’ll be more than glad to have your feedback!


נוסף תהליך התקנה למערכת רישום חניכים

שלום לכולם,

בתקופה האחרונה, בין השיפורים שבניתי למערכת לרישום חניכים, השיפור החדש והניכר ביותר הוא תהליך ההתקנה שנוסף.

את תהליך ההתקנה ביססתי על תהליך ההתקנה של וורדפרס ושל phpBB שעזרו לי מאוד. יחי הקוד הפתוח!

מעבר לזה, החלטתי לשנות את הרישיון של המערכת ל־GPL (לעומת BSD) אחרי שראיתי כי הרבה מערכות ווב גדולות משתמשות בו, למרות הפירצה שלכאורה יש בו ליישומי רשת.

אתם יותר ממוזמנים להתנסות במערכת אונליין או להוריד את המערכת ולהריץ בבית או סתם לצפות בקוד.

אשמח להערות, רעיונות, וכו’.

דור 🙂