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
| Rest Elasticsearch samples |
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
| # ./$me.sh KEY_NAME | |
| docker exec -it redis bash -c "echo 'HGETALL $1' | redis-cli" | |
| #docker run --rm redis bash -c "echo 'HGETALL $1' | redis-cli" |
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
| #!/usr/bin/env bash | |
| # Generate timestamped filename | |
| TIMESTAMPED_TAG=`date +%Y-%m-%d-%H%M%S` | |
| BACKUP_ARCHIVE="./jenkins-backup-${TIMESTAMPED_TAG}.tar.gz" | |
| # Inconceivable race condition avoidance | |
| if [-f $BACKUP_ARCHIVE ]; then | |
| rm ${BACKUP_ARCHIVE} | |
| fi |
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
| var MongoClient = require('mongodb').MongoClient; | |
| var url = "mongodb://admin:adminadmin@$SERVER_IP:27017/exampleDb"; | |
| MongoClient.connect(url, { useNewUrlParser: true }, function(err, db) { | |
| if (err) throw err; | |
| var dbo = db.db("mydb"); | |
| var myobj = { name: "Company Inc", address: "Highway 37" }; | |
| dbo.collection("customers").insertOne(myobj, function(err, res) { | |
| if (err) throw err; | |
| console.log("1 document inserted"); |
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
| AWSTemplateFormatVersion: "2010-09-09" | |
| Description: Example of Cloudformation to Build with CodeBuild an application. Get Code commit repo and build a docker container. Your repo needs the buildspec.yml file. | |
| Parameters: | |
| RepositoryName: | |
| Description: CodeComit repository name | |
| Type: String | |
| Resources: | |
| CodeBuildRole: |
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
| #!/bin/bash | |
| #not tested... not working. | |
| compacta() { | |
| find $1 -name "*-201" -not -path "*.tar.gz" -exec tar -zcvf {}.tar.gz {} \; | |
| } | |
| remove_olders() { | |
| find $1* -mtime +7 -exec rm {} \; | |
| } | |
| clear() { |
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
| DELIMITER // | |
| CREATE PROCEDURE killing_process (total_time int) | |
| BEGIN | |
| DECLARE done INT DEFAULT 0; | |
| DECLARE process_id INT; | |
| DECLARE result varchar(4000); | |
| DECLARE cur1 CURSOR FOR | |
| SELECT id | |
| FROM information_schema.processlist |
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
| wildfly-cli / jboss-cli common commands | |
| # Connect into wildfly/jboss cli (only with wildfly up) | |
| $JBOSS_HOME/bin/jboss-cli.sh --connect | |
| # Wildfly cli offline | |
| $JBOSS_HOME/bin/jboss-cli.sh --commands="embed-server,$COMMAND,stop-embedded-server" | |
| # Commands: | |
| /system-property=VAR_NAME:add(value=VAR_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
| # It's Work to you test if the vulnerability is working | |
| # use only to test your system | |
| # use with responsability | |
| # | |
| # use method: | |
| # test-WP-CVE-2017-8295.sh [YOUR-SITE-TO-TEST] [USER-TO-TEST] | |
| # ex: test-WP-CVE-2017-8295.sh example.com user | |
| curl --write-out %{http_code} --silent --output ~/body.txt \ |
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
| #!/bin/bash | |
| # | |
| # SH to list all repositories in docker registry, list all tags of repositorie and remove all images from the tag repositorie | |
| # | |
| # Created by: Gustavo Apolinario | |
| # 2017-05-12 | |
| # | |
| # curl -X GET localhost:5000/v2/_catalog | |
| # curl -X GET localhost:5000/v2/socsite_apache/tags/list |
NewerOlder