pdf2ps large.pdf large.ps
ps2pdf large.ps small.pdf
gs -dQUIET -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dPDFSETTINGS=/printer -sOutputFile=output.pdf Sarvesh_BOB_filled_scanned_final.pdf
Syntax
Example - Command to list files in the current directory
for i in *.jpg ;
do
convert "$i" "${i%.*}.png" ;
done
export PS1= "\u@\h: \w:$"
where \u
is username,
\h
is hostname,
\w
is present working directory
example: export PS1="$(whoami)@$(hostname):$(pwd)"
find <file_path> -iname "*.jpg" -or -iname "*.png" | wc
rsync -avzL username@remote:path local-path
Install jupyterthemes and run the following command for monokai font
jt -t monokai -cellw 90%
For list of all available themes use jt -l
- Use this command
lsusb
to list all devices detected
- Go to terminal, type
cheese
and a window should pop-up. You can take phots(single/burst) and record video! - In case cheese is not installed, you can install it using
sudo apt-get install cheese
wget <url>
- Check integrity of zip file using
unzip -t <zipfile_name>
from matplotlib import pyplot as plt
from PIL import Image
from matplotlib.patches import Rectangle
image = Image.open(<path_to_img>)
# rectangle co-ordinates is of the form (xmin,ymin), width, height
origin = (xmin, ymin)
width = xmax-xmin
height = ymax-ymin
# display image and overlay rectangle
plt.imshow(image)
patch = Rectangle(origin, width, height, linewidth = 10, edgecolor='r')
plt.gca().add_patch(patch)
plt.show()
sudo lshw -html > config.html
to dump specification as html file- Use
firefox config.html
to view the details
git update-index --skip-worktree <file_name>
# activate conda environment
conda activate <env_name>
# export environment to a file
conda env export > environment.yml
# recreate conda environment from file
conda env create -f environment.yml
### ```[14] Pytorch enable GPU/CPU based on availability```
```python
device = torch.device("cuda:0" if torch.cuda_is_available() else "cpu")
Option 1:
os.system("export CUDA_VISIBLE_DEVICES = 0,1")
Option 2: Using bash commandline
export CUDA_VISIBLE_DEVICES = 0,1