Friday, July 30, 2010

Tracing symbolic links:-

Here is an easy way to trace the end point of a cascaded symbolic link ?


ex:- namei /dev/dvd

namei /dev/dvd
f: /dev/dvd
d /
d dev
l dvd -> sr0
b sr0

Get Flash Working in Flock Browser in Ubuntu

Many readers complained yesterday that Flock browser I reviewed about yesterday [here] had one major problem - It cannot play flash content. I too faced the same problem and finally here is the

solution:

Fire up the terminal and paste this in it:
sudo nautilus
Navigate to the folder:
usr/lib/firefox/plugins and copy the only file present there 'flashplugin-alternative.so'
to this folder:
/opt/flock/plugins

Restart Flock and you will have flash working.

if this is not working get the flashplugin so file from here :- http://get.adobe.com/flashplayer/ and put the so file in /opt/flock/plugins


Tested on ubuntu 10.04

see:- http://ubuntuforums.org/showthread.php?t=1164128 for installing flock

Recover lost bash history:-

shopt -s histappend
PROMPT_COMMAND=`history -a`

see:- http://www.faqs.org/docs/bashman/bashref_55.html#SEC55

Thursday, July 29, 2010

Extract the contents of a deb or rpm package ?

* rpm package can be extracted by issuing this command at the command line.

$rpm2cpio {rpm-package name} | cpio -idv

* deb packages can be extracted by issuing this command at the command line.

$dpkg-deb -x {deb-package name} {target directory}

Measuring Throughput with iperf ?

iperf utility for measuring TCP & UDP performance b/w 2 end points .
it must be installed at both ends of the connection you are measuring


zodiac@gml-admin:~$ iperf -c 192.168.0.210
------------------------------------------------------------
Client connecting to 192.168.0.210, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.0.17 port 48568 connected with 192.168.0.210 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 108 MBytes 90.5 Mbits/sec



[root@backup ~]# iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[ 4] local 192.168.0.210 port 5001 connected with 192.168.0.17 port 48568
[ 4] 0.0-10.1 sec 108 MBytes 90.0 Mbits/sec

Bi directional test or how efficient is your Ethernet Duplexing:-

zodiac@gml-admin:~$ iperf -c 192.168.0.210 -d
------------------------------------------------------------
Client connecting to 192.168.0.210, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.0.17 port 55554 connected with 192.168.0.210 port 5001
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[ 5] local 192.168.0.17 port 5001 connected with 192.168.0.210 port 41681
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.1 sec 9.38 MBytes 7.78 Mbits/sec
[ 5] 0.0-10.3 sec 114 MBytes 92.8 Mbits/sec

unidirectional testing or Half duplexing ?

zodiac@gml-admin:~$ iperf -c 192.168.0.210 -r
------------------------------------------------------------
Client connecting to 192.168.0.210, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.0.17 port 40551 connected with 192.168.0.210 port 5001
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
Waiting for server threads to complete. Interrupt again to force quit.
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 107 MBytes 89.1 Mbits/sec

Measuring Jitter and Datagram Loss

iperf -c 192.168.0.210 -ub 100m
------------------------------------------------------------
Client connecting to 192.168.0.210, UDP port 5001
Sending 1470 byte datagrams
UDP buffer size: 110 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.0.17 port 45559 connected with 192.168.0.210 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 109 MBytes 91.3 Mbits/sec
[ 3] Sent 77631 datagrams
[ 3] Server Report:
[ 3] 0.0-10.0 sec 109 MBytes 91.2 Mbits/sec 0.405 ms 0/77630 (0%)
[ 3] 0.0-10.0 sec 1 datagrams received out-of-order



[root@backup ~]# iperf -su -i 1
------------------------------------------------------------
Server listening on UDP port 5001
Receiving 1470 byte datagrams
UDP buffer size: 126 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.0.210 port 5001 connected with 192.168.0.17 port 45559

[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 3] 0.0- 1.0 sec 10.9 MBytes 91.1 Mbits/sec 0.041 ms 0/ 7745 (0%)
[ 3] 1.0- 2.0 sec 10.9 MBytes 91.4 Mbits/sec 0.027 ms 0/ 7768 (0%)
[ 3] 2.0- 3.0 sec 10.8 MBytes 90.8 Mbits/sec 0.059 ms 0/ 7722 (0%)
[ 3] 3.0- 4.0 sec 10.9 MBytes 91.3 Mbits/sec 0.175 ms 0/ 7761 (0%)
[ 3] 4.0- 5.0 sec 10.9 MBytes 91.3 Mbits/sec 0.031 ms 0/ 7763 (0%)
[ 3] 5.0- 6.0 sec 10.9 MBytes 91.3 Mbits/sec 0.026 ms 0/ 7762 (0%)
[ 3] 6.0- 7.0 sec 10.9 MBytes 91.3 Mbits/sec 0.161 ms 0/ 7762 (0%)
[ 3] 7.0- 8.0 sec 10.9 MBytes 91.3 Mbits/sec 0.034 ms 0/ 7760 (0%)
[ 3] 8.0- 9.0 sec 10.9 MBytes 91.3 Mbits/sec 0.039 ms 0/ 7763 (0%)
[ 3] 9.0-10.0 sec 10.9 MBytes 91.2 Mbits/sec 0.027 ms 0/ 7759 (0%)
[ 3] 0.0-10.0 sec 109 MBytes 91.2 Mbits/sec 0.405 ms 0/77630 (0%)
[ 3] 0.0-10.0 sec 1 datagrams received out-of-order

Wednesday, July 28, 2010

share Internet connection ?

Let us suppose that you have a machine on a network that is connected to the internet and you have another machine on the same network that does not have any Internet connection, now how to share the internet connection ??

We can use SSH Dynamic port forwarding to we can easily share the internet by setting up the machine with an internet connection to act as the SOCKS4 proxy using an SSH tunnel

for dynamic port forwarding use the following:- ssh -C -D 1080 username@ip-addr (Ex:- ssh -C -D 1080 tom@192.168.0.16 )




Next you would tell Firefox to use your proxy:

* go to Edit -> Preferences -> Advanced -> Network -> Connection -> Settings...
* check "Manual proxy configuration"
* make sure "Use this proxy server for all protocols" is cleared
* clear "HTTP Proxy", "SSL Proxy", "FTP Proxy", and "Gopher Proxy" fields
* enter "127.0.0.1" for "SOCKS Host"
* enter "1080" (or whatever port you chose) for Port.


You can also set Firefox to use the DNS through that proxy, so even your DNS lookups are secure:

* Type in about:config in the Firefox address bar
* Find the key called "network.proxy.socks_remote_dns" and set it to true

The SOCKS proxy will stop working when you close your SSH session. You will need to change these settings back to normal in order for Firefox to work again.

To make other programs use your SSH proxy server, you will need to configure each program in a similar way.



see:- https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding

Tested on ubuntu 10.04

Jitter Accepted Values in LAN

Hi all,

I measured jitter values for a LAN about 30 computers using iperf as follows:-


iperf -c 192.168.0.210 -ub 100m
------------------------------------------------------------
Client connecting to 192.168.0.210, UDP port 5001
Sending 1470 byte datagrams
UDP buffer size: 110 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.0.17 port 45559 connected with 192.168.0.210 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 109 MBytes 91.3 Mbits/sec
[ 3] Sent 77631 datagrams
[ 3] Server Report:
[ 3] 0.0-10.0 sec 109 MBytes 91.2 Mbits/sec 0.405 ms 0/77630 (0%)
[ 3] 0.0-10.0 sec 1 datagrams received out-of-order



[root@backup ~]# iperf -su -i 1
------------------------------------------------------------
Server listening on UDP port 5001
Receiving 1470 byte datagrams
UDP buffer size: 126 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.0.210 port 5001 connected with 192.168.0.17 port 45559

[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 3] 0.0- 1.0 sec 10.9 MBytes 91.1 Mbits/sec 0.041 ms 0/ 7745 (0%)
[ 3] 1.0- 2.0 sec 10.9 MBytes 91.4 Mbits/sec 0.027 ms 0/ 7768 (0%)
[ 3] 2.0- 3.0 sec 10.8 MBytes 90.8 Mbits/sec 0.059 ms 0/ 7722 (0%)
[ 3] 3.0- 4.0 sec 10.9 MBytes 91.3 Mbits/sec 0.175 ms 0/ 7761 (0%)
[ 3] 4.0- 5.0 sec 10.9 MBytes 91.3 Mbits/sec 0.031 ms 0/ 7763 (0%)
[ 3] 5.0- 6.0 sec 10.9 MBytes 91.3 Mbits/sec 0.026 ms 0/ 7762 (0%)
[ 3] 6.0- 7.0 sec 10.9 MBytes 91.3 Mbits/sec 0.161 ms 0/ 7762 (0%)
[ 3] 7.0- 8.0 sec 10.9 MBytes 91.3 Mbits/sec 0.034 ms 0/ 7760 (0%)
[ 3] 8.0- 9.0 sec 10.9 MBytes 91.3 Mbits/sec 0.039 ms 0/ 7763 (0%)
[ 3] 9.0-10.0 sec 10.9 MBytes 91.2 Mbits/sec 0.027 ms 0/ 7759 (0%)
[ 3] 0.0-10.0 sec 109 MBytes 91.2 Mbits/sec 0.405 ms 0/77630 (0%)
[ 3] 0.0-10.0 sec 1 datagrams received out-of-order


Now what I want to know is what are the acceptable values/limits/ranges for Jitter ?

what is the unit for measuring jitter or what is meant by this ms is it metre per second ?



Arimus:-


ms = miliseconds.

Acceptable value for jitter? Depends... email doesn't really care,ditto file transfer, web browsing etc. For voice over ip/video conferencing and some streaming protocols jitter impacts on the buffer sizes required and packetisation applied to the data - but 10's of miliseconds isn't unheard of so your figures look fine -- as they should on your LAN.

On your LAN you are below 1ms so that's more than acceptable.

Sunday, July 25, 2010

[FIX] Multisession issue with Nero Linux 4

Nero Linux Discuss, [FIX] Multisession issue with Nero Linux 4 at Nero & InCD forum; Dear all, Many of you experiences issues with Nero Linux 4 when continuing a multisession disc. Apparently, Nero Linux 4 is looking for some shared libs in the wrong folder, so, of course it is _NEVER_ possible to continue a multisession disc. This issue will of course be fixed in

Many of you experiences issues with Nero Linux 4 when continuing a multisession disc. Apparently, Nero Linux 4 is looking for some shared libs in the wrong folder, so, of course it is _NEVER_ possible to continue a multisession disc.

This issue will of course be fixed in the next release (don't ask for a date ), but you can use the following trick to make it work for now. As root,

* - Go in /usr/lib/nero (/usr/lib64/nero for the 64-bit version)
* - Once you are there, copy the files libISOFS.so and libUDFImporter.so to the /usr/lib (/usr/lib64 for the 64-bit version).

This should let you use the multisession features of Nero Linux 4.
Also remember to manually delete these 2 files before you uninstall or upgrade the nero linux package.



see:- http://club.myce.com/f104/ for more details

Linux Distro for cracking Windows Passwords

Server workstation services in Linux:-

what is the linux equivalent services of server & workstation services
in windows XP ?

In a LAN where majority of the machines are WinXP machines , sometimes
there wont be any file sharing/ printer sharing / scanner sharing bw
machines just because Server & workstation services aren't started so
in that context what will be the linux equivalent of these services ?





Mark Hobley:-

"Server service" provides file print and named pipe sharing over the network.So we have nfs for file sharing, printer sharing via lpd/lpr (or we can use samba or cups).For pipelines we can use the internet superservice daemon to route data to processes as we require.

(We also have samba, which provides Microsoft Windows compatible networking)

"Workstation service" allows client machines to connect the computer. I guess that means remote procedure call. (We have rsh)


natural philosopher:-

as far as workstations go, they will be there by default (client services)

You may need to configure/install/start various daemons on the server,Cups, samba, NFS etc, but teh client services are just 'there' by and large.

mount is equally capable of an nfs mount as a real disk.cups is as happy sending to a remote queue as to a locally connected printer.

You have to realise that Microsoft came late to networking: *nix was exepected to be in a fully networked environment from way back. Networking is built in to *nix. Its a bolt on with Micrsosoft, and that attitude persists, with home machine being essentially 'not networked'
by default.

This way Microsoft avoids having to make a decent OS that is reasonably secure on a network: instead it is all off by default, and protected by a monstrous firewall that stops it working.


schvantzkoph:-

SAMBA provides Windows file and printer sharing services. When you said server services that's vague in the Linux context because there are so many that are bundled into the typical Linux distro. In addition to SAMBA which provides Windows sharing services, there is NFS which provides Unix file sharing services, CUPS which provides modern printer sharing services (the older Unix printer services are also available), LDAP (light directory access protocol), ssh which provides remote shell and remote command services and remote file copying and syncing, there are a
couple of DNS servers available, multiple FTP servers available, multiple database servers, multiple web servers. That's off of the top of my head, there is a lot more.


Robert Heller:-

The other thing is this: Linux, like UNIX does NOT make the same sort of distintion between 'server' O/S vs. 'workstation' O/S that MS-Windows does. There isn't any such thing as a 'Linux Server' O/S as opposed to a 'Linux Workstation' O/S (eg the 'difference' between MS-Windows Server 2003 vs MS-Windows XP Home vs MS-Windows XP Pro). ANY Linux box can be a server, a workstation, or both at the same time, depending on what packages have been installed, how they have been configured, and what services have been started.

Thursday, July 22, 2010

Only HP printers for Linux users ??

My friend is of the argument that he will buy only H.P printers,because of the HPLIP (Hewlett Packard Linux Imaging project) where H.P developers work to make open source drivers available for linux and BSD. This is probably the only instance where the device manufacturers works on fully free open sourced projects which support the full functionality (not merely the just works bit)

how correct is his argument ?
does this mean that HP is the only Printer company that provides Linux driver support for its devices ?


what about the epson associate avasys (http://www.avasys.jp) ?

Is there any other company which provides similar support ?


David brown :-

There are several companies which provide good Linux support (drivers,ppd files, documentation, and officially supporting Linux). I don't have a list, but I know that Konica Minolta do a good job.

Henrik carlqvist

Also, if you are buying a more serious printer, there is no need to worry about support for different OSes. Instead the keyword to search for in the specifications is "PostScript". Most "printer drivers" for Linux translates postscript to some protocol specific for the printer. If the printer natively speaks postscript the host computer CPU will save some cycles and it will be easier to configure the printer

ray

With Linux, unlike MS, it is not necessary for a particular company to provide support. For example, a PCL4 printer is a PCL4 printer - that is a standard. So my Brother HL-1440 printer works impeccably with Linux. I have had excellent results with the avasys support on scanners and my Epson Stylus Photo R350. Samsung, Brother, and Lexmark all provide varying levels of support.

psaava
https://help.ubuntu.com/community/Printers

Drivers for linux distributions




see:- https://help.ubuntu.com/community/Printers

HPLIP




see:- http://hplipopensource.com/hplip-web/index.html
https://help.ubuntu.com/community/Printers

avasys




https://help.ubuntu.com/community/Printers

Tuesday, July 20, 2010

how to install sg3_utils in ubuntu (10.04)

Hi all,

I tried the following

I downloaded sg3_utils from the site :-http://linux.softpedia.com/progDownload/sg3-utils-Download-7371.html


sudo dpkg -i sg3-utils_1.29-0.1_i386.deb
Selecting previously deselected package sg3-utils.
(Reading database ... 153436 files and directories currently installed.)
Unpacking sg3-utils (from sg3-utils_1.29-0.1_i386.deb) ...
dpkg: dependency problems prevent configuration of sg3-utils:
sg3-utils depends on libsgutils2-2 (>= 1.29); however:
Version of libsgutils2-2 on system is 1.28-2.
dpkg: error processing sg3-utils (--install):
dependency problems - leaving unconfigured
Processing triggers for man-db ...
Errors were encountered while processing:
sg3-utils

How to resolve this dependency error ?

knudfl


Not really an error. When you have libsgutils 1.28,
then sg3_utils must be the same version.

The "sg3_utils homepage" has all versions of both:
http://sg.danny.cz/sg/sg3_utils.html#mozTocId479511

Find or identify which version of Debian Linux you are running

This can be checked in /etc/debian_version file

Find or identify which version of ubuntu Linux you are running

You can find in different ways in ubuntu

Solution 1

cat /etc/issue

The file /etc/issue holds the version of Ubuntu installed on your system

Solution 2

lsb_release -a

or

cat /etc/lsb-release

Sunday, July 18, 2010

cache information

I tried to get cache information on my machine as follows

getconf -a | grep -i cache

zodiac@zodioc:~$ getconf -a | grep -i cache
LEVEL1_ICACHE_SIZE 32768
LEVEL1_ICACHE_ASSOC 8
LEVEL1_ICACHE_LINESIZE 64
LEVEL1_DCACHE_SIZE 32768
LEVEL1_DCACHE_ASSOC 8
LEVEL1_DCACHE_LINESIZE 64
LEVEL2_CACHE_SIZE 1048576
LEVEL2_CACHE_ASSOC 8
LEVEL2_CACHE_LINESIZE 64
LEVEL3_CACHE_SIZE 0
LEVEL3_CACHE_ASSOC 0
LEVEL3_CACHE_LINESIZE 0
LEVEL4_CACHE_SIZE 0
LEVEL4_CACHE_ASSOC 0
LEVEL4_CACHE_LINESIZE 0



does this listing means that LINESIZE of my L2 cache is 64 bytes and that L2 cache is divided into units comprising of 8 cache lines(each of 64 bytes in size) ?


David

I'm no cache expert, but after looking around a bit, it appears instead like the each cache level is divided into 64 byte lines, and has a certain level of associativity. However, I couldn't tell you how the CACHE_ASSOC numbers compare to the actual levels. My system shows a level 1 assoc of 2, and a level 2 assoc of 16.

Edit: It looks like it really is just a simple x-ways-of-associativity. From another site I found a simple way to extract the cache data from /sys, and that's what it shows.
Code:

grep . /sys/devices/system/cpu/cpu*/cache/index*/*

Saturday, July 17, 2010

always create the locations that need frequent I/O /home, swap on the outer tracks ?

annalissa:-

The general rule is that you should always create the locations that need frequent I/O -/home, swap on the outer tracks , the easiest way to achieve this is to create these partitions first when partitioning your hard disk ?

Reason all modern H.D.D's use a concept called ZCAV(zonal constant angular velocity). this takes advantage of the fact that more linear space is available on the outer tracks of the disk platter rather than on the inside tracks. now since the disk spins at a constant rate , which is also known as CAV (constant angular velocity) the read/write I/O speed will be greater at the outer tracks as compared to the inner tracks

oldfred:-

Now if you have lots of RAM (over 2GB) you may never use swap except for hibernation or extreme cases of every program running or video editing. Will you be able to type faster or download from INTERNET faster? Those are the main bottlenecks.

Now if you have a server with large databases or millions of users hitting it, like google does, then fine tuning to that level may make a difference. Perhaps if you spend a lot of time compiling programs it may make a difference, but if it is that important then you should have SSD drive.


Matt giver:-

It is unlikely you will notice any improvement. 5400 is 90/second. Not much time no matter how you look at it.

But unless you are a sysadm with lots of users calling their files common files many times an hour, think of an office of insurance adjusters, your largest files are in /usr. As folks are always interested in bragging rights on availability (and even a newbie can get 0.999 availability) the boot directory is going to be first and /usr second on a normal install.

If you are having response time problems, increase RAM.

FWIW, this was a sort of geeky think to do on Windows in the 90s. I did it.Never saw a difference.


Aragorn

There are also a few other considerations, i.e. if your system has a lot of RAM, then you will
most likely not be using swap at all, or only under very rare circumstances.

Next to that, "/usr" is a filesystem which is primarily read-only, so it will under normal circumstances not be written to - I myself always have "/boot", "/usr" and "/opt" mounted read-only during normal operation - but just because it's not being written to does not mean
it's not being read.

"/usr" is where the bulk of the software is installed - technically: everything that is required for multi-user operation.

"/opt" is similar, except that it's for optional software, i.e. software which does not integrate well with the "/usr" hierarchy and may have been added on later.

"/usr/local" shares a similar purpose as "/opt" but is intended for software which was installed from sources by the sysadmin, as opposed to software in binary form supplied via the distribution-specific package manager.


So, all things considered, I would take the advice from that article with a grain of salt. Yes, it is good advice, but there are more things to consider


The Natural philosopher:-

Correct, but almost totally irrelevant.

since if disk I/O speeds are a problem, you have a real problem anyway.

And I would challenge that /home needs the fastest access. in terms of program loading /usr is far more relevant.

If /swap is being used extensively, you have a serious memory problem as well.

An /tmp is far more likely to be a frequent candidate. And /var.

So its a bit of irrelevant truth, a few bad or at least questionable assumptions all cobbled together by someone with nothing better to do to make a 'rule' that is at best worthless, and at worst, highly misleading. And which totally ignores disc caching.

Prevent users from changing their passwords

ls -l /usr/bin/passwd
-rwsr-xr-x 1 root root 37140 2010-01-26 12:09 /usr/bin/passwd

so we need to remove the suid for that command as follows :- chmod u-s /usr/bin/passwd

now normal users won't be able to change their own passwords - and only the root user will be able to do it for them.

Klettres

Thursday, July 15, 2010

How to know about the swap space usage ?

zodiac@gml-admin:~$ cat /proc/swaps
Filename Type Size Used Priority
/dev/sda6 partition 1464312 0 -1
zodiac@gml-admin:~$ swapon -s
Filename Type Size Used Priority
/dev/sda6 partition 1464312 0 -1
zodiac@gml-admin:~$ free -m
total used free shared buffers cached
Mem: 2013 1270 742 0 100 798
-/+ buffers/cache: 370 1642
Swap: 1429 0 1429
zodiac@gml-admin:~$

Encrypt your files with vim

vim can help you to encrypt your file so that no one can open it without knowing encryption key. all you need to do is

vim -x filename-you-want-to-create

the above command will prompt you for an encryption key. provide the key and remember it ,as you will need it to open the file from now on

K peterson

Open the encrypted file in vim using your old pass phrase. Now type :X and enter an empty pass phrase. Type :w and the file will be saved unencrypted.

play music in VLC without a GUI ?

vlc -I ncurses /home/dan/*.mp3

volume increase ---> A
volume decrease ---> Z

further options ---> H

Search in man pages

to search for a word in the description of the manual pages of all linux commands installed , use apropos command

syntax apropos


ex:- apropos list

When did i execute that command ?

Sunday, July 11, 2010

Limit the cpu usage of a process

we can use the cpulimit command to limit cpu usage of any process or application. you can limit a certain running application , either by its name or by it's pid

ex:-
cpulimit -e vlc -l 20
cpulimit -p 5319 -l 40


see:-
http://www.howtoforge.com/how-to-limit-cpu-usage-of-a-process-with-cpulimit-debian-ubuntu
http://ubuntuforums.org/showthread.php?t=992706

using vim as a mysql pager

mysql> pager less
PAGER set to 'less'
mysql> pager vim
PAGER set to 'vim'

Stop Wasting CDs; Install Linux Straight from an ISO

see:- http://www.linuxforu.com/teach-me/tips-tricks/install-linux-straight-from-an-iso/

Create secure passwords with openssl

Ex:- zodiac@zodioc:~$ openssl rand 12 -base64
mPoMmGadLZPBLw8Y


The above command created a random base 64 encoding string each time it is run . since the string you get from the command is different each time the command is run , it is secure and easy to create strong password this way






see also :-"http://aarklonlinuxinfo.blogspot.com/2009/03/encryptdecrypt-file-using-openssl-in.html"

when cpu isn't busy it is time to run my program

If you want to run a program/command when the cpu is free or not very busy, the tool you need is batch. it only executes commands when the system load level permits. In other words, when the load average drops below 1.5 or the value specified in the invocation of atd


ex:- zodiac@zodioc:~$ echo tar czf ~/Desktop/nabard.tar.gz ~/Desktop/nabard | batch
warning: commands will be executed using /bin/sh
job 2 at Sun Jul 11 16:06:00 2010

mounting NTFS partition on RHEL

yum install ntfs-3g

to automount the NTFS partition , add a line to the /etc/fstab

/dev/sdax /mnt ntfs defaults 0 0



followed by mount -a

Saturday, July 10, 2010

Debian Administration

Hardening ssh

Prevent root logins via ssh

/etc/ssh/sshd_config

add this line PermitRootLogin no

find the line that says Protocol 2,1 and change it to Protocol 2

AllowUsers carla fobber@mubble.com lori meflin
AllowGroups admin
Port 222
PasswordAuthentication no

see man 5 sshd_config

Monday, July 5, 2010

why KVM switch

Hi all,

can anybody explain me the trade off between a KVM switch and the use of a Desktop sharing software such as VNC viewer ?

slug slug

VNC / RDP are OK for Windows servers.. but what if your using Windows / Linux / BSD
then a KVM is needed / preferred -- it's a lot easier to switch between servers using a KVM

Also what if you needed to boot from CD or change BIOS settings..

ubusr

Some KVMs can also switch audio. I don't think VNC or other linux remote desktop software will handle audio. On the other hand, if the computers you want to switch between are far from where you are working, remote desktop software may be your only choice otherwise you run into issues with cable lengths. One convenient thing about software solutions is the possibility to cut/paste from one window/machine to the other.

ray

For one thing, it's going to take a lot of bandwidth to display the remote desktop on your current one - and it will be relatively slow because of that. A KVM switch physically changes your connections from one machine to the other so you are always operating 'locally' - no additional overhead.

chris davies

Unless you've got an enterprise grade server, desktop sharing software won't allow you to watch the BIOS level boot process.

lusotec

KVM is limited to connecting local (as in same desk/room) machines but has no performance overhead. VNC has performance penalties but can connect any machines on the internet.


anyone using kvm switch

see:- http://ubuntuforums.org/showthread.php?t=1134492

Find out the time taken for a commands execution

time ls -l
yieldsCode:

real 0m0.047s
user 0m0.004s
sys 0m0.000s

This indicates that as far as I could perceive it, it took about 50 milliseconds to execute, of which the commands REALLY ran for about 4 milliseconds in user space. Since the "ls" command doesnt' need anything from the system(kernel) to complete, the "sys" time is zero.

Run the command on a task that might take a little longer and start counting the seconds, and you'll find that the "real" portion will be inline with what you think has elapsed while the "sys" and "user" will tell you where the command was spending tmie..

!* trick:-

$cd /digit/long/path/pain/to/type/again

bash: cd: /home/zodiac/long/path/pain/to/type/again: No such file or directory

mkdir -p !* => mkdir -p /home/zodiac/long/path/pain/to/type/again

beloroin:-

I know that

$>!#

Executes the command found at # in your history and

$>!ba

Would execute the last command that starts with "ba", and that

$>ping !$

pbhj


where did you learn this?

How do you find the man page for ! or :

!?

mhallbiai

pbhj,

! is an event designator used in history expansion for bash.
there is a wealth of documentation for bash.
that just scratched the surface...
Code:
man bash
you can search the man pages for 'event designators' and it will bring you directly to ! paging up from there will explain HISTORY EXPANSION

: is a under SHELL BUILTIN COMMANDS discussed after !

hope this helps

many happy hours of reading

Sunday, July 4, 2010

watch videos in command line

1) install mplayer (sudo apt-get install mplayer)

2) mplayer -vo caca filename.mp4

for black & white

mplayer -vo aa filename.mp4


gedit plugins

Edit > Preferences > Plugins to install and configure them

available plugins include spell checker, sort, change case, python console, embedded terminal etc

nautilus scripts

1) http://g-scripts.sourceforge.net/nautilus-scripts.tar.gz ; download all the scripts

2) extract the package and put the contents in your .gnome2 directory in your home directory

3) these are the only scripts and depend upoun other software for certain functionality
so install the following packages to get additional functionality for right click

i) mencoder, transcode, imagemagick
ii) nautilus-open-terminal,nautilus-image-converter, nautilus-script-audio-convert

How to change your mac address

ifconfig eth0 down
ifconfig eth0 hw ether ff:ff:ff:ff:ff:ff
ifconfig eth0 up

Saturday, July 3, 2010

overriding an alias:-

often we use an alias like this alias ls="ls -latr" sometimes you want to run ls without these arguments , what you need to do is execute ls as \ls

Thursday, July 1, 2010

How to install Gui in centos 5.3 ?

yum groupinstall "X Window System"
yum groupinstall "GNOME Desktop ENvironment"

how to find out the version of centos you are using ?

cat /etc/redhat-release

DNS cache cleaning

install nscd tool , make sure that it is running in the background as a daemon.to clear cache

In ubuntu if you want to flush DNS cache you need to restart nscd daemon

Install nscd using the following command

sudo aptitude install nscd

Flush DNS Cache in Ubuntu Using the following command

sudo /etc/init.d/nscd restart


why clear DNS cache ?

So if you have an invalid DNS entry cached on your local client you’ll need to flush it out of the cache so your client can do a new lookup and get the correct information. Or your other option is to wait until that DNS entry expires and the cache flushes it automatically… which typically takes about 24 hours.

make the command line you type invisible :-

to hide the user input to be displayed on screen, use the terminal line setting command stty -echo, whatever the user enters after this command will not be displayed in the screen. to make the input characters get displayed on the screen use stty echo

unixfool

If I were that worried about what the system would show based on CLI output, I'd either dump the results to file or /dev/null or wait until no one else is around to observe.