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
| <?php | |
| if(!function_exists("dump")) { | |
| /** | |
| * Simple debug output with caller file::line | |
| * @param mixed $obj | |
| * @param boolean $die - should stop after debug output? | |
| * @param boolean $var_dump - use var_dump instead of print_r | |
| * @return null | |
| */ |
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
| # coding=utf-8 | |
| """ | |
| Nginx: | |
| log_format main '$remote_addr - $remote_user [$time_local] "$request" $_sus $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for" [$host] [$request_time]'; | |
| Usage: | |
| $ grep -E ".*12/Jan/2016:00.*POST /api/.*" /var/log/nginx/host.access.log | python3 /tmp/avg_time.py | |
| Output: | |
| /api/cli/runtime/ping |
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
| #!/usr/bin/env sh | |
| for s in `seq 00 23`; do printf -v PATTERN 'Jan/2016:%02d:.*' $s; echo $PATTERN: `grep -c $PATTERN /var/log/nginx/host.com.access.log`; done |
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
| # coding=utf-8 | |
| import os | |
| import six | |
| import timeit | |
| import bitmath | |
| if six.PY3: | |
| from os import walk | |
| from os import scandir |
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
| # coding=utf-8 | |
| """ | |
| Usage: | |
| $:> python crop.py thumbs 240 180 | |
| $:> python crop.py posters 800 600 | |
| """ | |
| import os | |
| import sys | |
| import glob |
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
| # coding: utf-8 | |
| """ Fast domains resolver using asyncio via multiple DNS | |
| Requirements: dnslib | |
| Usage: cat domains.txt | python3 resolver.py | |
| """ | |
| import sys | |
| import time | |
| import socket | |
| import struct |
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
| #!/usr/bin/env python3 | |
| import os | |
| import sys | |
| import stat | |
| stdin = None | |
| mode = os.fstat(0).st_mode | |
| if not any((stat.S_ISFIFO(mode), stat.S_ISREG(mode))): | |
| print("Error: Is not piped") |
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
| $: apt install libssl-dev libperl-dev | |
| $: | |
| $: bash <(curl -f -L -sS https://ngxpagespeed.com/install) --nginx-version latest -b /opt | |
| ... | |
| --user=www-data \ | |
| --group=www-data \ | |
| --sbin-path=/usr/sbin/nginx \ | |
| --pid-path=/var/run/nginx.pid \ | |
| --prefix=/etc/nginx \ |
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
| # coding: utf-8 | |
| import time | |
| import itertools | |
| import datetime | |
| try: | |
| import elasticsearch | |
| except ImportError: | |
| import pip | |
| pip.main(['install', '--user', 'elasticsearch']) |
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
| Хорошо и очень хорошо: | |
| - За пригоршню долларов | |
| - На несколько долларов больше | |
| - Хороший, плохой, злой | |
| - Двухсотлетний человек | |
| - День Сурка | |
| - Прежде чем я усну (День Сурка у бабы) | |
| - Сапожник (Сендлер) | |
| - Экипаж (tags: вещества, негр, самолет) | |
| - Игра Эндера |
OlderNewer