Skip to content

Instantly share code, notes, and snippets.

View prashanth-sams's full-sized avatar
🍎
Each day is interesting!!!

Prashanth Sams prashanth-sams

🍎
Each day is interesting!!!
View GitHub Profile
@prashanth-sams
prashanth-sams / docker-examples.md
Created January 20, 2019 14:40 — forked from thaJeztah/docker-examples.md
Some docker examples

Commit, clone a container

To 'clone' a container, you'll have to make an image of that container first, you can do so by "committing" the container. Docker will (by default) pause all processes running in the container during commit to preserve data-consistency.

For example;

docker commit --message="Snapshot of my container" my_container my_container_snapshot:yymmdd
@prashanth-sams
prashanth-sams / docker-compose.yml
Created January 22, 2019 14:47
Dockerize SonarQube
version: "3.5"
services:
sonarqube:
image: sonarqube
ports:
- "9000:9000"
networks:
- sonarnet
environment:
@prashanth-sams
prashanth-sams / sonarqube.sh
Created January 23, 2019 14:47 — forked from raincatcher-bot/sonarqube.sh
Run sonarqube analysis on travis via docker image
#!/bin/bash
set -ev
if [ -v SONAR_TOKEN ]; then
docker pull pierrevincent/sonar-runner
SONAR_OPTIONS="-Dsonar.login=$SONAR_TOKEN"
if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
SONAR_OPTIONS="$SONAR_OPTIONS -Dsonar.github.oauth=$SONAR_GITHUB -Dsonar.github.pullRequest=$TRAVIS_PULL_REQUEST -Dsonar.analysis.mode=issues"
fi
docker run --rm -v $(pwd):/data pierrevincent/sonar-runner $SONAR_OPTIONS
fi
@prashanth-sams
prashanth-sams / sonar.sh
Created January 23, 2019 14:47 — forked from guiwoda/sonar.sh
Run sonarqube analysis
#!/bin/bash
if [ "$PULL_REQUEST_NUMBER" == "false" ]; then
~/sonar-scanner/sonar-scanner-2.8/bin/sonar-scanner -Dsonar.analysis.mode=preview \
Β Β Β Β Β Β Β Β Β Β Β Β Β Β -Dsonar.github.repository=$SEMAPHORE_REPO_SLUG \
Β Β Β Β Β Β Β Β Β Β Β Β Β Β -Dsonar.github.oauth=$GITHUB_TOKEN \
Β Β Β Β Β Β Β Β Β Β Β Β Β Β -Dsonar.host.url=$SONAR_HOST_URL \
Β Β Β Β Β Β Β Β Β Β Β Β Β Β -Dsonar.login=$SONAR_TOKEN
else
~/sonar-scanner/sonar-scanner-2.8/bin/sonar-scanner -Dsonar.analysis.mode=preview \
const express = require('express');
const app = express();
const ServerPortRouter = express.Router();
const ServerPort = require('../models/ServerPort');
ServerPortRouter.route('/add').post(function (req, res) {
const serverport = new ServerPort(req.body);
serverport.save()
.then(serverport => {
@prashanth-sams
prashanth-sams / hubot_cron.js
Last active March 25, 2019 07:50
Hubot - Cron job 2
const CronJob = require("cron").CronJob
module.exports = robot => {
new CronJob(
"00 37 16 * * *",
function() {
try {
robot.messageRoom(
"general", `Hey Prashanth! You got a notification message now`
)
@prashanth-sams
prashanth-sams / hubot_node_cron.js
Created March 25, 2019 07:50
Hubot - Cron job 1
const cron = require("node-cron");
module.exports = robot => {
new cron.schedule("*/1 * * * *", function() {
robot.messageRoom(
"website", `I am running once in every 1 minute`
)
});
}
@prashanth-sams
prashanth-sams / github_list_closed_issues_with_label.coffee
Last active March 25, 2019 14:51
GitHub closed issues 1 - Chatbot
# Description:
# Show closed issues from a Github repository
# Commands:
# hubot closed <assignee> <label> -- Lists all the closed issues with specific label.
_ = require("underscore")
module.exports = (robot) ->
github = require("githubot")(robot)
# Description:
# Show open issues from a Github repository
# Commands:
# hubot label <label> -- Lists all the closed issues with specific label.
_ = require("underscore")
module.exports = (robot) ->
github = require("githubot")(robot)
@prashanth-sams
prashanth-sams / github-emoji.md
Created April 4, 2019 08:39
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue: