Category: Linux

0

Disable THP on CentOS 6

For the impatient Disable Transparent Huge Pages on CentOS 6 During Runtime echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag   Surviving reboot sudo vi /etc/init.d/disable-transparent-hugepages #!/bin/sh ### BEGIN INIT INFO # Provides: disable-transparent-hugepages # Required-Start: $local_fs # Required-Stop: # X-Start-Before:...

0

Run a script as root

Source: http://www.cyberciti.biz/tips/shell-root-user-check-script.html Sometime it is necessary to find out if a shell script is being run as root user or not. When user account created a user ID is assigned to each user. BASH shell stores the user ID in $UID...

0

MySQL Tips

Show all users Drop all databases Delete all users in MySQL with specific name Check and duplicate user grants Reset root password (mysql 5.7)   Tip #1: Show all users MariaDB [(none)]> select User,Host from mysql.user order by User, Host; Output...

0

How To Install MySQL / MariaDB on CentOS 7

Source: http://www.liquidweb.com/kb/how-to-install-mysql-mariadb-on-centos-7/ MariaDB is a drop-in replacement for MySQL. It is easy to install, offers many speed and performance improvements, and is easy to integrate into most MySQL deployments. Answers for compatibility questions can be found at: MariaDB versus MySQL –...

0

Super charge bash with these bash_profile tips

Some tips and tricks to super charge bash Tip #01: Up down arrow auto complete ~/.inputrc #File: ~/.inputrc ## arrow up “\e[A”:history-search-backward ## arrow down “\e[B”:history-search-forward   Tip #2: Auto complete hostnames in ssh, scp. More details here. $ brew install...

0

ldapsearch – ldap command to test connection

Well the post name is a misnomer. Lately I’ve been using ldapsearch command to test connection to ldap server, hence the name. Following is the shell command, $ ldapsearch -x -LLL -h ldapserver.example.com -D username -w password -b “DC=example,DC=com” -s...

0

Setup bulk password-less ssh

Following script will help in setting up password-less ssh in one shot to multiple machines, Usage sample: $ remote-keyless.sh <file_of_hosts.txt> [password] #!/usr/bin/expect -f # remote-keyless.sh, v0.1, 2016-05-03, [email protected] # v0.2, 2016-09-28, [email protected] – added to make it compatible with pdsh ;)...

0

Remote X11 display on Windows machines

Xming X Server for Windows is required to open display from your remote *nix host. Xming URL: https://sourceforge.net/projects/xming/ X11 packages are required on remote machine Following settings may or may not be required on the remote machine to X11 to work...

0

Processing shell program arguments

Method 1: Without using getopts while [[ $# > 1 ]] do key=”$1″ case $key in -u|–user) _USER=”$2″ shift # past argument ;; -s|–server) _SERVER=”$2″ shift # past argument ;; *) # unknown option printf “Usage: %s: [-s <server> -u...