To get a description of all the vms on an ESX 5.1 box use the following:
~ # vim-cmd vmsvc/getallvms | grep vmx | awk '{ print $2 }'
To get a description of all the vms on an ESX 5.1 box use the following:
~ # vim-cmd vmsvc/getallvms | grep vmx | awk '{ print $2 }'
This is the simple case where all we have is one disk that needs cloning.
Assumptions for the following example
Points to perform :
An extra help might be connecting to the target box in a target session and run iftop to see the transfers.
At mysql prompt as root user:
GRANT ALL privileges ON *.* TO ‘user’@’machine.lan’ IDENTIFIED BY ‘password’ WITH GRANT OPTION;
FLUSH PRIVILEGES;
That’s all
Here are the steps of what you need to do in order to install and setup MySQL on a new server.
We’ll prepare a fresh CentOS 6 system (64 bit) for use as a database server. All you need is access to an SSH client and your server root credentials.
The first thing I’d like to do is make sure I have all available updates. So once I log in I run
yum update
This can take some time so grab a coffee while you wait. Once yum has finished, let’s check if MySQL is already installed on your system:
mysql
If you get “command not found” then you know you need to install MySQL.
MySQL consists of two parts: the client and the server. In order for our system to run the daemon which will process external requests we need both on our system. Here’s how we get those:
yum install mysql mysql-server
This will take a minute or two. No need to restart your server, all you need to to is start MySQL with
service mysql start
and it will be available for use. You’ll see the following message:
To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /usr/bin/mysqladmin -u root password 'new-password' /usr/bin/mysqladmin -u root -h yourdomain.com password 'new-password' Alternatively you can run: /usr/bin/mysql_secure_installation which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers. See the manual for more instructions. You can start the MySQL daemon with: cd /usr ; /usr/bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl cd /usr/mysql-test ; perl mysql-test-run.pl Please report any problems with the /usr/bin/mysqlbug script!
Looks like we need to do two things: set a root password and secure the installation. You can do these steps manually, but MySQL is rather nice in that it provides a script which you can use to secure your installation. Note that this path may be different on your system:
/usr/bin/mysql_secure_installation
The script will ask you the following questions:
Now you can access MySQL with the following command:
mysql -p
You will likely need to make sure MySQL is running when you reboot the server, it’s cumbersome to start it manually every time you do that. This will take care of it:
chkconfig --levels 235 mysqld on
We’re done – MySQL is now running on your server and yours to populate.
Have fun ![]()
Assuming you start a screen session using
screen -S david
Ask your partner to connect using (assuming they are logged in using the same user account):
screen -x david
Now it’s simply magical. Multiple persons can type and work on the same terminal – it works best when you’re coordinating over the phone. Note that the dimensions of your terminal output will be the same for every user – to change it, press Ctrl–A and then capital F. This will make the screen output fit your current terminal size, and change it to that size for every connected user.
Important: To detach from the screen session so that you can resume later, simply close the window. If you typeexit, you’ll end up terminating the screen session and the processes running within.
Some instructions for converting SSL certificates generated for IIS to private key, and cert files you can use on unix, or Apache for windows.
First Export your IIS certificate into a pfx file (this is something you should do anyways for backup)
Next run openssl to extract the private key, and the cert file.
# Export the private key file from the pfx file openssl pkcs12 -in filename.pfx -nocerts -out key.pem # Export the certificate file from the pfx file openssl pkcs12 -in filename.pfx -clcerts -nokeys -out cert.pem # This removes the passphrase from the private key so Apache won't # prompt you for your passphase when it starts openssl rsa -in key.pem -out server.key
When installing php PECL On CentOS/RHEL (+cPanel) installations, if you get a “checking whether the C compiler works… configure: error: cannot run C compiled programs”, you may need to remount the /tmp and /var/tmp with exec permissions first:
$ mount -o remount,exec,suid /tmp
$ mount -o remount,exec,suid /var/tmp
Then:
$ pecl install {package}
And, don’t forget to remount them as noexec after.
Run updatedb first. You can run it manually from the command line.
updatedb
It should have scheduled itself as a cron job when you installed slocate. If you just installed slocate, it will not have run yet. Otherwise, make sure you have a cron daemon running and that there is an updatedb task scheduled. Also, make sure your computer is on when it it is scheduled
If this is a VM and does not run continuously especially never spent days on this will happen. Just in case check the cron job found here:
The cron job is found here:
/etc/cron.daily/mlocate.cron
Thats’ pretty much it.
Howto Install no-ip utility in CentOS to fix dynamic ip issues using a subdomain from no-ip.org.
First go to no-ip webpage http://www.no-ip.com
Register and confirm your email, then login your account and add a host. Download the linux client As user root execute:
cd;wget "https://www.no-ip.com/client/linux/noip-duc-linux.tar.gz" tar -xvf noip-duc-linux.tar.gz cd noip-2.1.9-1 make make install
Create a configuration file:
noip2 -C
The script will ask you which ethernet port to use, then write your email account you use to register with no-ip, then the password, finaly choose the host you will be using.
Now lets create init file to wake up the deamon every time we start our box.
cd /etc/init.d nano noip2d
Add the following in noip2d :
# chkconfig: 345 20 80
# description: Starts noip2 deamon to check for dynamic ip \
# and updates new ip to no-ip.org dns cache.
#######################################################
#! /bin/sh
# . /etc/rc.d/init.d/functions # uncomment/modify for your killproc
case "$1" in
start)
echo "Starting noip2."
/usr/local/bin/noip2
;;
stop)
echo -n "Shutting down noip2."
echo "."
for i in `noip2 -S 2>&1 | grep Process | awk '{print $2}' | tr -d ','`
do
noip2 -K $i
done
##killproc -TERM /usr/local/bin/noip2
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0
#######################################################
Save and Exit, now lets work on the permits:
chmod +x /etc/init.d/noip2d chmod 700 /usr/local/bin/noip2 chown root:root /usr/local/bin/noip2 chkconfig --levels 3 noip2d on noip2d start
Verify the deamon is running:
ps aux | grep noip2
If everything goes as plan, you have no-ip service in your box and will be updating every time your ip changes.
Finaly try to see your machine in your browser. http://myhostname.no-ip.org
Thanks for reading.