Stay Resilient with 3-2-1-1-0 Backup Tactics
How to identify CPU resource problem?
vmstat command helps us to determine if a server is running short of CPU resources. First, let us determine the number of CPUs available Linux: $ grep -i processor /proc/cpuinfo | wc -l FreeBSD: $ sysctl -a ‘hw.ncpu’ Run vmstat command 10 times with an interval of 5 seconds $ vmstat 5 10 procs ———–memory———- […]
Rendering MySQL query results in vertical format
Easily reviewing SELECT query results in a shell window can be particularly difficult when a table consists of numerous columns. Remedying this inconvenience is easily done by appending the \G switch to the query: mysql>SELECT * from users WHERE id=1\G Executing this query with the \G switch attached formats the output like so: mysql test>select […]
Create strong passwords in Unix
openssl command helps in creating strong passwords for user accounts, email addresses, web forms etc. openssl rand 12 -base64 The above command will create a random base 64 encoding string each time it’s run.
Capture top command output in a file
Capture top command output in a file The output of top command can be captured as follows top -b -n1 > /tmp/top1.txt This will run top command once and write the output to a file, then exit. To run top 3 times with an interval of 5 seconds, run the following command top -b -n3 […]
Display Info about FreeBSD system
Display Info about FreeBSD system 1) Determining the Hardware Type/platform: # uname -m 2) Determining machine processor architecture: # uname -p 3) Determining FreeBSD release level: # uname -r 4) Generally, following command is use to get all info at a time: # uname -mrs 5) Determining how long a system has been up # […]
How To set the timezone in FreeBSD OS
Copy from /usr/share/zoneinfo/Etc or /usr/share/zoneinfo/<continent>/<city>, the timezone, that coresponds to your city/GMT setting to /etc/localtime Once the timezone is set in the FreeBSD server, run the command: adjkerntz -a (adjut kernel timezone). How To set the timezone in FreeBSD OS