VNC Server on KDE and Lubuntu

Posted by root on Wednesday May 22, 2013 Under Bash, Debian, Linux, Remote Access, Ubuntu

To run a fast desktop manager over slow internet connection use LXDE Desktop Manager or Lubuntu.

The file “~//.vnc/xstartup” must be changed such way:

#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid black
lxterminal &
/usr/bin/lxsession -s LXDE &

For Lubuntu:

#!/bin/sh
[ -r HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

/usr/bin/lxsession -s Lubuntu -e LXDE &
Tags : | add comments

Mounting a Linux Raid Partition

Posted by root on Wednesday May 22, 2013 Under Bash

Error:

mount: unknown filesystem type 'linux_raid_member'
# fdisk -l /dev/sdb 

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.

Solution:

You should not mount it directly using mount. You need first to run mdadm to assemble the raid array. A command like this should do it:

$ mdadm --assemble --run /dev/md0 /dev/sdc1

If it refuses to run the array because it will be degraded, then you can use –force option. This is assuming you don’t have /dev/md0 device. Otherwise, you need to change this name.

When this command is executed successfully, you can mount the created device normally using:

$ mount /dev/md0 /mnt/test
Tags : | add comments

Install HTOP on CentOS 6 64-bits x86_64

Posted by root on Sunday May 19, 2013 Under Bash, Centos, Linux

Installation process::

For CentOS 6 x86_64 – 64 bits

# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
# rpm -ihv rpmforge-release*.rf.x86_64.rpm

================================

Once RPMforge repository is installed on server then start installation with yum command.

# yum install htop

Now run following command on the terminal for server monitoring.

# htop
Tags : | add comments

Install php-mcrypt in a Centos 6

Posted by root on Sunday May 19, 2013 Under Bash, Centos, Linux, MySql, PHP

The default installation of virutalmin doesn’t come with additional PHP extensions which some php scripts may need, you have to manually install each php extension compare with easyapache from cPanel which you can install all at once.

Add centOS repo

For CentOS 5

rpm -Uvh http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

For CentOS 6

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
yum install php-mcrypt

Check php.ini location ( /etc/php.ini is the default virtualmin php.ini location )

php -i | grep php.ini
nano /etc/php.ini

add extension to php.ini

extension =mcrypt.so

Restart Apache Server

/etc/init.d/httpd restart

After adding centOS Repositories, you could install php extension from virtualmin GUI

Webmin > System Software Packages > Choose Package from YUM >

Click Browse YUM, type the php extension name in the search box and click find packing matching button, and then click the package name install.

Add php extension to php.ini from virtualmin GUI

Webmin > Others > PHP Configuration > Edit Manually
Don’t forget to restart apache server.

Most popular PHP extension you may need:
Format: extension = [extension name].so

•bcmath
•curl
•dba
•dom
•fileinfo
•gd
•imap
•imagick
•json
•ldap
•mailparse
•mbstring
•mcrypt
•mysql
•mysqli
•ncurses
•odbc
•pdo
•pdo_mysql (requires pdo)
•pdo_odbc (requires pdo)
•pdo_pgsql (requires pdo)
•pdo_sqlite (requires pdo)
•pgsql
•rrdtool
•snmp
•soap
•tidy
•xmlreader
•xmlrpc
•xmlwriter
•xsl
•zip

Tags : | add comments

Upgrade Teamspeak Server in Linux OS

Posted by root on Tuesday May 7, 2013 Under Bash, Centos, Linux, Ubuntu

You won’t loose any channel or user or permission during your update.

Make a copy of your database file called ts3server.sqlitedb (needed for a downgrade and it’s alays better to have a backup)

Now download the server and extract it to the old server folder. Overwrite all files.

Start the server and its done

Tags : | add comments

Change hostname in CentOS

Posted by root on Tuesday May 7, 2013 Under Bash, Centos

This article will cover a simple server hostname change in CentOS. By default your server will be kicked with the server’s given name as the hostname. Some software such as CPanel require a valid Fully Qualified Domain Name or FQDN for the hostname to be used during their Licensing verification system.

Contents
1 Hostname Change
1.1 Sysconfig/Network
1.2 Hosts File
1.3 Run Hostname
1.4 Restart Networking

Hostname Change
There are 4 steps in a hostname change, luckily all the steps are easy.

Sysconfig/Network

Open the /etc/sysconfig/network file with your favorite text editor. Modify the HOSTNAME= value to match your FQDN host name.

# sudo nano /etc/sysconfig/network
HOSTNAME=myserver.domain.com

Hosts File

Change the host that is associated to your main IPaddress for your server, this is for internal networking (found at /etc/hosts):

hostname.domain.com hostname

Run Hostname

The ‘hostname’ command will let you change the hostname on the server that the commandline remembers, but it will not actively update all programs that are running under the old hostname.

hostname roltel.net


Restart Networking

At this point all the necessary changes that needed to be made have been made, you will want to restart networking on your server to make sure that changes will be persistent on reboot:

# /etc/init.d/network restart

source: http://www.rackspace.com/knowledge_center/article/centos-hostname-change

Tags : | add comments

Disable or Enable All WordPress Plugins via the Database

Posted by root on Friday May 3, 2013 Under MySql, Wordpress

Before beginning, make a backup copy of your database. Then, login to your database using phpMyAdmin (or whatever), and navigate to the “active_plugins” column of the “wp_options” table using the following SQL query (edit the default WordPress table prefix “wp_” if needed):

SELECT * FROM wp_options WHERE option_name = 'active_plugins';

Once the active_plugins column appears, click to edit it. You will see something similar to the following, depending on the number and type of plugins you have installed:

a:31:{i:0;s:13:"AddMySite.php";i:1;s:19:"akismet/akismet.php";i:2;s:23:"all_in_one_seo_pack.php";i:3;s:16:"authenticate.php";i:4;s:28:"breadcrumb-navigation-xt.php";i:5;s:18:"codeautoescape.php";i:6;s:37:"contact-coldform/contact_coldform.php";i:7;s:32:"custom-query-string-reloaded.php";i:8;s:30:"customizable-post-listings.php";i:9;s:33:"dd-sitemap-gen/dd-sitemap-gen.php";i:10;s:20:"download-counter.php";i:11;s:13:"feedcount.php";i:12;s:13:"full_feed.php";i:13;s:15:"get-weather.php";i:14;s:36:"google-sitemap-generator/sitemap.php";i:15;s:13:"gravatars.php";i:16;s:19:"kill-admin-nags.php";i:17;s:18:"landingsites13.php";i:18;s:30:"nofollow-free/nofollowfree.php";i:19;s:17:"ol_feedburner.php";i:20;s:16:"plugins-used.php";i:21;s:22:"popularity-contest.php";i:22;s:39:"search-everything/search_everything.php";i:23;s:27:"simple-tags/simple-tags.php";i:24;s:26:"simple_recent_comments.php";i:25;s:18:"simple_twitter.php";i:26;s:25:"subscribe-to-comments.php";i:27;s:24:"the-excerpt-reloaded.php";i:28;s:18:"theme-switcher.php";i:29;s:9:"top10.php";i:30;s:16:"wp-db-backup.php";}

That entire array of code represents every active plugin on your site. Thus, to quickly disable all plugins without using the WP Admin area, highlight the entire block of code, cut it out, and paste it into a safe, offline text file. After removing the code, click the button to save your changes and that’s it. All WordPress plugins are now deactivated (yet still installed, and with all plugin options intact). This obviously is a huge time-saver that really comes in handy during those mission-critical, time-sensitive situations where every second counts. Once you are ready to re-activate your entire set of plugins, simply cut/copy & paste the preserved code back into the “active_plugins” field. Click save and done.

Alternately, here is a one-second query to disable all plugins:

UPDATE wp_options SET option_value = '' WHERE option_name = 'active_plugins';

Upon execution, this query will clear the active_plugins field of all active plugins (duh), effectively disabling (without uninstalling or modifying) the entire set. This method is great if you plan on re-enabling each plugin individually, say, after resolving some heinous server error. Whereas the previous technique makes it easy to re-enable all plugins en masse, this query is perfect for simply “nuking” all active plugins with no remorse. 😉

Updated Method

Apparently, this method works only for WordPress versions less than 2.9. For 2.9 and better, use this instead:

UPDATE wp_options SET option_value = ‘a:0:{}’ WHERE option_name = ‘active_plugins’;

Tags : | add comments