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
| const readline = require('readline'); | |
| const fs = require('fs'); | |
| const crypto = require('crypto'); | |
| const axios = require('axios'); | |
| function sleep(ms) { | |
| return new Promise((resolve) => { | |
| setTimeout(resolve, ms); | |
| }); | |
| } |
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
| -- Source | |
| -- https://www.sqlshack.com/gathering-sql-server-indexes-statistics-and-usage-information/ | |
| -- https://www.mssqltips.com/sqlservertutorial/256/discovering-unused-indexes/ | |
| -- https://www.mssqltips.com/sqlservertip/1239/how-to-get-index-usage-information-in-sql-server/ | |
| -- https://www.sqlshack.com/how-to-identify-and-monitor-unused-indexes-in-sql-server/ | |
| -- List indexes on a table | |
| EXEC sp_helpindex '--table name here--' | |
| -- Top 50 queries run on database |
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
| var config = require('../../config') | |
| module.exports = function(req, res, next) { | |
| if(config.debug){ | |
| res.header("Access-Control-Allow-Origin", 'http://localhost:8080'); | |
| res.header("Access-Control-Allow-Methods", "GET,POST,DELETE") | |
| res.header("Access-Control-Allow-Headers", "Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With,Origin, Access-Control-Allow-Origin, x-access-token, Accept, x-pass") | |
| res.header("Access-Control-Allow-Credentials", "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
| upstream app_crm { | |
| zone app_crm 64k; | |
| server 0.0.0.0:8001 max_fails=0 fail_timeout=10s weight=1; | |
| server 0.0.0.0:8002 max_fails=0 fail_timeout=10s weight=1; | |
| # server 0.0.0.0:8003 max_fails=0 fail_timeout=10s weight=1; | |
| # server 0.0.0.0:8004 max_fails=0 fail_timeout=10s weight=1; | |
| # Send visitors back to the same server each time. | |
| #ip_hash; | |
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 <ESP8266WiFi.h> | |
| #include <ESP8266HTTPClient.h> | |
| void setup(){ | |
| WiFi.begin("ssid", "password"); | |
| while (WiFi.status() != WL_CONNECTED) | |
| { | |
| delay(500); | |
| Serial.print("."); |
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
| # Colors for the prompt | |
| blue="\033[0;34m" | |
| white="\033[0;37m" | |
| green="\033[0;32m" | |
| # Brackets needed around non-printable characters in PS1 | |
| ps1_blue='\['"$blue"'\]' | |
| ps1_green='\['"$green"'\]' | |
| ps1_white='\['"$white"'\]' |
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
| var files = event.target.files || event.dataTransfer.files; | |
| if (!files.length){ | |
| return; | |
| } | |
| var fd = new FormData | |
| fd.append('file', files[0]) | |
| http.post('/api/admin/file/upload', fd) |
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
| #!/bin/sh | |
| # Use like this: | |
| # | |
| # minify-js.sh < app.js > app.min.js | |
| # | |
| curl -s \ | |
| -d compilation_level=SIMPLE_OPTIMIZATIONS \ | |
| -d output_format=text \ |
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 bindReady(handler){ | |
| var called = false | |
| function ready() { | |
| if (called) return | |
| called = true | |
| handler() | |
| } |
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
| uptime | |
| dmesg | tail | |
| vmstat 1 | |
| mpstat -P ALL 1 | |
| pidstat 1 | |
| iostat -xz 1 | |
| free -m | |
| sar -n DEV 1 | |
| sar -n TCP,ETCP 1 | |
| top |
NewerOlder