Skip to content

Instantly share code, notes, and snippets.

View venkata-qa's full-sized avatar

Venkata Koripalli venkata-qa

  • QAWORKFORCE LTD
  • Leeds, United Kingdom
View GitHub Profile
Question: How to Search for Files Recursively into Subdirectories
Solution: find . -print | grep -i '.*[.]xml'
Use sudo if required
Installing Telnet
Some hosts may come with Telnet pre-installed. To test this, run this command on your server:
telnet ?
You should see something like this:
usage: telnet [-l user] [-a] [-s src_addr] host-name [port]
If you get a “command not found” error, you will need to install Telnet.
On Ubuntu:
#Create a MYSQL container
# default user is root
docker run -p <host_machine_port>:3306 --name <container_name> -e MYSQL_ROOT_PASSWORD=<root_password> -e MYSQL_DATABASE=<db_name> -d mysql:<version>
<host_machine_port> — The port on your local machine that you want the container connected to.
<container_name> — The name of the container that will be created
<root_password> — The password of the root user for the mysql instance
<db_name> — The name of the database that will be created
<version> — The version of MySQL that you want to run
# Example
1. Download Oracle Linux instant client
oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm
oracle-instantclient11.2-sqlplus-11.2.0.2.0.x86_64.rpm
2. Install
rpm -ivh oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm
import org.apache.commons.lang3.RandomStringUtils;
public static String get(int length, boolean useLetters, boolean useNumbers) {
return RandomStringUtils.random(length, useLetters, useNumbers);
}
@venkata-qa
venkata-qa / DateUtils.java
Last active January 15, 2021 23:19
Java Data Utils
public static int getDay(){
return getLocalDate().getDayOfMonth();
}
public static int getMonth(){
return getLocalDate().getMonthValue();
}
public static int getYear(){
return getLocalDate().getYear();
@venkata-qa
venkata-qa / curl-get-status-code-and-response-body.sh
Last active January 6, 2021 22:11 — forked from maxclaus/curl-get-status-code-and-response-body.sh
Curl - Get status code and response body
GET_USERS_URL="https://reqres.in/api/users?page=2"
# Store the status code and the response
HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X POST $GET_USERS_URL)
# Extract the response body
HTTP_BODY=$(echo $HTTP_RESPONSE | sed -e 's/HTTPSTATUS\:.*//g')
# Extract the status code
HTTP_STATUS=$(echo $HTTP_RESPONSE | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')