Backspace, Delete, and/or Return Key Stops Working in Oracle SQL Developer

So, I fire up SQL Developer to run some queries against a QC server and for some reason, I am no longer able to use the backspace, delete, or return keys to edit .sql files opened in the program.

I tried opening a new .sql file, and restarting SQL Developer.  I then tried restarting Windows.  None of those worked.

After a bit of searching I found a forum posting that indicated by going to Tools/Preferences/Accelerators and clicking the “Load Preset…” → Continue reading “Backspace, Delete, and/or Return Key Stops Working in Oracle SQL Developer”

Checking that Input or a Variable is an Integer in BASH

Here is a quick snippet for checking whether or not a variable is a valid integer in BASH.  It is also a howto for regular expressions in a shell script.

# Make sure that FOO is an integer
if [[ ! "$FOO" =~ ^[0-9]+$ ]]; then
        echo "The FOO was NOT an integer"
fi
Continue reading “Checking that Input or a Variable is an Integer in BASH”

How To Benchmark Disk I/O

Here is a quick snipped on how to benchmark Disk I/O with dd.

time sh -c "dd if=/dev/zero of=/home/rchapin/test.zeros bs=1024k count=10000 && sync"

10000+0 records in
10000+0 records out
10485760000 bytes (10 GB) copied, 81.4124 s, 129 MB/s

real    1m21.950s
user    0m0.810s
sys     0m5.474s

Will do a write test of 10GB.

You can do a similar test and read from that file generated and write to another file or /dev/null to get an idea of the read speeds.

See the → Continue reading “How To Benchmark Disk I/O”

Creating an Array in Bash from a File With Each Element on a Separate Line

Let’s say that you have a file and you would like to convert each line in the file to an element in an array.

The key to this is knowing about and how to manipulate the IFS (Internal Field Separator).  The default IFS is whitespace (a space, tab, or newline) and if you create an array passing it a whitespace delimited list of strings, each token will be set to an element in the array.

ARRAY=(a b d 
Continue reading “Creating an Array in Bash from a File With Each Element on a Separate Line”

Installing Chrome Extensions Without Signing in With a Google Account

Google requires that you login with a Google account before you can install any Chrome extensions.

The following is how to install an extension without logging in (under Windows.  The same should work under Linux and Mac):

  1. Find the ID for the extension.  When you browse the extension in the store you will see a URL similar to the following:  https://chrome.google.com/webstore/detail/cookies/iphcomljdfghbkdcfndaijbokpgddeno?hl=en.   The hash string after the ‘cookies’ string (the name of the extension) up to the ? is the
Continue reading “Installing Chrome Extensions Without Signing in With a Google Account”

Removing The Last N Character From a String in Bash Script with sed

Here is a quick one-liner for trimming a specific number of characters from the end of a string under bash:

# Remove the last 5 characters
$ echo "somestringwith12345" | sed "s/.....$//g"
$ somestringwith

# Remove the last 3 characters
$ echo "somestringwith12345" | sed "s/...$//g"
$ somestringwith12
Continue reading “Removing The Last N Character From a String in Bash Script with sed”

Running Multiple Instances of Notepad++ Under Windows 7

If you want to run multiple versions of Notepad++ under Windows 7 create a .bat file with the following:

"C:\Program Files (x86)\Notepad++\notepad++.exe" -multiInst %1

And simply run the bat file via a cmd prompt/ → Continue reading “Running Multiple Instances of Notepad++ Under Windows 7”

Splitting a String in Bash on the FIRST Occurrence of a Character

About a year ago I posted an article about how to split into an array of values based on a given delimiter in bash.

The following is how to take that same string and split it on the first occurrence of the same user defined delimiter.

Both use the ‘read’ command, but in a slightly different way.

Instead of passing read the -a [aname] parameter which tells it that “The words are assigned to sequential indices of the array → Continue reading “Splitting a String in Bash on the FIRST Occurrence of a Character”

BASH Script With Default Arguments Defined in The Script

Often times you will want to write a BASH script where you don’t want to have to keep track of all of the positional command line arguments and/or you might want to configure it with a set of environmental variables while having a default value for each in the script.

Following is the syntax for declaring them in the shell script, and then an example on how to invoke it.

#!/bin/bash

: ${ARG1:="somedefault_arg1"}
: ${ARG2:="10"}

echo "ARG1 = $ARG1"
echo 
Continue reading “BASH Script With Default Arguments Defined in The Script”

Unable to Set the Path To java.exe When Running Oracle SQL Developer Under Windows 7

I was trying to run Oracle SQL Developer for the first time on a new machine.  When firing it up, it presented me with a dialog box asking me to “Enter the full pathname for the java.exe file”.

OK, no problem.  So I find the path to the java.exe binary that was just installed with the SDK.  Hit submit . . . and nothing happens.  It blanks out the text field and the dialog box stares back at me.

I → Continue reading “Unable to Set the Path To java.exe When Running Oracle SQL Developer Under Windows 7”