Filed Under (Linux) by WebScHoLaR on 11-12-2010
tar files are the archive for the files/folders. Inorder to retrieve any file/folder from the archive, the archive needs to be extracted. If any specific file/folder is required then its useless to extract the complete archive. Its more suitable to just extract that specific file from the archive.
Lets say folder3.tar is the archive that has the file folder1/folder2/folder3/file_in_folder3 which needs to be extracted. In order to extract that specific file only and not the complete archive, this can be done as:
tar –extract –file=folder3.tar folder1/folder2/folder3/file_in_folder3
This will extract file_in_folder3 ONLY and not all files/folders in all other folders.
The command format is:
tar –extract –file=archive.tar path/to/file/folder/to/be/extracted
Filed Under (Windows) by WebScHoLaR on 11-12-2010
MS SQL Server Databases list can be retrieved from command line as:
C:\Program Files\Microsoft SQL Server\80\Tools\Binn>osql -E -Q “select * from master..sysdatabases”
OR
C:\Program Files\Microsoft SQL Server\80\Tools\Binn>osql -E -Q “EXEC sp_databases”
NOTE: SQL Server Path may differ as per the system installation. This was checked on SQL Server Express Edition.
Filed Under (Linux) by WebScHoLaR on 11-12-2010
Recently I got an issue on CentOS 5 server. SSH was failing on the server. Tried to restart but SSH didn’t start. Checked /var/log/secure and noticed the following error:
Dec 10 10:58:05 vps sshd[23799]: fatal: daemon() failed: No such device
To fix this issue, I performed the following actions:
-bash-3.2# rm -vf /dev/null
removed `/dev/null’
-bash-3.2# mknod /dev/null c 1 3
Started SSH and the SSH started responding:
-bash-3.2# service sshd restart
Stopping sshd: [ OK ]
Starting sshd: [ OK ]
-bash-3.2# service sshd status
openssh-daemon (pid 30608) is running…
Filed Under (cPanel/WHM, Linux, MySQL) by WebScHoLaR on 07-11-2010
1. Stop mysqld.
2. Backup /var/lib/mysql/ib*
3. Add the following line into /etc/my.cnf
innodb_force_recovery = 4
4. Restart mysqld.
5. Dump all tables:# mysqldump -A > dump.sql
6. Drop all databases which need recovery.
7. Stop mysqld.
8. Remove /var/lib/mysql/ib*
9. Comment out innodb_force_recovery in /etc/my.cnf
10. Restart mysqld. Look at mysql error log. By default it should be /var/lib/mysql/server/hostname.com.err to see how it creates new ib* files.
11. Restore databases from the dump:mysql < dump.sql
You can also run /scripts/mysqlup –force after step 8. as this will recreate the ibdata files. This is also unsupported and caution should be taken to not lose any vital customer data in the databases.
Filed Under (Virtuozzo, Windows) by WebScHoLaR on 07-11-2010
On Remote Desktop, if the error appears that the account is Locked, then the account can be unlocked from Virtuozzo Node as:
C:\Documents and Settings\Administrator>vzctl exec 1 net user administrator
/active:yes
Other way would be login to VPS as:
C:\Documents and Settings\Administrator>vzctl enter 116
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.
and unlock the account:
C:\WINDOWS\system32>net user administrator XXXXXXXXX /active:yes
The command completed successfully.
Remote Desktop access will be restored.
Filed Under (cPanel/WHM, Linux) by WebScHoLaR on 07-11-2010
/tmp drive is recommended to be mounted as noexec to prevent any exploitable scripts execution. If during installation, make fails with the error:
checking whether the C compiler works… configure: error: cannot run C compiled programs.
ERROR: `/root/tmp/xxxx/configure failed
It means that executable files cannot be created in /tmp. Mount options for /tmp can be checked as:
Read the rest of this entry »
Filed Under (cPanel/WHM) by WebScHoLaR on 10-10-2010
cPanel displays the perl version installed on the server. If perl is upgraded and cPanel still shows the same old version, remove the perl version file from cPanel datastore inside user home:
# find /home/*/.cpanel | grep _usr_bin_perl_-v | awk ‘{system (“rm ” $1)}’
When the user loads cPanel again it will refresh the perl version with the correct version from the system.
Filed Under (cPanel/WHM) by WebScHoLaR on 10-10-2010
By default mailserver uses the main ethx IP as outgoing IP to send emails. If its blacklisted then instead of changing the main ethx IP, mailserver IP can be changed. To change the IP for all domains on the server:
Pre-requisite: If you are changing the mailserver ip, make sure that reverse DNS is setup for that IP or all emails will not be delivered properly.
1) In WHM , click on Exim Configuration Editor Then click the check box beside – Read the rest of this entry »
Filed Under (Virtuozzo) by WebScHoLaR on 09-10-2010
Virtuozzo Container can be created from Parallels Management Console (PMC) or from command line. In PMC, a wizard is used to create a Container. Incase Container needs to be created from command line:
# vzctl create VEID –ostemplate centos-5-x86_64 –config basic
# vzctl set VEID –onboot yes –save
# vzctl set VEID –offline_management yes –save
# vzctl set VEID –hostname vps.domainname.com –save
# vzctl set VEID –userpasswd root:ROOT_PASSWORD –ipadd “xx.xx.xx.xx” –save
# vzctl set VEID –nameserver “11.22.33.44 44.33.22.11″ –save