Linux command II

netstat -tnlp
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:20000 0.0.0.0:* LISTEN 8692/ssh
tcp 0 0 127.0.0.1:587 0.0.0.0:* LISTEN -

-t for tcp
-n numeric (no name resolving)
-l listening
-p display PID and program name

netstat -tane
(also shows other connection besides listening like ESTABLISHED)

netstat -tape

List process
ps auxwwf

(put double w for wide output)
f - for creating ascii process tree.

-----------------------
grep $username /etc/passwd | cut -d: -f3

cat /etc/passwd | cut -d: -f3

cut will take field using delimiter (here ':'). -f switch will take third field.

first command will display UID of the $username.
-------------
find /dir -type f \! -user alex

'\!' is for 'NOT' or we can use -not instead.

-----------------------------------------------------
Great Encyption tool
* to encrypt string 'akhadka' using digest md5 with encoding base64.. (notice binary switch)
echo -n "akhadka" | openssl dgst -md5 -binary | openssl enc -base64
(This encyption is used by WebGUI CMS).


echo -n "akhadka" | openssl dgst -sha1
(This is used by Galaxy with sqlite database)
(Note: similar could be achieve by primitive function found in mysql .. or any other databases.)

------
enable vino server and enable autologin for remote desktop management.
enable vino server by following
gconftool-2 -s -t bool /desktop/gnome/remote_access/enabled true
(switch -s for set; -g for get)

For default login
Edit the /etc/gdm/gdm.conf-custom file and add the following lines
[daemon]
AutomaticLogin=
AutomaticLoginEnable=true



Comments

Futung said…
hello!
good afternon!
i have much a nd much intrest with your publication.i am a khadka people too of nepal.
so please tell me something about yourself to me to





<3600401@gmail.com>


ok?

Popular Posts