Recently I faced wearied scenario where I am unable to view access logs of lighttpd.
Even though after adding accesslog.filename = “/var/log/lighttpd/access.log” line in lighttpd.conf file logs are not getting updated in lighttpd.conf file
After debugging for a while I seen following error in /var/log/lighttpd/error.log:
WARNING: unknown config-key: accesslog.filename (ignored)
To fix this issue I adding “mod_accesslog” to servers.modules in lighttpd.conf file & restarted lighttpd. After that issue got resolved.
Following is my server.modules after adding mod_accesslog:
server.modules = (
Recently while I am trying to restart HBase I got error message saying that “ERROR: There is a hole in the region chain between …… You need to create a new .regioninfo and region dir in hdfs to plug the hole”.
Following is the error message:
ERROR: There is a hole in the region chain between TestTable,2,1415170922328.3c1b2a210888171d142059912e2faba1. and TestTable,3,1415171044919.da852e5b0034a2ca83f6966280454b4a. You need to create a new .regioninfo and region dir in hdfs to plug the hole.
ERROR: Found inconsistency in table TestTable
To fix this issue you need to stop HBase and delete recover.edits folders for failing regions.
After that start HBase and run hbck which should succeed.
While trying to install some python module I got following exception:
fatal error: Python.h: No such file or directory
Reason for exception:
If you haven’t properly installed the header files and static libraries for python dev this issue may occur.
To resolve this issue install python-dev module by using following command:
$ sudo apt-get install python-dev
fping is a ping like program which uses the Internet Control Message Protocol (ICMP) echo request to determine if a host is up.
With fping we can ping multiple hosts at a time. Use following command to ping multiple hosts:
$ fping -f IPsFiles.txt
where in IPsFiles.txt I have multiple hots.
Below are some other examples of fping:
To ping a host/IP:
$ fping 192.168.2.2
192.168.2.2 is alive
$ fping 192.168.2.22
192.168.1.22 is unreachable
To ping range of IP’s:
$ fping -g 192.168.2.0/24
To list only unreachable hosts/IP’s
$ fping -q -u -f IPsFiles.txt
where -q is for Quiet mode and -u is to list only unreachable targets.
To list only reachable hots/IP’s
$ fping -q -a -f IPsFiles.txt
where -a is to list only alive hots.
While trying to install some module I got error saying that “OpenSSL is not properly installed on your system ubuntu”.
I tried to reinstall this module after installing openssl, but no luck.
After debugging and exploring for a while I got to know that installing libssl-dev could resolve this issue, so I installed libssl-dev with following command:
$ sudo apt-get install libssl-dev
Now retried installation and it worked like charm.
Couchbase Server, originally known as Membase, is an open-source, distributed (shared-nothing architecture) NoSQL document-oriented database that is optimized for interactive applications.
By default couchbase-cli command is located at /opt/couchbase/bin/couchbase-cli.
To list servers:
$ /opt/couchbase/bin/couchbase-cli server-list -c hostname:8091 -u username -p password
To list buckets:
$ /opt/couchbase/bin/couchbase-cli bucket-list -c hostname:8091 -u username -p password
To get server info:
$ /opt/couchbase/bin/couchbase-cli server-info -c hostname:8091 -u username -p password
$ /opt/couchbase/bin/couchbase-cli help
To allow only an ip to access a port use following iptables rule
iptables -I INPUT -p tcp -m tcp -s 192.168.2.20 --dport 8080 -j ACCEPT
Above iptables rule will allow only 192.168.2.20 to access port 8080 and reject all other ip addresses.
Similarly we can give any other ip address and port combination.
To run a cron every 30 seconds check following example:
* * * * * /path/to/your/script arg1 arg2
* * * * * (sleep 30; /path/to/your/script arg1 arg2)
In above example both commands will start at 0th second of every minute, but the second command will sleep for 30 seconds and then start.
By default search keyword won’t be highlighted in vim with Ubuntu OS.
To highlight search keyword we need to set hlsearch flag in vimrc.
Open /etc/vim/vimrc with sudo and append following line in it:
After that save & exit from vimrc file. This will enable search keyword highlight across all vim sessions.
If you want to enable highlighting only for current session run following command in vim after opening a file:
By using –limit argument with ansible-playbook command we can exclude a host from playbook execution.
If hostname starts with “!” it will excluded from host execution.
Lets say if we want to exclude host1 and host2 from ansible-playbook execution use following command:
$ ansible-playbook --limit '!hoost1:!host2' yourPlaybook.yml
To exclude only host1 from execution use following command:
$ ansible-playbook --limit '!hoost1' yourPlaybook.yml
To execute only in host1 and host2 from execution use following command:
$ ansible-playbook --limit 'hoost1:host2' yourPlaybook.yml
To execute only in host1 use following command:
$ ansible-playbook --limit 'hoost1' yourPlaybook.yml
To exclude host1 and host2 from execution and allow execution only in host3:
$ ansible-playbook --limit '!hoost1:!host2:host3' yourPlaybook.yml