Signup/Sign In

Answers

All questions must be answered. Here are the Answers given by this user in the Forum.

For the total size of a directory jump into it and run:
***
du -hs
***

***
du -h --max-depth=1 | sort -hr
***
which will give you the size of all sub-folders (level 1). The output will be sorted (largest folder on top).
3 years ago
In unix terminology, the short answer is that

terminal = tty = text input/output environment
console = physical terminal
shell = command line interpreter
3 years ago
Use this code
***
sudo apt-get --with-new-pkgs upgrade
***
This allows new packages to be installed. It will let you know what packages would be installed and prompt you before actually doing the install.
3 years ago
While dpkg -i indeed install the package, it doesn't do any automatic dependency resolution, meanwhile, there are two other alternatives, using gdebi, or the apt-get tool. To use the later just use:
***
sudo apt-get install /path/to/package.deb
***
Even if you are on the directory with the package you need to give a path using ./ at the start:
***
sudo apt-get install ./package.deb
***
3 years ago
Alternately, as ppas are stored in /etc/apt/sources.list.d you can find the one you want to remove by entering:
***
ls /etc/apt/sources.list.d
***
Then when you have noted the name of that offending ppa (e.g. myppa.list), you can enter:
***
sudo rm -i /etc/apt/sources.list.d/myppa.list
***
Take care with rm (hence why I have used the interactive switch so you can confirm your actions. Then run sudo apt-get update afterwards.

This method merely removes the ppa .list file; it does not remove any other files or sort out any other problems caused by the ppa; for that you could use ppa-purge after you have got your update ability back .
3 years ago
A more useful tool is 7z, which zips and unzips a range of compression formats, notably lzma, usually the protocol offering the highest compression rates.

This command installs 7z:
***
sudo apt-get install p7zip-full
***
This command lists the contents of the zip:
***
7z l zipfile.zip
***
This command extracts the contents of the zip:
***
7z x zipfile.zip
***
3 years ago
The *apt* tool on Ubuntu 14.04 and above makes this very easy.
***
apt list --installed
***
3 years ago
Just for the record:
***
>>> int('55063.000000')
Traceback (most recent call last):
File "", line 1, in
***
ValueError: invalid literal for int() with base 10: '55063.000000'
Got me here...
***
>>> int(float('55063.000000'))
55063
***
Has to be used!
3 years ago
The flag Xmx specifies the maximum memory allocation pool for a Java Virtual Machine (JVM), while Xms specifies the initial memory allocation pool.

This means that your JVM will be started with Xms amount of memory and will be able to use a maximum of Xmx amount of memory. For example, starting a JVM like below will start it with 256 MB of memory and will allow the process to use up to 2048 MB of memory:
***
java -Xms256m -Xmx2048m
***
The memory flag can also be specified in different sizes, such as kilobytes, megabytes, and so on.
***
-Xmx1024k
-Xmx512m
-Xmx8g
***
The Xms flag has no default value, and Xmx typically has a default value of 256 MB. A common use for these flags is when you encounter a java.lang.OutOfMemoryError.

When using these settings, keep in mind that these settings are for the JVM's heap, and that the JVM can and will use more memory than just the size allocated to the heap.
3 years ago
TL;DR
For experienced readers:

Find the Java path; it looks like this: C:\Program Files\Java\jdkxxxx\bin\
Start-menu search for "environment variable" to open the options dialog.
Examine PATH. Remove old Java paths.
Add the new Java path to PATH.
Edit JAVA_HOME.
Close and re-open console/IDE.
3 years ago
Due to the dynamic nature of class loaders, this is not possible. Class loaders are not required to tell the VM which classes it can provide, instead they are just handed requests for classes, and have to return a class or throw an exception.

However, if you write your own class loaders, or examine the classpaths and it's jars, it's possible to find this information. This will be via filesystem operations though, and not reflection. There might even be libraries that can help you do this.

If there are classes that get generated, or delivered remotely, you will not be able to discover those classes.

The normal method is instead to somewhere register the classes you need access to in a file, or reference them in a different class. Or just use convention when it comes to naming.
3 years ago
Use docker ps to get the name of the existing container.
Use the command docker exec -it /bin/bash to get a bash shell in the container.
Or directly use docker exec -it to execute whatever command you specify in the container.
3 years ago