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
COUNTER=0 | |
while [ $COUNTER -lt 100 ]; do | |
echo The counter is $COUNTER | |
mvn clean test -f <path>/pom.xml > maven.log | |
rc=$? | |
if [[ $rc -ne 0 ]] ; then | |
echo 'Could not perform tests'; exit $rc | |
fi | |
let COUNTER=COUNTER+1 | |
done |
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
sudo tcpdump -n -i lo 'port 8866 and host <ip>' -w - | |
-i is interface! -> ifconfig | |
sudo tshark -i lo -f "port 8866" | |
sudo tshark -i lo -e websocket.payload.text_unmask -Tfields port 8866 | |
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
http://<host>:7180/cmf/impala/completedQueries?startTime=1505403480000&endTime=1505404440000&filters=statement+RLIKE+%27<statement pattern>%27&offset=0&limit=300&serviceName=impala&histogramAttributes=query_duration&_=1505485509039 |
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
You must set the nullValue of the PropertyPlaceholderConfigurer. For the example I'm using the string @null but you can also use the empty string as nullValue. | |
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> | |
<!-- config the location(s) of the properties file(s) here --> | |
<property name="nullValue" value="@null" /> | |
</bean> | |
Now you can use the string @null to represent the null value | |
@Value("${stuff.value:@null}") | |
private String value; |
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
for db in {file1,file2} ; do scp user@host:/tmp/${db}.sql ./folder_name ; done |
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
EntityManager em = getEntityManager(); | |
CriteriaBuilder criteriaBuilder = em.getCriteriaBuilder(); | |
CriteriaQuery<StreamSource> criteriaQuery = criteriaBuilder.createQuery(Domain.class); | |
Root<StreamSource> source = criteriaQuery.from(Domain.class); | |
criteriaQuery | |
.multiselect(source.get("id"), source.get("name"), source.get("accountId"), source.get("description"), | |
source.get("enabled"), source.get("type"), source.get("subStorageType"), source.get("storageConfiguration"), | |
source.get("playbackMode"), source.get("live"), source.get("cacheable"), | |
source.joinList("linkedSources", JoinType.LEFT), | |
source.get("createdDate")) |
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
http://b.tile.openstreetmap.org/7/74/43.png | |
http://b.tile.openstreetmap.org/6/37/21.png | |
http://b.tile.openstreetmap.org/8/149/86.png | |
http://b.tile.openstreetmap.org/9/299/172.png | |
http://b.tile.openstreetmap.org/10/598/345.png |
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
import retrofit.client.Response | |
import retrofit.mime.TypedString; | |
TypedString wrapped = new TypedString(script); | |
... | |
@POST("/validate") | |
Response validate(@Body TypedString script); |
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
If you look at the code for JdbcTemplate (one of the execute(...) methods) you will see | |
Connection con = DataSourceUtils.getConnection(getDataSource()); | |
Which tries to retrieve a Connection from a ConnectionHolder registered with a TransactionSynchronizationManager. | |
If there is no such object, it just gets a connection from the DataSource and registers it (if it is in a transactional environment, ie. you have a transaction manager). Otherwise, it immediately returns the registered object. | |
This is the code (stripped of logs and stuff) |
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
RequestConfig requestConfig = RequestConfig.custom() | |
.setConnectTimeout(connectTimeout) | |
.setSocketTimeout(socketTimeout) | |
.build(); | |
HttpClientBuilder httpClientBuilder = HttpClients | |
.custom() | |
.setDefaultRequestConfig(requestConfig) | |
.evictIdleConnections(evictIdleConnectionSeconds, TimeUnit.SECONDS) | |
.setMaxConnPerRoute(maxConnections) |