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
class WordSearchSolver | |
{ | |
private static readonly (int, int)[] Directions = | |
[ | |
(0, 1), (1, 0), (1, 1), (-1, 0), (0, -1), (-1, -1), (1, -1), (-1, 1) | |
]; | |
private static List<List<(int, int)>> SearchWord(char[][] matrix, string word) | |
{ | |
var rows = matrix.Length; |
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
using System; | |
using System.Diagnostics; | |
namespace StringsPermutation | |
{ | |
/// <summary> | |
/// Check Permutation: Given two strings, | |
/// write a method to decide if one is a permutation of the other. | |
/// Let's assume that strings are ASCII, case-insensitive | |
/// </summary> |
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
public int solution(int N) | |
{ | |
if (N < 5) return 0; | |
var bits = Convert.ToString(N, 2).Length; | |
int result = 0; | |
int gap = 0; | |
bool canCount = false; |
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
# Install dependencies | |
NGINX_VERSION=1.10.1 && \ | |
OPENSSL_VERSION=1.0.1t && \ | |
NPS_VERSION=1.11.33.3 && \ | |
sudo apt-get install unzip build-essential checkinstall git libpcre3 libpcre3-dev zlib1g zlib1g-dbg zlib1g-dev && \ | |
mkdir -p ~/sources/ && \ |
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 subprocess | |
from ansible.plugins.connection.ssh import Connection as ConnectionSSH | |
from ansible.errors import AnsibleError | |
from socket import create_connection | |
from time import sleep | |
try: | |
from __main__ import display | |
except ImportError: |
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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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
root@deployer:/tmp# hdparm -tT /dev/sda | |
/dev/sda: | |
Timing cached reads: 18522 MB in 2.03 seconds = 9120.75 MB/sec | |
Timing buffered disk reads: 342 MB in 3.08 seconds = 111.10 MB/sec | |
root@deployer:/tmp# cat /proc/meminfo | |
MemTotal: 608680 kB | |
MemFree: 210448 kB | |
MemAvailable: 234308 kB | |
Buffers: 6128 kB |