This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dumiduh; | |
import java.sql.Statement; | |
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.ResultSet; | |
public class DatabaseUser { | |
private Connection connectionObj; | |
private Statement statementObj; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dumiduh; | |
public class Driver { | |
public static void main(String[] args) | |
{ | |
DatabaseUser user = new DatabaseUser(); | |
user.run(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# ---------------------------------------------------------------------------- | |
# Copyright 2005-2012 WSO2, Inc. http://www.wso2.org | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#this script checks the existence of a char sequence in the last X number of lines of a files and plays a wave file if a match is made. | |
# sh logchecker.sh <number of lines to tail at one go> <logfile> <char sequence> <wav file to play> | |
while [ 1 -gt 0 ]; do | |
tail -n $1 $2 | grep -e "$3" | |
if [ $? -lt 1 ]; then | |
aplay $4 ; | |
exit ; | |
fi | |
sleep 10; #check interval |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
tail -f $1 | grep -e -B $2 -A $3 $4 >> GREPOUT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#A convenient way to check if bash scripts contain syntax errors using the bash -n command. | |
INTERVAL=10 | |
while [ 1 -gt 0 ]; do | |
bash -n "$1" | |
if [ $? == 0 ]; then | |
echo 'No Syntax errors were found. Keep marching on soldier!' | |
fi | |
sleep $INTERVAL; #check interval |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autocmd CursorHold,CursorHoldI * update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#do something if error code denotes a failure | |
if [ $? -gt 0 ]; then | |
echo "something went wrong!" | |
fi | |
#status checking in command pipe | |
cat textfile.txt | ( [[ $? == 0 ]] && grep "cat" ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X GET -v $ENDPOINT > RESPONSE | |
cat $RESPONSE | grep -i "success" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
findproductnames() | |
{ | |
DELIMITER="*" | |
PROD_ONE="Apache JMeter" | |
PROD_TWO="Apache Tomcat" | |
echo $PROD_ONE$DELIMITER$PROD_TWO | |
return | |
} |
OlderNewer