Click Technology Limited

Just another WordPress weblog

How do I change my MAC Address?

August13

In Ubuntu, just open a terminal window and type

somebody@your-laptop:~$
sudo macchanger eth1 -r

This will change the wifi address, as your physical CAT 5 port is prolly eth0.  The command above will change the MAC address to a random MAC address.

Sweet!

posted under General | No Comments »

How do I renew my DHCP Address?

August13

In Ubuntu, just open a terminal window and type

somebody@your-laptop:~$ sudo dhclient -r

That should drop (release) the address.  To renew it…

somebody@your-laptop:~$ sudo dhclient

Simples!
posted under General | No Comments »

What CPU do I have?

June15

In Ubuntu, just open a terminal window and type


somebody@your-laptop:~$ cat /proc/cpuinfo

Compare it here.

Simples!

posted under General | No Comments »

MySQL Table Data Copy

June4

To copy data and a table structure in the same database, ay to backup a table, here’s the code…


CREATE TABLE new_tbl SELECT * FROM orig_tbl;

Simple as.

posted under General | No Comments »

How do I tell what version of Linux I’m running?

May5

Good question, and an annoying one as I can never remember the command. It is..

somebody@your-laptop:~$ lsb_release -a

Sweet!

posted under Linux Tips | No Comments »

What hardware do I have?

April23

You need to know what hardware you’ve got in your Linux box?

Easy..

somebody@your-laptop:~$ sudo lshw

Job done.

posted under Linux Tips | No Comments »

mp3, Sound Juicer and all that…

April8

One of the annoying things about MP3 apps on Linux is that, given it’s the most popular ripping format in the world (prolly), I can’t see why Linux tends not to include it as a default sound format.

I think the reason is summat to do with copyright or something?  Anyway, whatever.

The solution to get MP3 support into your machine is to open a terminal and issue this command..

somebody@your-laptop:~$ sudo apt-get install gstreamer0.10-plugins-ugly-multiverse

Once installed, the MP3 option in applications appears so Sound Juicer / Rhythmbox suddenly have MP3 available – sweet!

posted under Linux Tips | No Comments »

Mail Ports

April6

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

posted under Linux Tips | No Comments »

Flushing IPTABLES

April4

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

[codesyntax lang="bash"]

gnome-terminal

[/codesyntax]

and click OK.  There’s your terminal window.

2. Now, let’s install vim, one of the common editors in Linux. Issue the command

[codesyntax lang="bash"]
user@user-machine:~$ sudo apt-get install vim
[/codesyntax]

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..

[codesyntax lang="bash"]

user@user-machine:~$ cd

user@user-machine:~$ sudo vim fwflush

[/codesyntax]
to create and edit the file.  Once in VIM, just cut and paste the script below into the terminal window / command line.

[codesyntax lang="bash"]

#!/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

[/codesyntax]

Job done, now save it using the following key sequence in order

[codesyntax lang="bash"]

:wq

[/codesyntax]

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…

[codesyntax lang="bash"]

user@user-machine:~$ chmod u+x fwflush

[/codesyntax]

4. Now run the script thus..

[codesyntax lang="bash"]

user@user-machine:~$ ./fwflush

[/codesyntax]

Now, if you issue the iptables command to show all the chains/rules, there are none but the defaults.  Sweeeet!

[codesyntax lang="bash"]

user@user-machine:~$ iptables -L

[/codesyntax]

posted under Linux Tips | No Comments »