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
| # Dockerfile | |
| FROM | |
| WORKDIR /app | |
| COPY ./src /app | |
| # docker-compose.yml |
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
| .PHONY: down up build shell | |
| down: | |
| docker-compose down --remove-orphans -v --rmi local | |
| build: | |
| docker-compose build --no-cache | |
| up: down build | |
| docker-compose up |
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
| import json | |
| import requests | |
| def get_sorted_contents(params): | |
| contents = [] | |
| es_url = "http://localhost:9200/contents/_search/template" | |
| with requests.Session() as session: | |
| response = session.post(es_url, data=json.dumps(params), headers={"Content-Type":"application/json"}) | |
| for hit in response.json()["hits"]["hits"]: |
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
| version: "3" | |
| services: | |
| elastic: | |
| image: docker.elastic.co/elasticsearch/elasticsearch:7.14.0 | |
| environment: | |
| - discovery.type=single-node | |
| ports: | |
| - 9200:9200 | |
| kibana: | |
| image: docker.elastic.co/kibana/kibana:7.14.0 |
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
| gsettings set org.gnome.desktop.background picture-uri "" | |
| gsettings set org.gnome.desktop.background primary-color '#249C44' |
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
| conky.config = { | |
| background=true, | |
| alignment='top_right', | |
| use_xft = true, | |
| font = 'DejaVu Sans Mono:size=10', | |
| double_buffer=true, | |
| own_window=true, | |
| own_window_transparent=true, | |
| own_window_argb_visual=true, |
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
| FROM alpine | |
| RUN apk add --update nodejs npm | |
| RUN npm install -g wscat2 | |
| CMD wscat -c ws://<IP>:8000/ws -k |
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
| <html> | |
| <body> | |
| <script type="text/javascript"> | |
| var wSocket = new WebSocket("ws://your-ip:8000/ws") | |
| wSocket.onopen = function() { | |
| console.log('websocket opened') | |
| }; | |
| wSocket.onmessage = function (evt) { |
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 ( | |
| "log" | |
| "net/http" | |
| "github.com/gorilla/mux" | |
| "github.com/gorilla/websocket" | |
| ) |
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
| // index | |
| const http = require('http'); | |
| const handler = (req, res) => { | |
| res.writeHead(200, {'Content-Type': 'application/json; charset=utf-8'}); | |
| res.end(JSON.stringify({message: 'REST API Örneği'})); | |
| }; | |
| const server = http.createServer(handler); |