After adb devices, make sure the phone shows up twice, once for the USB connection and once for the WiFi connection, which will list your IP address. If the connections are not showing, then adb is not connecting – your phone may be blocking it. If you have the WiFi connection showing, unplug the phone from the USB and enter the following:
The find command in UNIX is a command line utility for walking a file hierarchy. It can be used to find files and directories and perform subsequent operations on them. It supports searching by file, folder, name, creation date, modification date, owner and permissions. By using the ‘-exec’ other UNIX commands can be executed on files or folders found.
$ find [where to start searching from]
[expression determines what to find] [-options] [what to find]
-exec CMD: The file being searched which meets the above criteria and returns 0 for as its exit status for successful command execution.
-ok CMD : It works same as -exec except the user is prompted first.
-inum N : Search for files with inode number ‘N’.
-links N : Search for files with ‘N’ links.
-name demo : Search for files that are specified by ‘demo’.
-newer file : Search for files that were modified/created after ‘file’.
-perm octal : Search for the file if permission is ‘octal’.
-print : Display the path name of the files found by using the rest of the criteria.
-empty : Search for empty files and directories.
-size +N/-N : Search for files of ‘N’ blocks; ‘N’ followed by ‘c’can be used to measure size in characters; ‘+N’ means size > ‘N’ blocks and ‘-N’ means size < ‘N’ blocks.
-user name : Search for files owned by user name or ID ‘name’.
\(expr \) : True if ‘expr’ is true; used for grouping criteria combined with OR or AND.
sudo apt update # Fetches the list of available updates
sudo apt upgrade # Installs some updates; does not remove packages
sudo apt full-upgrade # Installs updates; may also remove some packages, if needed
sudo apt autoremove # Removes any old packages that are no longer needed
Documentation about each apt option can be found in the the manpages for apt. These are also available by running man apt in your terminal.
In order to install nmap on Ubuntu, we will be using these commands at terminal:
$ sudo apt-get install nmap
Simple Scanning With nmap on Ubuntu
In terminal of your choosing, type(you should use your own ip address or ip address of network you wish to scan):
$ sudo nmap -sn 10.0.0.0/24
Whatever ip address you have must be followed by ‘/24’. It also helps to change last number to ‘0’. That will give us first possible ip address on that network. Using ‘/24’ informs our computer to scan from ip address ‘10.0.0.0’ until it reaches and scans ‘10.0.0.255’.
Diving Deeper Scanning With nmap on Ubuntu
If we remove our ‘-sn’ option, we can use nmap to scan ports on all of those devices we found above.
$ sudo nmap 10.0.0.0/24
Aggressively Scanning With nmap On Ubuntu
$ sudo nmap -A -T4 10.0.0.254
In this line of code, ‘-A’ option acts as an aggressive scan. This runs nmap’s operating system detection, version detection, script scanning, and traceroute detection.
There is a timing template set by ‘-T’ flag. From 0 to 5, we can chose to run nmap in one of these timing modes. Each timing mode is interestingly named:
You can use Ghostscript command line tool for compressing a PDF file. Most Linux distributions include the open source version of Ghostscript already. However, you can still try to install it just to make sure.
On Debian/Ubuntu based distributions, use the following command to install Ghostscript:
sudo apt install ghostscript
Now that you have made sure that Ghostscript is installed, you can use the following command to reduce the size of your PDF file:
In the above command, you should add the correct path of the input and out PDF file.
The command looks scary and confusing. I advise copying and pasting most of it. What you need to know is the dPDFSETTINGS parameter. This is what determines the compression level and thus the quality of your compressed PDF file.
Higher quality output (300 dpi) but bigger size
Medium quality output (150 dpi) with moderate output file size
Lower quality output (72 dpi) but smallest possible output file size
Do keep in mind that some PDF files may not be compressed a lot or at all. Applying compression on some PDF files may even produce a file bigger than the original. There is not much you can do in such cases.