Praji’s Weblog

Welcome to praji’s world

Cpanel Hangs on Update

leave a comment »

Reason for hang up : RPM database could be corrupted, it needs to be rebuild and run upcp again

Procedure1. Login to CLI via SSH
2. Kill any /scripts/upcp process or yum or up2date
killall upcp
killall yum
killall up2date
3. you can try getting the PID also by doing this
ps -wef |grep yum
ps -wef |grep upcp
ps -wef |grep up2date
4. Execute a force kill command through kill -9
5. Once everything is killed , go to /var/lib/rpm
6. Execute rm -f __* , this is the rpm database that it builds when cpanel updates
7. Run rpm –rebuilddb
8. Re-run /scripts/upcp –force (–force switch forces cpanel update even if it is up to date)
9. Constantly check http://layer1.cpanel.net for Changelogs

Advertisements

Written by praji

May 26, 2009 at 1:11 pm

Posted in Uncategorized

Install Ruby on CPanel

leave a comment »

If you are using CPanel 11 (the latest version available at this time) you can easily install ruby on your system using CPanel. Previously, you had to do this using operating system packages or manually from sources. Now, we can just run /scripts/installruby and this will do everything for us:

  • download, compile and install ruby
  • download and install RubyGems and some gems like rails and mongrel

/scripts/installruby
At this time it will install the latest 1.8 ruby:
ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux]

and the following gems (using rubygems-1.1.1):
gem list
actionmailer (2.1.0)
actionpack (2.1.0)
activerecord (2.1.0)
activeresource (2.1.0)
activesupport (2.1.0)
cgi_multipart_eof_fix (2.5.0)
daemons (1.0.10)
fastthread (1.0.1)
gem_plugin (0.2.3)
mongrel (1.1.5)
rails (2.1.0)
rake (0.8.1)

This should be enough for running ruby scripts, but if you want to use Ruby On Rails from within CPanel then you just have to complete this by running /usr/local/cpanel/bin/ror_setup. If you are interested to deploy RoR environments on CPanel you can do this from inside CPanel. For more information check out the CPanel docs.

Written by praji

May 15, 2009 at 12:48 am

Posted in Uncategorized

openSSH PRNG not seeded

leave a comment »

openSSH PRNG not seeded

This errror is usually seen when the random number generator is broken.

To fix this

Remove the random devices

rm -rf /dev/random && rm -rf /dev/urandom

now recreate both

mknod /dev/random c 1 8 &&  mknod /dev/random c 1 9

Written by praji

February 2, 2009 at 5:11 pm

Posted in Uncategorized

SSH not starting in VPs

with one comment

First check /var/log/messages and /var/log/secure

If you find something like this, “fatal: daemon() failed: No such device.” then here is the fix.

rm -rf /dev/null
mknod /dev/null c 1 3
/etc/rc.d/init.d/sshd restart

Written by praji

January 3, 2009 at 6:09 am

Posted in Uncategorized

¿ʇı̣ əsnqɐ ʇ,uɐɔ noʎ ɟı̣ əpoɔı̣un sı̣ pooɓ ʇɐɥʍ

leave a comment »

At first when my friend put his name upside down in orkut, I was actually amazed. How it is done ??

Its just abusing the unicode, I wonder  which head this actually behind this wonder idea.

Each character is mapped to some other unicode character which resembles as if the character is put upside down.

The mapping is done based on the below given chart.

Mapping

From To
! – EXCLAMATION MARK (U+0021) ¡ – INVERTED EXCLAMATION MARK (U+00A1)
” – QUOTATION MARK (U+0022) „ – DOUBLE LOW-9 QUOTATION MARK (U+201E)
& – AMPERSAND (U+0026) ⅋ – TURNED AMPERSAND (U+214B)
‘ – APOSTROPHE (U+0027) , – COMMA (U+002C)
( – LEFT PARENTHESIS (U+0028) ) – RIGHT PARENTHESIS (U+0029)
. – FULL STOP (U+002E) ˙ – DOT ABOVE (U+02D9)
3 – DIGIT THREE (U+0033) Ɛ – LATIN CAPITAL LETTER OPEN E (U+0190)
4 – DIGIT FOUR (U+0034) ᔭ – CANADIAN SYLLABICS YA (U+152D)
6 – DIGIT SIX (U+0036) 9 – DIGIT NINE (U+0039)
7 – DIGIT SEVEN (U+0037) Ɫ – LATIN CAPITAL LETTER L WITH MIDDLE TILDE (U+2C62)
; – SEMICOLON (U+003B) ؛ – ARABIC SEMICOLON (U+061B)
< – LESS-THAN SIGN (U+003C) > – GREATER-THAN SIGN (U+003E)
? – QUESTION MARK (U+003F) ¿ – INVERTED QUESTION MARK (U+00BF)
A – LATIN CAPITAL LETTER A (U+0041) ∀ – FOR ALL (U+2200)
B – LATIN CAPITAL LETTER B (U+0042) 𐐒 – DESERET CAPITAL LETTER BEE (U+10412)
C – LATIN CAPITAL LETTER C (U+0043) Ↄ – ROMAN NUMERAL REVERSED ONE HUNDRED (U+2183)
D – LATIN CAPITAL LETTER D (U+0044) ◖ – LEFT HALF BLACK CIRCLE (U+25D6)
E – LATIN CAPITAL LETTER E (U+0045) Ǝ – LATIN CAPITAL LETTER REVERSED E (U+018E)
F – LATIN CAPITAL LETTER F (U+0046) Ⅎ – TURNED CAPITAL F (U+2132)
G – LATIN CAPITAL LETTER G (U+0047) ⅁ – TURNED SANS-SERIF CAPITAL G (U+2141)
J – LATIN CAPITAL LETTER J (U+004A) ſ – LATIN SMALL LETTER LONG S (U+017F)
K – LATIN CAPITAL LETTER K (U+004B) ⋊ – RIGHT NORMAL FACTOR SEMIDIRECT PRODUCT (U+22CA)
L – LATIN CAPITAL LETTER L (U+004C) ⅂ – TURNED SANS-SERIF CAPITAL L (U+2142)
M – LATIN CAPITAL LETTER M (U+004D) W – LATIN CAPITAL LETTER W (U+0057)
N – LATIN CAPITAL LETTER N (U+004E) ᴎ – LATIN LETTER SMALL CAPITAL REVERSED N (U+1D0E)
P – LATIN CAPITAL LETTER P (U+0050) Ԁ – CYRILLIC CAPITAL LETTER KOMI DE (U+0500)
Q – LATIN CAPITAL LETTER Q (U+0051) Ό – GREEK CAPITAL LETTER OMICRON WITH TONOS (U+038C)
R – LATIN CAPITAL LETTER R (U+0052) ᴚ – LATIN LETTER SMALL CAPITAL TURNED R (U+1D1A)
T – LATIN CAPITAL LETTER T (U+0054) ⊥ – UP TACK (U+22A5)
U – LATIN CAPITAL LETTER U (U+0055) ∩ – INTERSECTION (U+2229)
V – LATIN CAPITAL LETTER V (U+0056) ᴧ – GREEK LETTER SMALL CAPITAL LAMDA (U+1D27)
Y – LATIN CAPITAL LETTER Y (U+0059) ⅄ – TURNED SANS-SERIF CAPITAL Y (U+2144)
[ – LEFT SQUARE BRACKET (U+005B) ] – RIGHT SQUARE BRACKET (U+005D)
_ – LOW LINE (U+005F) ‾ – OVERLINE (U+203E)
a – LATIN SMALL LETTER A (U+0061) ɐ – LATIN SMALL LETTER TURNED A (U+0250)
b – LATIN SMALL LETTER B (U+0062) q – LATIN SMALL LETTER Q (U+0071)
c – LATIN SMALL LETTER C (U+0063) ɔ – LATIN SMALL LETTER OPEN O (U+0254)
d – LATIN SMALL LETTER D (U+0064) p – LATIN SMALL LETTER P (U+0070)
e – LATIN SMALL LETTER E (U+0065) ǝ – LATIN SMALL LETTER TURNED E (U+01DD)
f – LATIN SMALL LETTER F (U+0066) ɟ – LATIN SMALL LETTER DOTLESS J WITH STROKE (U+025F)
g – LATIN SMALL LETTER G (U+0067) ƃ – LATIN SMALL LETTER B WITH TOPBAR (U+0183)
h – LATIN SMALL LETTER H (U+0068) ɥ – LATIN SMALL LETTER TURNED H (U+0265)
i – LATIN SMALL LETTER I (U+0069) ı – LATIN SMALL LETTER DOTLESS I (U+0131)
j – LATIN SMALL LETTER J (U+006A) ɾ – LATIN SMALL LETTER R WITH FISHHOOK (U+027E)
k – LATIN SMALL LETTER K (U+006B) ʞ – LATIN SMALL LETTER TURNED K (U+029E)
l – LATIN SMALL LETTER L (U+006C) ʃ – LATIN SMALL LETTER ESH (U+0283)
m – LATIN SMALL LETTER M (U+006D) ɯ – LATIN SMALL LETTER TURNED M (U+026F)
n – LATIN SMALL LETTER N (U+006E) u – LATIN SMALL LETTER U (U+0075)
r – LATIN SMALL LETTER R (U+0072) ɹ – LATIN SMALL LETTER TURNED R (U+0279)
t – LATIN SMALL LETTER T (U+0074) ʇ – LATIN SMALL LETTER TURNED T (U+0287)
v – LATIN SMALL LETTER V (U+0076) ʌ – LATIN SMALL LETTER TURNED V (U+028C)
w – LATIN SMALL LETTER W (U+0077) ʍ – LATIN SMALL LETTER TURNED W (U+028D)
y – LATIN SMALL LETTER Y (U+0079) ʎ – LATIN SMALL LETTER TURNED Y (U+028E)
{ – LEFT CURLY BRACKET (U+007B) } – RIGHT CURLY BRACKET (U+007D)
‿ – UNDERTIE (U+203F) ⁀ – CHARACTER TIE (U+2040)
⁅ – LEFT SQUARE BRACKET WITH QUILL (U+2045) ⁆ – RIGHT SQUARE BRACKET WITH QUILL (U+2046)
∴ – THEREFORE (U+2234) ∵ – BECAUSE (U+2235)

Since it is a bit difficult to map these manually, people started writing their on scripts for this. Such a sample script is given below.

JavaScript Code

For the JavaScript hackers out there, here’s some code to test with (code from revfad):

function flipString(aString)
{
	var last = aString.length - 1;
	//Thanks to Brook Monroe for the
	//suggestion to use Array.join
	var result = new Array(aString.length)
	for (var i = last; i >= 0; --i)
	{
		var c = aString.charAt(i)
		var r = flipTable[c]
		result[last - i] = r != undefined ? r : c
	}
	return result.join('')
}

var flipTable = {
'\u0021' : '\u00A1',
'\u0022' : '\u201E',
'\u0026' : '\u214B',
'\u0027' : '\u002C',
'\u0028' : '\u0029',
'\u002E' : '\u02D9',
'\u0033' : '\u0190',
'\u0034' : '\u152D',
'\u0036' : '\u0039',
'\u0037' : '\u2C62',
'\u003B' : '\u061B',
'\u003C' : '\u003E',
'\u003F' : '\u00BF',
'\u0041' : '\u2200',
'\u0042' : '\u10412',
'\u0043' : '\u2183',
'\u0044' : '\u25D6',
'\u0045' : '\u018E',
'\u0046' : '\u2132',
'\u0047' : '\u2141',
'\u004A' : '\u017F',
'\u004B' : '\u22CA',
'\u004C' : '\u2142',
'\u004D' : '\u0057',
'\u004E' : '\u1D0E',
'\u0050' : '\u0500',
'\u0051' : '\u038C',
'\u0052' : '\u1D1A',
'\u0054' : '\u22A5',
'\u0055' : '\u2229',
'\u0056' : '\u1D27',
'\u0059' : '\u2144',
'\u005B' : '\u005D',
'\u005F' : '\u203E',
'\u0061' : '\u0250',
'\u0062' : '\u0071',
'\u0063' : '\u0254',
'\u0064' : '\u0070',
'\u0065' : '\u01DD',
'\u0066' : '\u025F',
'\u0067' : '\u0183',
'\u0068' : '\u0265',
'\u0069' : '\u0131',
'\u006A' : '\u027E',
'\u006B' : '\u029E',
'\u006C' : '\u0283',
'\u006D' : '\u026F',
'\u006E' : '\u0075',
'\u0072' : '\u0279',
'\u0074' : '\u0287',
'\u0076' : '\u028C',
'\u0077' : '\u028D',
'\u0079' : '\u028E',
'\u007B' : '\u007D',
'\u203F' : '\u2040',
'\u2045' : '\u2046',
'\u2234' : '\u2235'
}

for (i in flipTable)
{
	flipTable[flipTable[i]] = i
}



Terms of Service | Privacy Policy | Contact Info

Written by praji

December 9, 2008 at 12:50 am

Posted in Uncategorized

Hyper Vm installation

leave a comment »

HyperVM is a web based application that will allow you to create and manage different Virtual Machines each with each vps having its own Operating System. HyperVM also allows you to run multiple HyperVM servers linked together providing a tree of host servers.

HyperVM advanced features allow you to manage your vps hosting from a single console. HyperVm has been optimized for allowing you to have HyperVM clustered servers from anywhere in the world. These are some of HyperVM features:

Quote Taken from http://lxlabs.com/software/hypervm/

* “Full Distribution.”
* “Manage your entire data center.”
* “HyperVM is successfully used by our clients to manage 1000s of vpses on 100s of servers.”
* “Support for Windows Virtualization.”
* “HyperVM allows efficient windows virtualization with advanced features like backup/restore built in.”
* “Support for multiple virtualization technologies.”
* “Live Migrate”

This install of HyperVM is for Fedora Core servers, and this install was done on Fecora Core 6. This will use the XEN  kernel, memory will be set at a dedicated limit. The limit will allow customers programs to run slower when they reach their limit unlike Openvnz their programs will normally crash. HyperVM will also require you to reboot after changes to the vps like memory or hard drive space. Openvnz will do these changes instantly.

* Downloading HyperVM

1. hypervm-install-master.sh
2. hypervm-install-slave.sh

* Getting Ready for Install

1. disable selinux (edit /etc/sysconfig/selinux <– change to [SELINUX=disabled])
2. setenforce 0
3. chkconfig libvirtd off
4. reboot

* Installing HyperVM

1. cd DIROFHyperVM/
2. sh ./hypervm-install-master.sh –virtualization-type=xen

If this errors during install just rerun the command and if HyperVM is already install just type yes

* Once server is booted

1. ssh into the server
2. ssh back into server cd /usr/local/lxlabs/hypervm/httpdocs/
3. Type in command prompt: lphp.exe ../bin/common/setdriver.php –server=localhost –class=vps –driver=xen
4. This can take a few minute’s to become enabled sometimes we have had issues and use service xend restart
5. In web browser to http://IP:8887 or http://IP:8888 of the host computers IPLogin is admin password is also admin change once inside
6. Once you have logged in as admin add the extra IP address on the servers to HyperVM IP POOL list
7. Go the VM tab
8. Click ADD XEN
9. Set the name vm name
10. Password
11. Number of IPs allowed to use
12. Hostname of the server
13. Gateway IP of the HOST network
14. IF you have multiple VMServers you can now select from which gateway the IP class is on
15. If you only have one leave localhost
16. Select OS
17. Click ADD
18. Select Disk quota
19. Number of backups allowed of the vps
20. Skip the next 3 they are for Openvz
21. Set VPS real memory allowed from Hosting server example: 128 256 512 all are in mb
22. CPU usage allowed from host computer in percent example of on core host: 10 20 25
23. With Single Core host you are allowed 100% if you have Dual or Quad core you are allowed 200%-400%
24. Traffic monthly in mb <— TRAFFICinGB x 1024
25. Number of IP address allowed to use
26. Check or uncheck if you allow backup schedule or backups allowed
27. Click add
28. Hypervm VPS will be installed

Written by praji

November 6, 2008 at 7:10 am

Posted in Uncategorized

Backup of a running container with vzdump

with one comment

Vzdump is a utility to make consistent snapshots of running OpenVZ containers. It basically creates a tar archive of the container’s private area, which also includes the CT configuration files.

There are several ways to provide consistency:

  • Stop the CT during backup (very long downtime)
  • Use rsync and suspend/resume (minimal downtime)
  • Use LVM2 (no downtime)

Vzdump stores the backup on the disk in a single file. This file should go to a tape backup for archiving.

if (window.showTocToggle) { var tocShowText = “show”; var tocHideText = “hide”; showTocToggle(); }

Download

Download vzdump rpm or deb packages from http://download.openvz.org/contrib/utils/vzdump/ or for newest version, check http://www.proxmox.com/cms_proxmox/en/technology/oss-software/openvz/

For rpm based systems:

wget http://www.proxmox.com/cms_proxmox/cms/upload/vzdump/vzdump-1.0-2.noarch.rpm

For Debian based systems:

wget http://www.proxmox.com/cms_proxmox/cms/upload/vzdump/vzdump_1.0-2_all.deb

Installation

For rpm based systems:

rpm -i vzdump-1.0-2.noarch.rpm

For Debian based systems:

dpkg -i vzdump_1.0-2_all.deb

Synopsis

vzdump OPTIONS [--all | <CTID>]
      --compress              compress dump file (gzip)
      --dumpdir DIR           store resulting files in DIR
      --xdelta                create a differential backup using xdelta
      --mailto EMAIL          send notification mail to EMAIL
      --stop                  stop/start container if running
      --suspend               suspend/resume container when running
      --snapshot              use LVM snapshot when running
      --restore FILENAME      restore FILENAME

Examples

Use a running container, for example install this: Proxmox Mail Gateway in container.

Backup

Simply dump CT 777 — no snapshot, just archive the container private area and configuration files to the default dump directory (usually /vz/dump/).

vzdump 777

Use rsync and suspend/resume to create a snapshot (minimal downtime).

vzdump --suspend 777

Backup all containers and send notification mails to root.

vzdump --suspend --all --mailto root

Use LVM2 to create snapshots (no downtime).

vzdump --dumpdir /space/backup --snapshot 777

Note that using LVM2 and vzdump to create snapshots requires 512Mb of free space in your VG as described here.

Restore

Restore the above backup to CT 600:

vzdump --restore /space/backup/vzdump-777.tar 600

Written by praji

September 11, 2008 at 8:37 am

Posted in Uncategorized