domingo, 4 de março de 2012

Linux: Find Dell Service Tag

Type the following command to find out Dell service tag:
# dmidecode | grep -i serial

OR
# dmidecode -t 1

The following command will only display service tag:
# dmidecode -s system-serial-number

Referência: Red Hat / CentOS Command To Find Dell Service Tag

Linux: Locking/Unlocking An Account

Task: Linux Locking an Account

The syntax is as follows:
# passwd -l {username}

The -l option disables an account by changing the password to a value which matches no possible encrypted value. In this example, lock user account named vivek. First, login as a root user and type the following command:
# passwd -l vivek

Task: Linux Unlocking an Account

The syntax is as follows:
# passwd -u {username}

The -u option re-enables an account by changing the password back to its previous value i.e. to value before using -l option. To unlock user account named vivek. Login as a root user and type following command:
# passwd -u vivek

Referência: Linux Locking An Account

Linux: Find Out Maximum RAM Supported By The Server BIOS / Motherboard

Most modern server supports 16GB, 32GB, 64GB or more RAM and has 4 or more DIMM slots. To find out what is the maximum system can support type the following command as root user:
# dmidecode -t 16

You can find out currently installed memory information (DIMM and its slots) by typing the following command:
# dmidecode -t 17

Referência: Linux / Unix: Find Out Maximum RAM Supported By The Server BIOS / Motherboard

Shell: Cat Command Examples

To create a file called "foo.txt", enter:
cat >foo.txt
Unix is the best.
<control-D>

You can combine two files and creates a new file called report.txt, enter:
cat score.txt names.txt > report.txt

To append (add data to existing) data to a file called foo.txt, enter:
cat >>foo.txt
A champion is someone who gets up, even when he can't
<control-D>

You can send files to sound devices such as /dev/dsp or /dev/audio to make sure sound output and input is working:

cat filename >/dev/dsp
cat recording.au >/dev/audio

You can simply use the following command for recording voice sample and play back with it cat command:

dd bs=8k count=4 </dev/audio >testing123.au
cat testing123.au >/dev/audio

No cat cannot print in reverse order but tac command can concatenate and print files in reverse:

tac fileName
cat fileName | tac
tac <<<"$myFileName"

Referência: Linux / Unix: Cat Command Examples

Drunk Penguins

Drunk Penguins
Drunk Penguins