Skip to content

Instantly share code, notes, and snippets.

say all = starts reading whole page on page load
Ctrl = pauses say all
Ins-down = starts say all again
p = read para
down = read next line
up = read previous line
@kevinhooke
kevinhooke / gist:ed053a086c74e5d80a72
Created February 12, 2016 23:40
Docker on Windows - exec sh into running container
winpty docker exec -ti containerid sh
@kevinhooke
kevinhooke / gist:d1d88db85d2bec1bdd9d
Created February 25, 2016 19:30
Oracle / Weblogic: issue SQL statement on datasource connection init
In Datasource, Configuration, Connection Pool - Advanced:
Init SQL property - command here must be prefixed with 'SQL '
e.g.
SQL ALTER SESSION ...
@kevinhooke
kevinhooke / gist:717352e50353e6b1ef38a83024410e22
Created March 30, 2016 20:40
Jersey Jackson JSON mapper maven dep
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>x</version>
</dependency>
@kevinhooke
kevinhooke / gist:c32261fc46b7d969b4a9721ad86bebe5
Created March 31, 2016 19:57
OpenShift DIY cartridge using Maven - .openshift/settings.xml
<settings>
<localRepository>$OPENSHIFT_DATA_DIR</localRepository>
</settings>
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "/example-context.xml" })
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="appender" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{dd MMM yyyy HH:mm:ss} %-4r [%t] %-5p %c %x - %m%n</pattern>
</encoder>
</appender>
<logger name="org.springframework" level="INFO"/>
<logger name="ch.qos.logback" level="WARN"/>
<root level="DEBUG">
@kevinhooke
kevinhooke / gist:5c970716221a80766d943a3d8d4e82ec
Created April 12, 2016 22:05
Docker exec bash "warning: terminal not fully functional"
See https://github.com/docker/docker/issues/8631
To fix - run in container, or add as part of Dockerfile:
export TERM=xterm
On Windows:
1. don't modify the existing network adapters (NAT and host-only)
2. add 3rd adapter for bridged
3. docker-machine env
4. docker-machine regenerate-certs default
5. docker-machine ip default - show bridged ip
Restar docker-machine
@kevinhooke
kevinhooke / gist:982891f622701ce70de8bef630fc9b9b
Created July 5, 2016 02:27
bash prepend and append content to a number of matching files
#!/bin/bash
for f in $(find . -name "*.jsp")
do
echo "Updating file: $f"
#prepend: note BSD requires an empty '' param to sed -i
sed -i '' '1s/^/new line1\
new line2\
new line3\
/' $f