Wednesday, March 24, 2010

Basic Linux Commands: Finding Total Size of a Directory

Show size of directory:
# du -sh [directory]

Get more information about a command:
# man [command]

Tuesday, December 15, 2009

Removing Viruses

If you have the means, the best way is to connect the infected hard drive to another computer and scan it from there.
Install Malwarebytes
If it cannot install: download it onto another computer, rename the installer to something else (goawayvirus.exe). Then transfer it over to the infected machine and install it.
Update Malwarebytes
If you cannot use the internet I believe there is a manual way to update, will update once I find out.
Run a full scan
Malwarebytes may ask you to reboot, do so, even if it doesn't ask, reboot anyway.
BOOT INTO SAFE MODE
This is usually done by tapping the F8 key when the system is booting up.
Run full scans and reboot until the machine is clean

A run of CCleaner afterwards to clean up any registry junk left behind never hurts either.
Tips
  • Have patience
  • Be thorough
  • Try to understand how the computer got infected

Windows XP Recommendations

3 points:
  • Accounts
  • Updates
  • Upkeep
Accounts
Avoid running as an administrator as much as possible. The default account after installing XP is an administrator. Create a new account for yourself that is a regular user and use this one for day-to-day actions.
If you need to install a program, download the installer, right click on it and go to "run as". Run it as the administrator account and it will be installed just fine.
Other things may come up saying only administrator's can do those things, and the administrator username and password must be entered. It is annoying but is much, much more secure.
Updates
The only time the administrator account should be logged into is when you are updating the computer. To do that go into Internet Explorer, go to Tools -> Windows Update. These updates can improve computer performance and prevent against viruses, very important.
This also goes for programs you run, updating them regularly is also a good idea.
Upkeep
Organize the files on the computer, create folders with names that describe what is in them. Categorize as seen fit.
Do not install a program unless you are sure what it is. Do a search on the internet of the program's name and see what people have to say about it.
Go through this checklist at least once a month:
  • Update Windows
  • Update the programs used most
  • Run CCleaner
  • Run Auslogics Disk Defrag
  • Run MalwareBytes Anti-Malware

Blocking Websites with a Squid Proxy

Install Squid on your machine.

In /etc/squid3/squid.conf, under the line:
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
Insert these lines above any network rules you have:
# WEB FILTERING
acl bad url_regex –i “/etc/squid3/squid-block.acl”
http_access deny bad
Create the file "squid-block.acl". This file will store the url regular expressions you want to block.
Restart Squid to apply the changes:
# sudo service squid3 restart

Example squid-block.acl contents:
myspace.com
faceboook.com
This will block any url that contains "myspace.com" or "facebook.com".

Basic Squid Installation on Ubuntu Server

Install Squid:
# sudo apt-get install squid3
Back up configuration file:
# sudo cp /etc/squid3.conf /etc/squid3.conf.default

Edit squid.conf, under this line:
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
Add the following lines(where localnet is the machines you want to be able to use the proxy):
# MODIFIED PORTION
# ALLOWED NETWORKS
acl localnet src 130.151.0.0/16
http_access allow localnet
icp_access allow localnet

Restart Squid to apply changes:
# service squid3 restart

Now Squid will be acting as a proxy-cache for machines with IP addresses within 130.151.0.0/16. Just point their browsers to the hostname of your squid box port number 3128 (squid's default port).

Monday, December 14, 2009

Basic Linux Commands: Search for a file

Search for a file anywhere on the machine:
# find / -name [filename]

Get more information about a command:
# man [command]

Basic Linux Commands: Permissions

Change permissions of file:
# chmod [777] [filename]
Change owner of file:
# chown [username] [filename]
Change group ownership of file:
# chgrp [groupname] [filename]

Get more information about a command:
# man [command]