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 function emailExistsValidatorFn(userService: UserService, trueOnExists: boolean): AsyncValidatorFn { | |
console.log('validator triggered'); | |
return (control: AbstractControl): Promise<ValidationErrors | null> | Observable<ValidationErrors | null> => { | |
console.log(userService); | |
return userService.checkIfEmailExists(control.value, trueOnExists).pipe( | |
take(1), | |
map((result: boolean) => { | |
console.log(result); | |
console.log('psovi nic'); | |
return result ? null : {'emailexists': true}; |
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'); | |
const http = require('http'); | |
let client = new net.Socket(); | |
let httpAgent = new http.Agent({keepAlive: true}); | |
let sock = httpAgent.createConnection({port: 80, host:'localhost'}, (err, sock) => { | |
if(err) { | |
console.error(err); | |
} |
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
#!/bin/sh -ev | |
# Reference: https://github.com/mininet/mininet/wiki/Installing-new-version-of-Open-vSwitch | |
# How to test: ovs-vsctl -V | |
# Check permission | |
test $(id -u) -ne 0 && echo "This script must be run as root" && exit 0 | |
#Remove old version ovs | |
aptitude remove openvswitch-common openvswitch-datapath-dkms openvswitch-controller openvswitch-pki openvswitch-switch -y |