This gist is a collection of my rough notes from Strange Loop 2012.
This file contains 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
/** | |
* To get all the info to login, sign into your MongoHQ account, go to the db you want, | |
* click the "Database Info" tab, then look for the line that looks like: | |
* ------------------------------------------------------------- | |
* mongodb://<user>:<password>@staff.mongohq.com:10056/node-test | |
* ---------| |-| |------------------| |-| | | |
* USER PASSWORD PORT DB NAME | |
* | |
* ALSO, for testing, you should manually add a document and collection into MongoHQ | |
* from their "Add a Collection" > "Add a Document" links, then below we'll log it. |
This file contains 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
1. Convert our ".jks" file to ".p12" (PKCS12 key store format): | |
keytool -importkeystore -srckeystore oldkeystore.jks -destkeystore newkeystore.p12 -deststoretype PKCS12 | |
1.1. List new keystore file contents: | |
keytool -deststoretype PKCS12 -keystore newkeystore.p12 -list | |
2. Extract pem (certificate) from ".p12" keysotre file: | |
I recently had the following problem:
- From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
- That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.
We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like
ssh -L 3306:localhost:3306 remotehost
This file contains 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
allprojects { | |
afterEvaluate { project -> | |
project.configurations.all { | |
resolutionStrategy.eachDependency { DependencyResolveDetails details -> | |
def requested = details.requested | |
if (requested.version.contains('+')) { | |
throw new GradleException("Wildcard dependency forbidden: ${requested.group}:${requested.name}:${requested.version}") | |
} | |
} | |
} |
This file contains 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
task dependencyReport { | |
doLast { | |
def file = new File("project-dependencies.dot") | |
file.delete() | |
file << "digraph {\n" | |
file << "splines=ortho\n" | |
rootProject.childProjects.each { item -> | |
def from = item.value | |
from.configurations.compile.dependencies | |
.matching { it in ProjectDependency } |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm