How do I tell what version of Linux I’m running?
Good question, and an annoying one as I can never remember the command. It is..
lsb_release -a
Sweet!
Good question, and an annoying one as I can never remember the command. It is..
lsb_release -a
Sweet!
You need to know what hardware you’ve got in your Linux box?
Easy..
sudo lshw
Job done.
Network ports used in conjunction with IP addresses are used to define the TCPIP socket for network connections between hosts on an (inter)network so they can communicate with each other. Some port numbers are classics and here are those used for electronic mail.
POP3 – port 110
IMAP – port 143
SMTP – port 25
HTTP – port 80
Secure SMTP (SSMTP) – port 465
Secure IMAP (IMAP4-SSL) – port 585
IMAP4 over SSL (IMAPS) – port 993
Secure POP3 (SSL-POP) – port 995
IPTABLES is the Linux firewall and it is, in short, great. The one only niggle is that sometimes you want to be able to just clear all the rules and have a nice clean firewall to fiddle with.
I found this script on the interweb and it works like a dream. To use it just do this..
1. Open a terminal window by opening the run command line with Alt + F2. Of course, if you’re using a GUI-less terminal, this doesn’t apply, just skip to step 2.
Once open, type
gnome-terminal
and click OK. There’s your terminal window.
2. Now, let’s install vim, one of the common editors in Linux. Issue the command
sudo apt-get install vim
Enter your normal login password and away you go, installing VIM in a second, job done.
3. Now let’s create the file with these commands..
cd
sudo vim fwflush
to create and edit the file. Once in VIM, just cut and paste the script below into the terminal window / command line.
#!/bin/sh
#
# rc.flush-iptables - Resets iptables to default values.
#
# Copyright (C) 2001 Oskar Andreasson <bluefluxATkoffeinDOTnet>
#
#
# Configurations
#
IPTABLES="/sbin/iptables"
#
# reset the default policies in the filter table.
#
$IPTABLES -P INPUT ACCEPT
$IPTABLES -P FORWARD ACCEPT
$IPTABLES -P OUTPUT ACCEPT
#
# reset the default policies in the nat table.
#
$IPTABLES -t nat -P PREROUTING ACCEPT
$IPTABLES -t nat -P POSTROUTING ACCEPT
$IPTABLES -t nat -P OUTPUT ACCEPT
#
# reset the default policies in the mangle table.
#
$IPTABLES -t mangle -P PREROUTING ACCEPT
$IPTABLES -t mangle -P POSTROUTING ACCEPT
$IPTABLES -t mangle -P INPUT ACCEPT
$IPTABLES -t mangle -P OUTPUT ACCEPT
$IPTABLES -t mangle -P FORWARD ACCEPT
#
# flush all the rules in the filter and nat tables.
#
$IPTABLES -F
$IPTABLES -t nat -F
$IPTABLES -t mangle -F
#
# erase all chains that's not default in filter and nat table.
#
$IPTABLES -X
$IPTABLES -t nat -X
$IPTABLES -t mangle -X
Job done, now save it using the following key sequence in order
:wq
OK, that’s the file created and ready for use – we just need to make it excecutable. Do that by issuing the chmod command thus…
chmod u+x fwflush
4. Now run the script thus..
./fwflush
Now, if you issue the iptables command to show all the chains/rules, there are none but the defaults. Sweeeet!
sudo iptables -L
To check out the amount of space being used by any part of the filesystem, use the du command.
sudo du -h --max-depth=1 /var/log
This dispalys the amount of disk space used in /var/log and by which files, but only for that depth in the folder hierarchy. It should give you an output like this..
224K /var/log/clamav
8,0K /var/log/dspam
4,0K /var/log/news
8,0K /var/log/dbconfig-common
8,0K /var/log/fsck
4,0K /var/log/sysstat
68K /var/log/apt
4,0K /var/log/mysql
11M /var/log/setuid
4,0K /var/log/ntpstats
4,0K /var/log/chkrootkit
67M /var/log
This is my website for short blog posts and interesting materials that are noteworthy or have some handy-tip value.