Skip to content

Instantly share code, notes, and snippets.

View andrey-yantsen's full-sized avatar

Andrew Y. andrey-yantsen

View GitHub Profile
#!/bin/bash
#### CONFIG ####
XFERLOG="/opt/psa/var/log/xferlog"
MATCH_FILES="index default defaults"
EXCLUDE_LIST=""
awk '($12 ~ /^i$/ && $NF ~ /^c$/){print $9, $8, $14, $7, $1, $2, $3, $4, $5}' $XFERLOG | while read logLine
do
lineArr=($logLine)
fileNameWithPath=${lineArr[0]}
@andrey-yantsen
andrey-yantsen / _bootstrap.php
Created August 13, 2013 10:48
Correct AspectMock configuration for Yii1
$kernel->init([
'debug' => false,
'includePaths' => [
__DIR__ . '/../'
],
'appDir' => __DIR__ . '/../',
'excludePaths' => [
__DIR__ . '/../config',
__DIR__ . '/../vendor/codeception/aspect-mock',
__DIR__ . '/../runtime',
$I->fillField('input[name="cityName"]', 'Lond');
$I->pressKeyDown('input[name="cityName"]', 'o');
$I->pressKey('input[name="cityName"]', 'o');
$I->pressKeyUp('input[name="cityName"]', 'o');
$I->wait(1000);
$I->seeInField('input[name="cityName"]', 'Londo');
server {
listen 80;
root @HOTELLOOK_ROOT@/;
index index.php index.html;
location / {
index index.html index.php;
try_files $uri $uri/ /index.php?$args;
}
#!/bin/bash
for i in $(ls -d *x* 2>/dev/null)
do
if [[ $i =~ [0-9]+x[0-9]+ ]]
then
echo $i
ls *.jpg *.JPG 2>/dev/null | while read f
do
if ! [ -f $i/$f ]

Keybase proof

I hereby claim:

  • I am andrey-yantsen on github.
  • I am virus (https://keybase.io/virus) on keybase.
  • I have a public key whose fingerprint is 013E 3083 3FFC 9B42 28CC 93E0 EB60 FFE9 E18C 297F

To claim this, I am signing this object:

{
"amenities_v2": [
{
"name": "Parking",
"category": "Hotel"
},
{
"name": "Business centre",
"category": "Hotel"
},
{
"took": 355,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 692653,
@andrey-yantsen
andrey-yantsen / x.py
Last active January 9, 2017 08:10
Async bulk
class bulk:
def __init__(self, handler, size):
self.handler = handler
self.size = size
self.data = []
async def __aenter__(self):
return self
async def flush(self):
@andrey-yantsen
andrey-yantsen / readme.md
Last active November 16, 2018 19:38
Автоматическое скачивание новых фильмов