BelAir Internet: SpeedTest

Published / by MasonCloud / Leave a Comment
=================================
Mon Aug 14 10:41:51 PDT 2017
=================================
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from BAI (98.159.86.123)...
Selecting best server based on latency...
Hosted by Atlantic Metro (Los Angeles, CA) [16.57 km]: 5.307 ms
Testing download speed........................................
Download: 49.45 Mbit/s
Testing upload speed..................................................
Upload: 20.24 Mbit/s
Share results: http://www.speedtest.net/result/6539186333.png

Clear DNS cache in Linux/macOS & Win

Published / by MasonCloud / Leave a Comment

How to clear the local DNS cache:

macOS Sierra 10.12.0
sudo dscacheutil -flushcache ; sudo killall -HUP mDNSResponder ; say cache flushed
OSX 10.11.0
sudo killall -HUP mDNSResponder
OSX 10.10.4
sudo killall -HUP mDNSResponder
OSX 10.10.0 – 10.10.3
sudo discoveryutil mdnsflushcache
OSX 10.9  – 10.8 – 10.7
sudo killall -HUP mDNSResponder
OSX 10.5 – 10.6
sudo dscacheutil -flushcache
Windows
ipconfig /flushdns
Linux (depending on what you’re running)
/etc/init.d/named restart
/etc/init.d/nscd restart

Fedora 25: Install ClamAV AntiVirus.

Published / by MasonCloud / Leave a Comment

This is a short tutorial about how to use clamav antivirus on Fedora 25.
First you need to install it with this commands:

# awk -F: '/^[^#]/ { print $1 }' /etc/freshclam.conf | uniq
# dnf install clamav.x86_64 
...
# dnf install clamav-update.x86_64
...
Make settings into your /etc/freshclam.conf file.
I used awk tool to show you my settings from /etc/freshclam.conf:

DatabaseDirectory /var/lib/clamav
UpdateLogFile /var/log/freshclam.log
LogFileMaxSize 2M
LogTime yes
LogVerbose yes
LogSyslog yes
LogFacility LOG_MAIL
LogRotate yes
DatabaseOwner clamupdate
DNSDatabaseInfo current.cvd.clamav.net
DatabaseMirror database.clamav.net
MaxAttempts 5
ScriptedUpdates yes
DetectionStatsCountry country-code
SafeBrowsing yes
Update the clamav antivirus with :

# /usr/bin/freshclam
ClamAV update process started at Wed Mar 15 13:42:07 2017
main.cvd is up to date (version: 57, sigs: 4218790, f-level: 60, builder: amishhammer)
WARNING: getfile: daily-21724.cdiff not found on database.clamav.net (IP: 195.30.97.3)
WARNING: getpatch: Can't download daily-21724.cdiff from database.clamav.net
Trying host database.clamav.net (212.7.0.71)...
nonblock_connect: connect timing out (30 secs)
Can't connect to port 80 of host database.clamav.net (IP: 212.7.0.71)
WARNING: getpatch: Can't download daily-21724.cdiff from database.clamav.net
WARNING: getpatch: Can't download daily-21724.cdiff from database.clamav.net
WARNING: getpatch: Can't download daily-21724.cdiff from database.clamav.net
WARNING: getpatch: Can't download daily-21724.cdiff from database.clamav.net
WARNING: Incremental update failed, trying to download daily.cvd
Downloading daily.cvd [100%]
daily.cvd updated (version: 23205, sigs: 1789155, f-level: 63, builder: neo)
Downloading safebrowsing.cvd [100%]
safebrowsing.cvd updated (version: 45693, sigs: 2756150, f-level: 63, builder: google)
Downloading bytecode-279.cdiff [100%]
Downloading bytecode-280.cdiff [100%]
Downloading bytecode-281.cdiff [100%]
Downloading bytecode-282.cdiff [100%]
Downloading bytecode-283.cdiff [100%]
Downloading bytecode-284.cdiff [100%]
Downloading bytecode-285.cdiff [100%]
Downloading bytecode-286.cdiff [100%]
Downloading bytecode-287.cdiff [100%]
Downloading bytecode-288.cdiff [100%]
Downloading bytecode-289.cdiff [100%]
Downloading bytecode-290.cdiff [100%]
Downloading bytecode-291.cdiff [100%]
bytecode.cld updated (version: 291, sigs: 55, f-level: 63, builder: neo)
Database updated (8764150 signatures) from database.clamav.net (IP: 157.25.5.183)
Now you can run it on Fedora 25 folder with this:

# clamscan 
/home/mythcat/.bash_logout: OK
/home/mythcat/.bash_profile: OK
...
----------- SCAN SUMMARY -----------
Known viruses: 8758441
Engine version: 0.99.2
Scanned directories: 1
Scanned files: 54
Infected files: 0
Data scanned: 71.80 MB
Data read: 189.96 MB (ratio 0.38:1)
Time: 13.968 sec (0 m 13 s)

This tool come with many options and features for Fedora workstations and server. Just read the documentation and make your changes.

Delete Files Older Than ‘x’ Days

Published / by MasonCloud / Leave a Comment

Delete Files Older Than ‘x’ Days on Linux:

The find utility on linux allows you to pass in a bunch of interesting arguments, including one to execute another command on each file. We’ll use this in order to figure out what files are older than a certain number of days, and then use the rm command to delete them.

Command Syntax:
Ex: find /path/to/files* -mtime +5 -exec rm {} \;

# clear ; find . -type f -mtime +5 -exec rm {} \;

Note that there are spaces between rm, {}, and \;

Explanation

  • The first argument is the path to the files. This can be a path, a directory, or a wildcard as in the example above. I would recommend using the full path, and make sure that you run the command without the exec rm to make sure you are getting the right results.
  • The second argument, -mtime, is used to specify the number of days old that the file is. If you enter +5, it will find files older than 5 days.
  • The third argument, -exec, allows you to pass in a command such as rm. The {} \; at the end is required to end the command.

This should work on Ubuntu, Suse, Redhat, or pretty much any version of linux.