How can you speed up Eclipse?

The three most influential factors for Eclipse speed are: Using the latest version of Eclipse (2020-06 as on 26 June 2020) Note that David BalaĹžic’s comment (July 2014) contradicts that criteria which was working six years ago: The “same” workspace in Indigo (3.7.2) SR2 loads in 4 seconds, in Kepler SR2 (4.3.2) in 7 seconds …

Read more

How to cherry-pick multiple commits

Git 1.7.2 introduced the ability to cherry pick a range of commits. From the release notes: git cherry-pick learned to pick a range of commits (e.g. cherry-pick A..B and cherry-pick –stdin), so did git revert; these do not support the nicer sequencing control rebase [-i] has, though. To cherry-pick all the commits from commit A …

Read more

Rsync daemon: is it really useful?

I think the big difference is that if you’re using rsyncd on the server end, instead of rsync over ssh, the server already knows what it has, so building the file lists to determine what needs to be transferred is much simpler. It won’t make a difference if you’re just pushing around a few files, …

Read more

How do I get the full path of the current file’s directory?

The special variable __file__ contains the path to the current file. From that we can get the directory using either pathlib or the os.path module. Python 3 For the directory of the script being run: import pathlib pathlib.Path(__file__).parent.resolve() For the current working directory: import pathlib pathlib.Path().resolve() Python 2 and 3 For the directory of the …

Read more

‘Must Override a Superclass Method’ Errors after importing a project into Eclipse

Eclipse is defaulting to Java 1.5 and you have classes implementing interface methods (which in Java 1.6 can be annotated with @Override, but in Java 1.5 can only be applied to methods overriding a superclass method). Go to your project/IDE preferences and set the Java compiler level to 1.6 and also make sure you select …

Read more

How do I permanently disable Linux’s console screen saver, system-wide?

In Ubuntu 12.10 and earlier the console-tools package allows console options to be controlled. To turn off screen blanking and powerdown, set BLANK_TIME and POWERDOWN_TIME to 0 in /etc/console-tools/config. If you’d prefer not to modify the config file, the same effect can be achieved by creating a new file in /etc/console-tools/config.d containing the following: BLANK_TIME=0 …

Read more

How to move a file in Python?

os.rename(), os.replace(), or shutil.move() All employ the same syntax: import os import shutil os.rename(“path/to/current/file.foo”, “path/to/new/destination/for/file.foo”) os.replace(“path/to/current/file.foo”, “path/to/new/destination/for/file.foo”) shutil.move(“path/to/current/file.foo”, “path/to/new/destination/for/file.foo”) Note that you must include the file name (file.foo) in both the source and destination arguments. If it is changed, the file will be renamed as well as moved. Note also that in the first two …

Read more

Is there a way to list all configurable `alternatives` (symlinks for similar commands) on the system?

On Debian (but not Fedora or RHEL), to see a list of all “master alternative names”: update-alternatives –get-selections –get-selections list master alternative names and their status. And for each of those listed, you can run –list $ALTERNATIVE_NAME, e.g. update-alternatives –list editor –list name Display all targets of the link group. If you would like to …

Read more