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
openssl req -x509 -newkey rsa:2048 -nodes -keyout=test_key.pem -out test.pem -days=365 -subj='/CN=test.ru' -reqexts SAN -extensions SAN -config <(cat /usr/lib/ssl/openssl.cnf \ | |
<(printf '[SAN]\nsubjectAltName=@alt_names\n[alt_names]\nDNS.1 = test.ru\nDNS.2 = *.test.ru')) -sha256 |
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
protected void setScrollingEnabled(boolean isEnabled) { | |
AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) toolbar.getLayoutParams(); | |
params.setScrollFlags(isEnabled ? (AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL | AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS) : 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
def get_char(c, i): | |
return c if i == 1 else '%s%d' % (c, i) | |
def encode(s): | |
if s == '': | |
return '' | |
res = [] | |
last_char = s[0] | |
i = 1 |
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
http://stackoverflow.com/q/10236953/1333025 | |
I quite enjoyed this exercise. I tried to do it without looking at the answers, | |
and it was worth it. It took me considerable time, but the result is | |
surprisingly close to two of the other answers, as well as to | |
[monad-coroutine](http://hackage.haskell.org/package/monad-coroutine) library. | |
So I guess this is somewhat natural solution to this problem. Without this | |
exercise, I wouldn't understand how _monad-coroutine_ really works. | |
To add some additional value, I'll explain the steps that eventually led me to |
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
https://medium.com/@mondaini/assembling-a-continuous-integration-service-for-a-django-project-on-jenkins-5f979d4c4184 | |
http://www.deploypython.com/source/theme/static/pdf/table-of-contents.pdf |
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
https://medium.com/@mondaini/assembling-a-continuous-integration-service-for-a-django-project-on-jenkins-5f979d4c4184 |
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
#sudo sysctl -w net.inet.ip.portrange.first=32768 | |
sudo sysctl -w net.inet.ip.portrange.first=12000 | |
sudo sysctl -w net.inet.tcp.msl=1000 | |
sudo sysctl -w kern.maxfiles=1000000 kern.maxfilesperproc=1000000 |
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
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <signal.h> | |
#include <iostream> | |
using namespace std; | |
int main() { |
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
# Меняет первое вхождение a на b в arr | |
def replace_first(a, b, arr): | |
arr = arr[:] | |
for i, x in enumerate(arr): | |
if x == a: | |
arr[i] = b | |
return arr | |
return arr | |
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 python3 | |
import os | |
import sys | |
import binascii | |
def find_duplicates(path): | |
checksums = {} |
NewerOlder