To convert all text in vim editor to lower case use following expression:
To convert all text in vim editor to upper case use following expression:
To get current connections in mysql use any following command after logging into mysql from command line.
First login in into mysql:
$ mysql -u root -p'mySqlPassowrd'
Now enter any of following command:
To view only number of live connections:
mysql> SHOW STATUS WHERE `variable_name` = 'Threads_connected';
To view quick summery of all mysql details including live connections:
To view all live connections details:
Apache-HTTP v/s Apache-Tomcat:The basic difference is Apache-Tomcat is written in Java but Apache-HTTP is written in C. Apart from this Apache-Tomcat is used as a webserver as well as to deploy Java Servlet's and JSP's [Java server pages] so basically Apache-Tomcat is used to serve Java Technologies whereas Apache-HTTP is used to serve HTTP.Prerequisites:
a2ps is the venerable tool for formatting text files for Postscript printers. This post focuses on how to call a2ps to print multiple pages per sheet. To install a2ps and gv aka ghostview, which a2ps uses to preview output files: $ sudo apt-get install a2ps$ sudo apt-get install gvLayout You can layout a sheet of paper into rows and columns of pages.
# Find CPU specificationscat /proc/cpuinfo# System information via uname:uname -r [Kernel release]uname -a [All information about the kernal]uname -s [Kernel name]uname -m [Machine hw name]uname -p [Processor type]uname -o [OS]uname -n [Node name]# Running kernel and compiler:cat /proc/version# X server version:X -showconfig or Xorg -version# List of Kernel modules loaded:lsmod# Memory and swap information
NIC [network interface card] bonding is a term used to describe a way to increase available bandwidth. Bonding is nothing but Linux kernel feature[aka BONDING] that allows to aggregate multiple like interfaces (such as eth0, eth1, eth2 etc) into a single virtual link.This is done to get higher data rates and as well as link failover. NIC bonding may also be called as NIC Teaming. Here we will create a bond called bond0, number of ether-net's used are two [eth0 and eth1].
To store stdout and stderr output in a variable use following code:
import os, sys, subprocess
from subprocess import *
#To store both stdout and stderr
output1 = subprocess.check_output("cat fileNotExists.txt; exit 0", stderr=subprocess.STDOUT, shell=True)
print "output1: ", output1
#To store only stdout
output2 = subprocess.check_output("cat fileNotExists.txt", stderr=subprocess.STDOUT, shell=True)
print "output2: ", output2
output1: cat: fileNotExists.txt: No such file or directory