Skip to content

Instantly share code, notes, and snippets.

View ppokrovsky's full-sized avatar

Pavel Pokrovskiy ppokrovsky

  • Alfa Bank
  • Moscow
View GitHub Profile
{"line":"{\"stream\":\"stdout\",\"logtag\":\"F\",\"request_id\":\"f763a11c229d6ba4c28b50b742447d61\",\"method\":\"GET\",\"path\":\"/api/v1/profile\",\"format\":\"*/*\",\"controller\":\"Api::V1::ProfileController\",\"action\":\"show\",\"status\":200,\"duration\":106.96,\"view\":0.32,\"db\":69.51,\"event_ts\":1961051.466763782,\"ip\":\"185.104.249.142\",\"user_id\":82078,\"account_id\":34043,\"token_id\":742}","timestamp":"2022-12-20T16:48:01.468185389Z"}
[DEFAULT]
username=Admin
groups=Administrators
inject_user_password=true
config_drive_raw_hhd=true
config_drive_cdrom=true
config_drive_vfat=true
bsdtar_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\bsdtar.exe
mtools_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\
verbose=true
[DEFAULT]
username=Admin
groups=Administrators
inject_user_password=true
config_drive_raw_hhd=true
config_drive_cdrom=true
config_drive_vfat=true
bsdtar_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\bsdtar.exe
mtools_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\
verbose=true
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="generalize">
<component name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<PersistAllDeviceInstalls>true</PersistAllDeviceInstalls>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
<OOBE>
@ppokrovsky
ppokrovsky / Preprocessing_LR_Coursera_5.py
Last active August 15, 2020 08:29
Preprocessing_LR_Coursera_5
from sklearn.preprocessing import PolynomialFeatures
transform = PolynomialFeatures(2)
(X_train_real_zeros, X_test_real_zeros,
y_train, y_test) = train_test_split(X_real_zeros, y,
test_size=0.3,
random_state=0,
stratify=y)
(X_train_cat_oh, X_test_cat_oh) = train_test_split(X_cat_oh,
@ppokrovsky
ppokrovsky / gist:381b4ecac7b7873650830b9b4c68e38d
Created August 15, 2020 08:28
Preprocessing_LR_Coursera_5
from sklearn.preprocessing import PolynomialFeatures
transform = PolynomialFeatures(2)
(X_train_real_zeros, X_test_real_zeros,
y_train, y_test) = train_test_split(X_real_zeros, y,
test_size=0.3,
random_state=0,
stratify=y)
(X_train_cat_oh, X_test_cat_oh) = train_test_split(X_cat_oh,
from pyspark import SparkContext
sc.stop()
conf = (SparkConf().setAppName("pi"))
sc = SparkContext('spark://master:7077', conf = conf)
from pyspark import SparkContext
import random as rnd
SAMPLES = 100
def inside(p):
x, y = rnd.random(), rnd.random()
return x*x + y*y < 1
count = sc.parallelize(range(0, SAMPLES)).filter(inside).count()
from django.core.mail import send_mail
def send_super_long_message():
test_body_ru = "В южных морях наступает в жизни каждого мужчины такой день, когда он понимает: пора распрощаться со всеми друзьями и уплыть прочь, и он так и делает, и так оно и должно быть, потому что настал его час. Вот так и сегодня. Мы с тобой очень похожи - ты тоже иногда засиживаешься на субботних утренниках до девяти вечера, пока мы не пошлем за тобой отца. Но помни, Том, когда те же ковбои начинают стрелять в тех же индейцев на тех же горных вершинах, самое лучшее - тихонько встать со стула и пойти прямиком к выходу, и не стоит оглядываться, и ни о чем не надо жалеть."
test_body_lat = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi semper pretium egestas. Aliquam elementum quis ex ac ornare. Donec sit amet diam mauris. In sit amet velit sed ex cursus malesuada. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin auctor interdum convallis. Vestibulum a libero at ri
@ppokrovsky
ppokrovsky / gist:2953103
Created June 19, 2012 08:58
Cucumber/Capybara steps to check checkbox value by corresponding label text
Then /^Checkbox "([^"]*)" should be checked$/ do |checkbox|
page.has_checked_field?("#{checkbox}").should be_true
end
Then /^Checkbox "([^"]*)" should be unchecked$/ do |checkbox|
page.has_checked_field?("#{checkbox}").should be_false
end