Access VirtualBox Guest via Host
Tue, 05/28/2013 - 15:46 — sandipGo to VirtualBox Preferences and under "Network", add host-only network. This will add a new vboxnet0 interface, which comes up as "192.168.56.1/24"
In the Guest Settings, add the "Host-only" to a second "Network Adapter"
Once Guest boots up, assign a static IP to the second adapter.
For Debian based servers, edit /etc/network/interfaces and add the below, which should bring up the network upon reboot:
auto eth1
iface eth1 inet static
address 192.168.56.101
netmask 255.255.255.0
You should now be able to ping and ssh to the guest via the host server on the second interface.
- sandip's blog
- Login or register to post comments
- Read more
Ensim Zone File Template
Tue, 04/09/2013 - 08:09 — sandipAll bind templates are at "/usr/lib/opcenter/bind" location.
Modify "named_conf_zone.tmpl" file to allow for transfers adding in the IP addresses of secondary DNS.
- sandip's blog
- Login or register to post comments
- Read more
Changing IP address of Ensim server
Wed, 04/03/2013 - 15:33 — sandipTo change the IP address of an Ensim server, modify the following files replacing any instance of the old IP address with the new one:
/etc/hosts
/etc/resolv.conf
/etc/sysconfig/network
/etc/sysconfig/network-scrip ts/ifcfg-eth0
/etc/virtualhosting/namebase d_ip_addrs
/etc/httpd/conf/httpd20_app. conf
/etc/virtualhosting/localnam eserver
/etc/bind/options.conf.wp
/>/home/virtual/FILESYSTEMTEMP LATE/siteinfo/etc/resolv.conf
Reboot the server, then run the "NBDetectchanges"
/usr/local/bin/NBDetectchanges
- sandip's blog
- Login or register to post comments
- Read more
How to install Icinga (Nagios Fork) in Ubuntu 12.10 server
Fri, 03/15/2013 - 02:25 — david23Icinga is an enterprise grade open source monitoring system which keeps watch over networks and any conceivable network resource, notifies the user of errors and recoveries and generates performance data for reporting. Scalable and extensible, Icinga can monitor complex, large environments across dispersed locations.
- david23's blog
- Login or register to post comments
- Read more
manually updating java in ubuntu
Wed, 02/27/2013 - 09:59 — sandipBelow is outlined the process of updating to the latest JDK in ubuntu and updating the alternatives link manually to point the the latest java:
Step 1: Download:
wget http://download.oracle.com/otn -pub/java/jdk/7u15-b03/jdk-7u1 5-linux-x64.tar.gz
cd /usr/lib/jvm/
tar -xzf ~/downloads/jdk-7u15-linux-x64 .tar.gz
Step 2: If java-7-sun already exists, the below is all that is needed if not skip to step 3 if this is the first time it is setup:
unlink java-7-sun
ln -s jdk1.7.0_15 java-7-sun
Step 3: If java-7-sun link does not already exists:
ln -s jdk1.7.0_15 java-7-sun
update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/java-7-sun/ bin/java" 1
update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/java-7-sun/ bin/javac" 1
update-alternatives --install "/usr/lib/mozilla/plugins /libjavaplugin.so" "mozilla-javaplugin.so&qu ot; "/usr/lib/jvm/java-7-sun/ jre/lib/amd64/libnpjp2.so" ; 1
update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/java-7-sun/ bin/javaws" 1
Step 4: Choose the java just installed as default:
update-alternatives --config java
update-alternatives --config javac
update-alternatives --config javaws
update-alternatives --config mozilla-javaplugin.so
- sandip's blog
- Login or register to post comments
- Read more
Resetting WordPress admin password
Fri, 02/22/2013 - 14:09 — sandipHere is the sql to reset admin password for wordpress:
update wp_users set user_pass=md5("NEWPASS&qu ot;) where ID=1;
Even if the passwords are salted, you can still replace the password with an MD5 hash.
- sandip's blog
- Login or register to post comments
- Read more
Install yum from centos vault
Tue, 02/12/2013 - 14:53 — sandipI had to update an old release of CentOS-5.5 on an OpenVZ container where yum was not available.
The below script should automatically download and install the required rpms from "vault.centos.org".
#!/bin/bash
# install_yum.sh
rpms="
&nbs p; rpm-libs-4.4.2.3-18.el5.x86_64 .rpm
&nbs p; popt-1.10.2.3-18.el5.x86_64.rp m
&nbs p; rpm-4.4.2.3-18.el5.x86_64.rpm< br /> &nbs p; python-elementtree-1.2.6-5.x86 _64.rpm
&nbs p; python-iniparse-0.2.3-4.el5.no arch.rpm
&nbs p; python-sqlite-1.1.7-1.2.1.x86_ 64.rpm
&nbs p; rpm-python-4.4.2.3-18.el5.x86_ 64.rpm
&nbs p; python-urlgrabber-3.1.0-5.el5. noarch.rpm
&nbs p; yum-fastestmirror-1.1.16-14.el 5.centos.1.noarch.rpm
&nbs p; yum-metadata-parser-1.1.2-3.el 5.centos.x86_64.rpm
&nbs p; yum-3.2.22-26.el5.centos.noarc h.rpm
"
for rpm in $rpms
do
rpm -Uvh --nodeps http://vault.centos.org/5.5/os /x86_64/CentOS/${rpm};
done
- sandip's blog
- Login or register to post comments
- Read more
Disabling IDLE in courier-imap
Wed, 02/06/2013 - 09:26 — sandipApple and BlackBerry email clients has a configurable setting to use the IMAP IDLE functionality to stay logged in, periodically checking email. This causes imapd to run out of daemons and stop responding. One solution is to raise MAXDAEMONS in /etc/courier-imap/imapd, but will eventually cause high loads on the server.
The better solution is to disable IDLE entirely in /etc/courier-imap/imapd by removing "IDLE" option from "IMAP_CAPABILITY".
Change:
IMAP_CAPABILITY="IMAP4rev 1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE"
To:
IMAP_CAPABILITY="IMAP4rev 1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA"
Upon courier-imap restart, this should prevent connections from persisting.
Telnet to imap port 143 to verify that the IDLE option is not present anymore in CAPABILITY response from the server.
- sandip's blog
- Login or register to post comments
- Read more
force qmail to process mail queue
Tue, 01/08/2013 - 22:16 — sandipUse qmail-qstat or qmail-qread to check the messages in queue.
Run qmail-tcpok to clear out the TCP timeout table.
After that, send the "ALRM " signal to the "qmail-send" process, and Qmail will process all messages in the queue immediately:
kill -ALRM `ps ax | grep [q]mail-send | awk '{print $1}'`
- sandip's blog
- Login or register to post comments
- Read more
monitor and kill long running mysql select statements
Fri, 12/21/2012 - 17:29 — sandipBelow script checks and kills any sql SELECT statements that has been running for more than 60 seconds. The script can be added to a cron task to be run periodically. Make sure to check the log file it creates to keep an eye on the long running sql statements and tune it.
#!/bin/bash
LOG=/tmp/kill_mysql.log
SECONDS=60
echo "####" `date` "####" >>${LOG}
PIDS=$(mysql -t -e 'show full processlist' | awk -F'|' -v seconds="$SECONDS" '$7 > seconds && toupper($9) ~ /^ SELECT/ {print $0}' | tee -a $LOG | awk -F'|' '{print $2}')
[ -n "$PIDS" ] && mysqladmin kill `echo $PIDS | tr ' ' ','`
Prior to running it, setup the root login in "~/.my.cnf" file with the login credentials:
[client]
user=root
password=xxxxxxxx
- sandip's blog
- Login or register to post comments
- Read more