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
const puppeteer = require('puppeteer'); | |
const escapeXpathString = str => { | |
const splitedQuotes = str.replace(/'/g, `', "'", '`); | |
return `concat('${splitedQuotes}', '')`; | |
}; | |
const clickByText = async (page, text) => { | |
const escapedText = escapeXpathString(text); | |
const linkHandlers = await page.$x(`//a[contains(text(), ${escapedText})]`); |
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
do_chk_only_root_can_execute_me(){ | |
if [[ $(id -u) -ne 0 ]]; then | |
echo "This script must be run ONLY as THE root" | |
exit 1 | |
fi | |
} |
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
$set_environment_variables = <<SCRIPT | |
tee "/etc/profile.d/myvars.sh" > "/dev/null" <<EOF | |
# Ansible environment variables. | |
export ANSIBLE_STDOUT_CALLBACK=debug | |
# AWS environment variables. | |
export AWS_DEFAULT_REGION=#{ENV['AWS_DEFAULT_REGION']} | |
export AWS_ACCESS_KEY_ID=#{ENV['AWS_ACCESS_KEY_ID']} | |
export AWS_SECRET_ACCESS_KEY=#{ENV['AWS_SECRET_ACCESS_KEY']} | |
EOF |
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
# chk the followin tool - http://scalaxb.org/setup | |
# chk the prerequisite tool - http://www.foundweekends.org/conscript/setup.html | |
# install the conscript , check your proxy settings first - your should be able to connect to the Internet | |
cd ~ | |
wget https://raw.githubusercontent.com/foundweekends/conscript/master/setup.sh | |
vim setup.sh | |
# and intstall it | |
sh setup.sh # wait patiently - all jvm stuff is usually slow ... |
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
#file: doc/cheat-sheets/mac-cheat-sheet.sh | |
# how-to check that a DNS server is working to a target url | |
nslookup <<target-uri>> <<dns-server-to-check>> | |
nslookup www.google.fi 8.8.8.8 | |
dig @8.8.8.8 www.apple.com | |
# how-to get hw info - lsb_release -a for mac | |
system_profiler SPSoftwareDataType |
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
#!/bin/bash | |
set -x | |
#set -eu -o pipefail | |
# file: CI/start-minio.sh | |
export minio_data_dir='/opt/deptmnt/data/minio-data' | |
mkdir -p $minio_data_dir | |
# set credentials for the server |
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
# create a docker image in the current directory from the Dockerfile in it | |
docker build --tag=the-tag . | |
# list all the images | |
docker images -a | |
# remove all the images | |
docker rmi $(docker images -q) | |
# remove all the containers |
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
# add the remote git host named "fork" | |
git remote add fork [email protected]:UserName/src_proj.git | |
# fetch all the data from the for | |
git fetch fork | |
# check the branches | |
git branch -a | |
# create and checkout the local target branch name |
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
object Msgs { | |
case class Msg( | |
code: Int, | |
name: String, | |
description: String = null | |
) | |
val infMsgs = List( | |
Msg(1, "inf-msg-01"), |
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
<script src="https://unpkg.com/axios/dist/axios.min.js"></script> | |
<script> | |
function getUrlParams (){ | |
var url_params = new URLSearchParams(); | |
if( window.location.toString().indexOf("?") != -1) { | |
var href_part = window.location.search.split('?')[1] | |
href_part.replace(/([^=&]+)=([^&]*)/g, | |
function(m, key, value) { | |
var attr = decodeURIComponent(key) |
NewerOlder