Raza
  • Member for 9 years, 2 months
  • Last seen this week
Health check of web page using curl
28 votes

I think that for the simplest way to check if the site is alive, you could use the following method: curl -Is http://www.google.com | head -n 1 This will return HTTP/1.1 200 OK. If the return doesn'...

View answer
What should I include and exclude with rsync to back up my system?
2 votes

You can take full system backup using rsync. You can use --exlude=PATTERN for all directories that do not required . rsync -- a fast, versatile, remote (and local) file-copying tool -a, --archive ...

View answer
Get environment variable of other user
0 votes

from root you can su - to the user and then grep the environment variable that you want to see: su - <username> -c 'echo $PATH'

View answer
rsyslog suppose to writing remote logs to a file by remote host name or ip address?
Accepted answer
0 votes

It is working after making the following change /%FROMHOST%/%FROMHOST%- from %HOSTNAME%/%HOSTNAME%

View answer
Why is dmesg called dmesg?
0 votes

According to Wikipedia, dmesg is "display message or driver message"

View answer
Error: Can't open display: localhost:0.0 but :0.0 works
0 votes

As mentioned on https://sourceware.org/ml/cygwin-announce/2015-10/msg00111.html '-nolisten tcp' is now the default, so the server only accepts local connections on a unix domain socket. A '-listen' ...

View answer
Cygwin X doesn't work with DISPLAY localhost:0 on windows 10
3 votes

This is how you can void "-nolisten tcp" option and run xserver automatiaclly: <path-to-cygwin>\bin\run.exe -p /usr/X11R6/bin XWin -listen tcp -multiwindow -clipboard -silent-dup-error

View answer
Can you create a volumegroup in LVM that all the Logical volumes created under it will be thin provisioned?
1 votes

Yes, You can create a volumegroup for thin provisioning. The following are the detail steps, copied from here: # pvcreate /dev/sdd Writing physical volume data to disk "/dev/sdd" Physical volume "/...

View answer
Odd Cygwin netstat output
Accepted answer
1 votes

Make sure that you are picking the correct netstat for your platform. which netstat will give you path where it is executing it from.

View answer
Does the NICs have any kind of log?
0 votes

if you are not able to ping then there few things you could check before restarting the interface: resolv.conf: make sure you are pinging to IP as well as hostname. ping to gateway or any host within ...

View answer
Browsers doesn't see aliases in /etc/hosts
1 votes

You need to make sure your system is configure to use host file for the dns by confirming /etc/nsswitch.conf file. It should look like #hosts: db files nisplus nis dns hosts: files nis ...

View answer
Debian: chgrp doesn't works properly on home folder
1 votes

I think you are confusing the first 2 with your user 2. The first 2 represent total number of hard links and then second 2 is your user and then group name either bin or 34 after you changes. Here is ...

View answer
Why when I ssh into one server it shows bash and the other have my username?
3 votes

Your home folder may not be identical on each system. You can check .bashrc or .bash_profile scripts are handle on each server. for the prompt you need to include export PS1="\u@\h \w> " in your ...

View answer
List ports a process PID is listening on (preferably using iproute2 tools)?
18 votes

You can use netstat for this to figure out pid of each listen process. netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships -a,...

View answer
an application required libstdc++ for GLIBCXX_3_4_9 library on RHEL 5 64bit system
Accepted answer
0 votes

The following script did it all. It not only download and compile GCC4.4 package but also download and compile necessary dependencies. You may need to install #yum install zsh before run this script ...

View answer
How can I remove all comments from a file?
2 votes

You can use invert match like this: #grep -v "#" filename -v, --invert-match Invert the sense of matching, to select non-matching lines. (-v is specified by POSIX.)

View answer
URL Rewrite on debian not working
Accepted answer
1 votes

The default installation of Apache2 comes with mod_rewrite installed. To check whether this is the case, verify the existence of /etc/apache2/mods-available/rewrite.load. $ cat /etc/apache2/...

View answer
How to get the pid of a process and invoke kill -9 on it in the shell script?
0 votes

You would also check /proc/1234 (known pid) if process is running. lot of application save pid under /var/log for the reference to make sure it is the same process in case of duplicate name. You can ...

View answer
What are some practical uses of STDIN redirection?
2 votes

Standard Input (stdin) Redirection In Linux, cat command is used to print the content of a file. However, if cat command is executed without any input argument then by default it tries to read from ...

View answer
Count the maximum character length for all the data fields in a simplified csv file and output to txt
0 votes

I don't see your link for the sample file but you can do this by using awk command. if can specify what ever delimiter you may have and exactly what field you need to count. awk '{ FS = "," } ; {...

View answer
How to view second hard drive with Windows 7 in Linux
1 votes

You may need to install the following required packages which Centos by default does not support ntfs (Make sure you have the rpmforge repo installed) Install the following packages. ...

View answer
sftp script to get a file from remote machine
2 votes

Another way to automate this process is to use expect script. Here is an example: for example: #!/usr/bin/expect -f spawn sftp ftpusername@phcsftp.pearsoned.com:/dir/file.txt expect "user@...

View answer
Error initializing server: OC4J administrator account is not configured
Accepted answer
2 votes

After re-installation of OS before applying any specific configuration I was able to start oc4j service. After narrowing it down to which configuration was exactly causing this not to start was came ...

View answer
How to allow access to a directory and don't allow access to a sub-directory in Apache?‏
3 votes

You can create .htaccess with the following option, file in a directory that you do not want to show the listing. Order Deny,Allow Deny From All Allow From 192.168.1.2 steps: cd /...

View answer
Determining RHEL Type (Workstation vs Server)
Accepted answer
3 votes

You can tell by looking at /etc/redhat-release. Here is how they look like on each system: Workstation: /etc/redhat-release Red Hat Enterprise Linux Workstation release 6.2 Beta Client: /etc/...

View answer
Spoofing or removing DHCP client hostname in response to DHCP server
Accepted answer
5 votes

You can find host-name in dhcp client configuration to remove or add hostname. For example: Debian / Ubuntu Linux - /etc/dhcp3/dhclient.conf $ sudo vi /etc/dhcp3/dhclient.conf Set hostname as you ...

View answer
How to increase the memory used by Java in linux?
2 votes

You will need to modify the vuze shell script. This shell script is actually a link to a file called azureus, vuze's previous name. Within this script change the line JAVA_ARGS="-Xmx128m" to JAVA_ARGS=...

View answer
How to monitor Memory utilization of the single process?
2 votes

Try this. if you want with program name mypid=`pidof programname` ; top -p $mypid OR top -p `pidof programname`

View answer
SCP Automation in production environment
1 votes

Following an article from here: You should setup SSH connection without Password Using ssh-keygen then it will allow you to use scp without prompting password or any other remote task: 3 Steps to ...

View answer
how to get exit status from command in expect script
Accepted answer
1 votes

I am guessing this. I didn't try it myself. Let's see if it works. expect_ACTIVATE=`cat << EOF` set timeout -1 spawn $VPNC expect : {send Pass123\r} expect "\\$ " send "status=`...

View answer