Archive
Force Avast NOT to scan my EXEs
Problem
Currently I’m working on a C tutorial and thus I write lots of small C programs. I compile and try all of them to see that everything works fine. Unfortunately I need to do the tutorial under Windows. It wouldn’t be a big issue, but whenever I launch an EXE, Avast starts scanning my EXE because it’s suspicious :( I always lose several seconds with this shit. How to disable this “feature”?
Solution
In Avast you can exclude a directory. So I produce my EXEs in the folder C:\work and I told Avast not to scan this directory. Here is how to do it:
Open Avast, select Protection on the left, then select Virus Scans. On the right side you’ll see a small gear (cog) icon, click on it. On the tab “Full Virus Scan”, go down to the bottom and click on “View exceptions”. Click on the button “Add Exception” and specify the folder that you want to exclude (it was C:\work in my case). Done.
Resize .tif file and convert to .jpg
Use case
In the lab we have a photocopier that can scan too. Quite cool, you can precise your email address and it sends you the scanned page in .tif format.
However, pages must be scanned one by one and each of them is sent as a separate .tif file. Each .tif file is around 2.8 MB large with a resolution of 4900 x 7000 pixels. How to resize them and convert them to .jpg files? Gimp is one way but could we solve it in command-line?
Solution
Put the .tif files in a folder and create a subfolder called “out”. This way the output won’t be mixed with the input.
for i in *.tif; do echo $i; convert $i -resize 24% out/`basename $i .tif`.jpg; done
Each .tif is made smaller (width around 1200 pixels) and converted to .jpg.
As a final touch, convert the JPGs to a PDF file.
cd out convert *.jpg doc.pdf
Question
Does anyone know how to to resize an image the following way: let width be 1200 pixels and keep the aspect ratio? Above the 24% was the result of a manual computation…
Answer: just use “convert -resize 1200 in.tif out.jpg“. The output will have width=1200 pixels with the same ratio as the input image. (Thanks Yves for the tip.)
Analyze Disk Occupation
Question
Why the hell is my HDD full again?
Answer
Run Disk Usage Analyzer (a.k.a. Baobab). Under Ubuntu it’s here: Applications -> Accessories. If not, then install gnome-utils.
Usage
First, go to Edit -> Preferences. Here you can specify which drives to scan. (I have several large external HDDs that I don’t want to scan, so I just unticked them).
When you click on the button “Scan filesystem”, the previously selected drives will be scanned.
If you want to analyze your HOME folder, click on the button “Scan Home”.
Directories will be listed in descending order by size, so you can easily figure out which directories occupy much space. You can also use the chart on the right side to navigate in the directory structure.