options.add_argument("user-agent=Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36")
tail -f /logs/catalina.out
sleep infinity
@echo off
REM для https://qna.habr.com/q/1027240
set C=%~nx0
if NOT "%DEBUG%" equ "" echo Running with DEBUG set
REM using two environment parameters: C and DEBUG
REM NOTE: passing arguments appears tricky when
REM powershell run with command built inline as string
@powershell.exe -ExecutionPolicy Bypass -Command "$debug=$env:DEBUG;$s=(get-content \"%~f0\") -join \"`n\"; $s = $s.substring($s.IndexOf(\"goto :\"+\"EOF\")+9);if ($debug -ne $null){write-output (\"Running:`n{0}\" -f$s);} invoke-expression -command $s"
@goto :EOF
# powershell code
start-sleep 5
write-output ( 'Calling script: {0}' -f $env:C)
pause
exit 0
c:\Users\sergueik\Desktop>set debug=1
c:\Users\sergueik\Desktop>show_caller.cmd
Running with DEBUG set
Running:
Start-Sleep 5
write-output ( 'Calling script: {0}' -f $env:C)
pause
exit 0
Calling script: show_caller.cmd
Press Enter to continue...:
jq --arg k1 "first" --arg v1 "32" --arg k2 "second" --arg v2 "32" --arg k3 "third" --arg v3 "33" '. | .[$k1]=$v1 | .[$k2]=$v2 | .[$k3]=$v3' <<<'{}' ;
{
"first": "32",
"second": "32",
"third": "33"
}
id -u
id -g
export HOST_USER=$(id -u):$(id -g)
на контейнере RUN addgroup -S $GROUP_NAME \
&& adduser -h /home/$USER_NAME -u $UID -s /bin/sh -D -G $GROUP_NAME $USER_NAME \
&& chown -R $USER_NAME:$GROUP_NAME список директорий каких надо
USER $USER_NAME
text = 'Continue to Discord'
text = 'Принять приглашение'
driver.find_element_by_xpath('//button/div[contains(text(), "{}")]'.format(text))
{"method":"xpath","selector":"//button/div[contains(text(), "Принять приглашение")]"}
from cyrtranslit import to_latin
from selenium import webdriver
from selenium.webdriver.firefox.webdriver import WebDriver
def waittest:
def __init__(self, selector, value):
self.selector = selector
self.value = value
def __call__(self, driver):
element = driver.find_element_by_css_selector(self.selector)
text = element.text
print('checking text: "{}" against "{}"'.format(to_latin(text, 'ru'), self.value))
if to_latin(text, 'ru') == self.value:
return element
else:
return None
text = to_latin('Принять приглашение', 'ru')
element = WebDriverWait(driver, 10).until( waittest("button[class *= 'button']", text))
while (!questions.isEmpty()) {
String question = questions.pop();
System.out.println(question);
String line = null;
while (line == null || line.isEmpty())
line = bufferedReader.readLine();
answer.add(line);
}
var rawText = '{"one":1,"two":2,"four":4}';
var jsonObj = JSON.parse(rawText);
var key = 'two';
var val = null;
for (prop in jsonObj) {
if (prop.match(key)) {
val = jsonObj[prop];
}
}
console.log('key: ' + key);
console.log('val: ' + val);
var rawText = '{"key":["one","two","three"]}';
var jsonObj = JSON.parse(rawText);
var key = 'key';
var val = jsonObj[key].join(',');
console.log('val: ' +val );
sed -e "s/,/, ${id},/" users.txt
echo a,b,c > users.txt;read -p "ID: " id; sed -e "s/,/, ${id},/" users.txt
ID: 123456
a, 123456,b,c
services:
webapp:
build: ./path
build:
context: .
dockerfile: Dockerfile
build: registry.gitlab.com/testapp/services/dockers/dockers:latest