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
package server | |
import ( | |
base64 "encoding/base64" | |
"encoding/json" | |
"github.com/RichardKnop/machinery/v1" | |
"github.com/RichardKnop/machinery/v1/tasks" | |
"github.com/gofiber/fiber" | |
"github.com/shemul/go-machinery/utils" | |
task "github.com/shemul/go-machinery/tasks" |
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
package worker | |
import ( | |
"github.com/RichardKnop/machinery/v1" | |
) | |
func StartWorker(taskserver *machinery.Server) error { | |
worker := taskserver.NewWorker("machinery_worker", 10) | |
if err := worker.Launch(); err != nil { |
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
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 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 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 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 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 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 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
/* | |
author : Shemul Hossain | |
Infix to postfix conversion in C++ | |
Input Postfix expression must be in a desired format. | |
Operands and operator, both must be single character. | |
Only '+' , '-' , '*', '/' and '$' (for exponentiation) operators are expected. | |
*/ | |
#include<iostream> | |
#include<stack> | |
#include<string> |
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
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). | |
% |