Skip to content

Instantly share code, notes, and snippets.

View namuan's full-sized avatar
🎯
Focusing

namuan namuan

🎯
Focusing
View GitHub Profile
@namuan
namuan / aws-cli-examples.sh
Last active March 20, 2021 00:04
[AWS CLI examples] #aws #cli
aws autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[*]'
aws autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[*].Tags[?Key==`Name`]'
aws autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[?Tags[?starts_with(Value, `registration`)]]'
aws autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[?Tags[?starts_with(Value, `email`)]]'
aws autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[] | [?contains(Tags[?Key==`Name`].Value, `email-01`)]' --output table
@namuan
namuan / maven_commands.md
Created September 4, 2018 09:15
[Maven standalone commands to install and retrieve dependencies] #maven

Installing file to a repo:

mvn install:install-file -DgroupId=com.github.namuan -DartifactId=common-schema -Dversion=1.5.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

Checking dependency from a custom Nexus repo

mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get -DrepoUrl=http://nexus.server/nexus/content/groups/maven -DgroupId=com.github.namuan -DartifactId=common-schema -Dversion=1.5.0-SNAPSHOT -Dpackaging=jar
@namuan
namuan / jenkins_running_threads.groovy
Created September 4, 2018 09:11
[Find all running threads in Jenkins] #jenkins #troubleshooting
Thread.getAllStackTraces().keySet().each() { t ->
println(t.getName())
}
println("")
@namuan
namuan / jenkins_queues_items.groovy
Created September 4, 2018 09:05
[Find queued items in Jenkins] #jenkins
import hudson.model.*
def q = Jenkins.instance.queue
def blocked = q.items.find { it.task.name.startsWith("<SEARCH STRING>") }
q.cancel(blocked.task)
println ""
@namuan
namuan / reddit_rss.md
Last active September 2, 2018 10:34
Reddit RSS feed using xmlstarlet
@namuan
namuan / pull_request_checklist.md
Last active January 17, 2019 22:06
[Pull Request] #checklist

Ref: https://github.com/felipefarias/pull-requests-checklist/blob/master/checklist-en.md

[ ] Pull request workflow

  • Read thoroughly the feature description to check if everything is implemented.
  • Run the code and use it as the end user would. Double check requested feature’s description.

[ ] Creating the pull request

  • Create Pull Request (but don't assign it yet).
  • Describe how to test the PR: urls, environment variables and other needs.
  • Refer to issue(s)/Trello card(s) the PR solves.
@namuan
namuan / sqs_aws_cli.md
Created August 26, 2018 21:22
[Sending SQS messages using AWS CLI] #sqs #aws #cli
$ aws sqs send-message --queue-url https://eu-west-1.queue.amazonaws.com/<acc-id>/TestQueue --message-body "$(cat customer_created.json)"
@namuan
namuan / publish_maven.md
Created August 26, 2018 20:18
[Publishing to local Artifactory] #artifactory #maven

Start up Artifactory in a docker instance

docker run -d --name docker-artefactory -v $ARTIFACTORY_HOME/data -v $ARTIFACTORY_HOME/logs -v $ARTIFACTORY_HOME/backup -P docker.bintray.io/jfrog/artifactory-oss:latest

Find the port number using Kitematic and browse to the web address

http://docker-ip:32804/artifactory/webapp/#/home

Setup using password

@namuan
namuan / rest_template_logging.md
Created August 26, 2018 18:33
[How to add logging with RestTemplate] #java #logging #resttemplate

Create a new RestTemplate as a bean

    @Bean
    public RestTemplate restTemplate() {
        MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
        converter.setSupportedMediaTypes(
                Arrays.asList(MediaType.APPLICATION_JSON, MediaType.APPLICATION_OCTET_STREAM)
        );