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
- Tune /etc/ssh/sshd_config | |
UseDNS no # Disable DNS lookups | |
GSSAPIAuthentication no # Disable negotation of slow GSSAPI | |
don't forget to restart it, use a script provider to set it , or create it with veewee or snapshot it | |
- Tune Vagrantfile | |
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] |
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
# Read more https://github.com/jpetazzo/dockvpn | |
# Read more http://p.umputun.com/p/2014/08/12/svoi-sobstviennyi-vpn-za-3-minuty/ | |
CID=$(docker run -d --privileged -p 1194:1194/udp -p 443:443/tcp jpetazzo/openvpn) | |
docker run -t -i -p 8080:8080 --volumes-from $CID jpetazzo/openvpn serveconfig | |
#download configuration and run client | |
#echo '#!/bin/sh' > /etc/rc.local | |
#echo 'docker run -d --privileged -p 1194:1194/udp -p 443:443/tcp jpetazzo/openvpn' >> /etc/rc.local |
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
docker rm $(docker ps -a | grep -v NAMES | awk '{print $1}') |
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
docker rmi $(docker images | grep -v REPOSITORY | awk '{print $3}') |
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
docker stop $(docker ps -a | grep -v NAMES | grep -v openvpn | awk '{print $1}') |
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
#Server side | |
echo "ClientAliveInterval 60" | sudo tee -a /etc/ssh/sshd_config | |
# Ubuntu | |
service ssh restart | |
# CentOS | |
service sshd restart | |
#Client side | |
echo "ServerAliveInterval 60" >> ~/.ssh/config | |
echo "ServerAliveCountMax = 120" >> ~/.ssh/config |
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 | |
DatabaseName | |
,SUM(CurrentPerm)/1024/1024 AS USEDSPACE_IN_MB | |
,SUM(MaxPerm)/1024/1024 AS MAXSPACE_IN_MB | |
,SUM(CurrentPerm)/ NULLIFZERO (SUM(MaxPerm)) *100 (FORMAT 'zz9.99%') AS Percentage_Used | |
,MAXSPACE_IN_MB- USEDSPACE_IN_MB AS REMAININGSPACE_IN_MB | |
FROM DBC.DiskSpace | |
WHERE DatabaseName = <<DatabaseName>> | |
GROUP BY DatabaseName; |
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 <iostream> | |
#include <sys/time.h> // for gettimeofday() | |
using namespace std; | |
double r2() | |
{ | |
return (double)rand() / (double)RAND_MAX ; | |
} |
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 <vector> | |
#include <algorithm> | |
#include <iostream> | |
#include <sys/time.h> | |
#include <cstdlib> | |
using namespace std; | |
int main() | |
{ |
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 <vector> | |
#include <cstdlib> | |
#include <algorithm> | |
#include <iostream> | |
#include <sys/time.h> | |
using namespace std; | |
std::pair<int, int> minimax (std::vector<long long> &v) | |
{ |
OlderNewer