0

Check what ports are open

There are two good methods to see what ports are open in Linux you can use
nmap which is a port scanner and you can use netstat.

nmap can be used to scan your machine to see whats ports are open issue the
following command to scan your computers machine:

nmap -sS -O 127.0.0.1

The second method was netstat. netstat can show hidden ports and what programs using
them issue the following command as root:

netstat -nap

0

How to low level format a SD memory card ?

  1. The command dd is used to low level format the card
  2. The command fdisk is used to create a new primary partition
  3. The command mkfs.vfat us used to create the FAT32 file system
kerphi@ketchup:~$ sudo dd if=/dev/zero of=/dev/sdd
dd: écriture vers `/dev/sdd': Aucun espace disponible sur le périphérique
1974273+0 enregistrements lus
1974272+0 enregistrements écrits
1010827264 octets (1,0 GB) copiés, 1090,36 seconde, 927 kB/s


kerphi@ketchup:~$ sudo fdisk /dev/sdd
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): p

Disk /dev/sdd: 1010 MB, 1010827264 bytes
32 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 1952 * 512 = 999424 bytes

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1011, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1011, default 1011): 1011

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): b
Changed system type of partition 1 to b (W95 FAT32)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.

kerphi@ketchup:~$ sudo mkfs.vfat -F 32 /dev/sdd1
article source: Zeitoun.net