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: | |
elasticsearch: | |
image: docker.elastic.co/elasticsearch/elasticsearch:7.0.0 | |
container_name: elasticsearch | |
ports: | |
- "9200:9200" | |
- "9300:9300" | |
volumes: | |
- ./es/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro |
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
before_script: | |
- apt-get update -qq && apt-get install -y -qq sshpass | |
deploy_production: | |
stage: deploy | |
only: | |
- master | |
script: | |
- ls | |
- sshpass -V |
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
RESTORE DATABASE AdventureWorks2012 | |
FROM DISK= '/var/opt/mssql/AdventureWorks2012.bak' | |
WITH MOVE 'AdventureWorks2012' TO '/var/opt/mssql/data/AdventureWorks2012.mdf', | |
MOVE 'AdventureWorks2012_Log' TO '/var/opt/mssql/data/AdventureWorks2012.ldf' |
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: | |
mssql: | |
image: mcr.microsoft.com/mssql/server:2017-latest-ubuntu | |
container_name: "mssql" | |
networks: | |
- local-network | |
ports: | |
- "1433:1433" | |
restart: always |
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
SELECT | |
t1.`id`, | |
t1.`uid`, | |
t1.`proticketid`, | |
t1.`subject`, | |
t1.`created`, | |
t1.`lastreply`, | |
t1.`status`, | |
t1.`ticketnoti`, | |
t1.`topic` |
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
SELECT AVG(CASE WHEN num = 0 THEN NULL ELSE num END) | |
FROM( | |
SELECT 2.0 as num | |
UNION ALL | |
SELECT 0 | |
UNION ALL | |
SELECT NULL | |
UNION ALL | |
SELECT 1 | |
) AS t |
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
<?php | |
require_once("vendor/autoload.php"); | |
$op = $_REQUEST['op']; | |
if ($op == "create") { | |
png(); | |
} else if($op == "download") { | |
word(); |
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> | |
<head> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | |
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> | |
<script type="text/javascript"> | |
google.charts.load('current', {'packages':['corechart']}); | |
google.charts.setOnLoadCallback(drawChart); | |
function drawChart() { |
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
db.search_logs.aggregate([ | |
{ | |
$match: { 'keyword': 'Super car' } | |
}, | |
{ | |
"$group": { | |
"_id": { | |
'keyword': '$keyword', | |
'username': '$username', | |
'created': { $dateToString: { format: "%Y-%m-%d", date: "$created_at" } } |
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
db.search_logs.aggregate( | |
[ | |
{ | |
$group : { | |
_id : { | |
keyword: "$keyword" | |
, created: { $dateToString: { format: "%Y-%m-%d", date: "$created_at" } } | |
} | |
, users: { | |
$push: { |