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
[Unit] | |
Description=Keeps a tunnel to 'server.com' open | |
After=network-online.target ssh.service | |
[Service] | |
# starting in user-mode: | |
User=user | |
ExecStart=/usr/bin/ssh -q -Nt -o ControlMaster=no -o ControlPath=/tmp/no -o ExitOnForwardFailure=yes -o ServerAliveInterval=15 -o ServerAliveCountMax=3 -p 22 -l user server.com -R 2224:127.0.0.1:22 -i /home/user/.ssh/id_rsa | |
# Restart every >2 seconds to avoid StartLimitInterval failure |
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
import Vue from 'vue'; | |
import Component from 'vue-class-component'; | |
@Component({ | |
name: 'control-edit', | |
props: { | |
actionName: { | |
type: String, | |
default: '', | |
}, |
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
<template> | |
<div> | |
<section class="page-content__content page-content__wrap-items"> | |
<div class="community page-content__community"> | |
<div class="community__head"> | |
<figure class="community__cover"> | |
<img :src="community.image_big_url" class="community__cover-img" alt=""> | |
</figure> | |
<div class="community__head-panel"> | |
<div class="community__head-avatar"> |
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
require('http').createServer((req, res) => {console.log(req.headers);res.writeHead(200);res.end('Hello, World!');}).listen(3000, '0.0.0.0') |
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
export REQUEST_NAME='getMessages'; \ | |
docker-compose logs traefik | grep $REQUEST_NAME | grep 'HTTP/1' | \ | |
awk -F ' - - ' '{print $2}' | awk '{print $13}' > "/tmp/logs_$REQUEST_NAME.log" && \ | |
sort -V "/tmp/logs_$REQUEST_NAME.log" | python3 /tmp/percentiles.py | |
# exmaple output from `docker-compose logs`: | |
# traefik | 192.168.1.100 - - [19/Jan/2021:08:30:56 +0000] "POST /chat/getUsersByIds HTTP/1.0" 200 60 "-" "-" 170636628 "middleware@docker" "h2c://10.27.3.25:80" 27ms | |
# |
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
# /usr/local/etc/my.cnf | |
[mysqld] | |
general-log-file = /usr/local/var/mysql/mysql.log | |
general-log = 1 | |
log-output = file | |
sql_mode = '' | |
log_error = /usr/local/var/mysql/error.log | |
max_connections = 500 |
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
#!/usr/bin/env bash | |
mac_address=$1 | |
# Strip colons from the MAC address | |
mac_address=$(echo $mac_address | sed 's/://g') | |
broadcast=$2 | |
port=9 | |
nc_args="-w1 -u" |
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
const net = require('net'); | |
var getBits = (octet) => { | |
var bits = []; | |
for (var i = 7; i >= 0; i--) { | |
var bit = octet & (1 << i) ? 1 : 0; | |
bits.push(bit); | |
} | |
return bits; |
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
var server = require('../../../bin/www'), | |
request = require('supertest'), | |
models = require('../../../models'); | |
describe('Feedback', function() { | |
it('should all fields be required', function(done) { | |
request(server) | |
.post('/api/feedback') | |
.expect('Content-type', /application\/json/) |
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
import Dispatcher, {EventObject} from "Dispatcher"; | |
/** | |
* Items collection | |
*/ | |
export default class Collection { | |
static E_ADD = 'add'; | |
static E_REMOVE = 'remove'; | |
static E_CHANGE = 'change'; |
NewerOlder