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
| func Add(args ...int64) (int64, error) { | |
| sum := int64(0) | |
| for _, arg := range args { | |
| sum += arg | |
| } | |
| time.Sleep(time.Second * 5) | |
| return sum, nil | |
| } |
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
| func GetMachineryServer() *machinery.Server { | |
| Logger.Info("initing task server") | |
| taskserver, err := machinery.NewServer(&config.Config{ | |
| Broker: "redis://localhost:6379", | |
| ResultBackend: "redis://localhost:6379", | |
| }) | |
| if err != nil { | |
| Logger.Fatal(err.Error()) | |
| } |
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
| package main | |
| import ( | |
| "os" | |
| "github.com/RichardKnop/machinery/v1" | |
| "github.com/shemul/go-machinery/server" | |
| "github.com/shemul/go-machinery/utils" | |
| "github.com/shemul/go-machinery/worker" | |
| "github.com/urfave/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
| ├── go.mod | |
| ├── go.sum | |
| ├── main.go | |
| ├── server | |
| │ └── server.go | |
| ├── tasks | |
| │ └── tasks.go | |
| ├── utils | |
| │ └── utils.go | |
| └── worker |
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
| # Root. | |
| $ docker exec -u 0 -it {container_id/image_name} bash | |
| or | |
| # Default container's user. | |
| $ docker exec -it {container_id/image_name} bash |
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
| # A scrape configuration scraping a Node Exporter and the Prometheus server | |
| # itself. | |
| scrape_configs: | |
| # Scrape Prometheus itself every 5 seconds. | |
| - job_name: 'prometheus' | |
| scrape_interval: 5s | |
| static_configs: | |
| - targets: ['localhost:9090'] |
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
| <? | |
| // script to update local version of Google analytics script | |
| // Remote file to download | |
| $remoteFile = 'https://www.google-analytics.com/analytics.js'; | |
| $localfile = '/home/refinedseo/domain_name_with_tld/files/local-analytics.js'; | |
| //$localfile = '/home/refinedseo/public_html/domain_name_with_tld/wp-content/analytics.js'; | |
| //For Cpanel it will be /home/USERNAME/public_html/local-ga.js | |
| // Connection time out |
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
| function [trainedClassifier, validationAccuracy] = trainClassifier(trainingData) | |
| % trainClassifier(trainingData) | |
| % returns a trained classifier and its accuracy. | |
| % This code recreates the classification model trained in | |
| % Classification Learner app. | |
| % | |
| % Input: | |
| % trainingData: the training data of same data type as imported | |
| % in the app (table or matrix). | |
| % |
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
| /**< | |
| problem : https://algo.codemarshal.org/problems/55184554742a2fff09a42faa | |
| author : shemul | |
| reference : https://www.youtube.com/watch?v=1-Q_BQ0ypmg | |
| */ | |
| #include<iostream> | |
| #include<stdio.h> |
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
| #include <iostream> | |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <ctype.h> | |
| #include<stdlib.h> | |
| using namespace std; | |