Skip to content

Instantly share code, notes, and snippets.

@atsiarenia
atsiarenia / try_to_catch_up_with_the_blocks.sh
Created July 29, 2021 18:03
[OMNIFLIX] try to catch up with the blocks WITH delay
#!/bin/bash
DELAY=3600 #in secs - how often restart the script
RED_COLOR='\033[0;31m'
WITHOU_COLOR='\033[0m'
LATEST_BLOCK_HEIGHT=$(omniflixhubd query tendermint-validator-set | jq . | grep block_height | grep -o -E '[0-9]+')
YOUR_BLOCK_HEIGHT=$(omniflixhubd status 2>&1 | jq ."SyncInfo"."latest_block_height"| grep -o -E '[0-9]+')
DIFF_BLOCK_HEIGHT=$(expr $LATEST_BLOCK_HEIGHT - $YOUR_BLOCK_HEIGHT)
DIFF_BLOCK_LIMIT=0
for (( ;; )); do
echo -e "LATEST BLOCK HEIGHT: ${LATEST_BLOCK_HEIGHT} \n"
@atsiarenia
atsiarenia / try_to_catch_up_with_the_blocks.sh
Created July 29, 2021 15:10
[OMNIFLIX] try to catch up with the blocks
#!/bin/bash
LATEST_BLOCK_HEIGHT=$(omniflixhubd query tendermint-validator-set | jq . | grep block_height | grep -o -E '[0-9]+')
YOUR_BLOCK_HEIGHT=$(omniflixhubd status 2>&1 | jq ."SyncInfo"."latest_block_height"| grep -o -E '[0-9]+')
DIFF_BLOCK_HEIGHT=$(expr $LATEST_BLOCK_HEIGHT - $YOUR_BLOCK_HEIGHT)
DIFF_BLOCK_LIMIT=0
for (( ;; )); do
echo -e "LATEST BLOCK HEIGHT: ${LATEST_BLOCK_HEIGHT} \n"
echo -e "YOUR BLOCK HEIGHT: ${YOUR_BLOCK_HEIGHT} \n"
echo -e "Diff are ${DIFF_BLOCK_HEIGHT}"
if [ $DIFF_BLOCK_HEIGHT -gt $DIFF_BLOCK_LIMIT ]; then
@atsiarenia
atsiarenia / auto_stake_rizon.sh
Created July 23, 2021 10:55
Claiming, getting reward from delegation and delegating rewards for Rizon
#!/bin/bash
GREEN_COLOR='\033[0;32m'
RED_COLOR='\033[0;31m'
WITHOU_COLOR='\033[0m'
DELEGATOR_ADDRESS='rizon1_BLA_BLA'
VALIDATOR_ADDRESS='rizonvaloper1_BLA_BLA'
PWD='YOUR_PASSWORD'
DELAY=3600 #in secs - how often restart the script
ACC_NAME=YOU_WALLET_WITHOUT_QUOTES #example: = ACC_NAME=wallet_qwwq_54
NODE=http://localhost:26657 #change it only if you use another rpc port of your node
@atsiarenia
atsiarenia / Capture.kt
Created February 18, 2020 10:31
Additional helpers methods for kakao/kaspresso
import android.view.View
import android.webkit.WebView
import android.widget.CheckedTextView
import android.widget.TextView
import androidx.test.espresso.ViewInteraction
import androidx.test.espresso.assertion.ViewAssertions
import com.agoda.kakao.common.views.KBaseView
import com.agoda.kakao.common.views.KView
import com.agoda.kakao.screen.Screen
import com.agoda.kakao.text.KTextView
@atsiarenia
atsiarenia / dowloadLatestChromedriver64ForMac.sh
Created September 6, 2019 11:26
Dowload latest Chromedriver for Mac64
#!/bin/sh
latest=`curl http://chromedriver.storage.googleapis.com/LATEST_RELEASE`
url="http://chromedriver.storage.googleapis.com/$latest/chromedriver_mac64.zip"
wget -P /tmp $url
#unzip, copy and etc.
@atsiarenia
atsiarenia / StringWithNumberComparator.java
Created November 12, 2018 09:17
Number aware string sorting with comparator
import java.math.BigInteger;
import java.util.Comparator;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class StringWithNumberComparator implements Comparator<CharSequence> {
public static final StringWithNumberComparator INSTANCE =
new StringWithNumberComparator();
private static final Pattern PATTERN = Pattern.compile("(\\D*)(\\d*)");
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
@atsiarenia
atsiarenia / mac_os_appium_setup.sh
Created September 18, 2017 09:43
Install Appium on macOS from sh script
#!/bin/bash
echo "$1" | sudo -S chown -R `whoami` /usr/local
npm install -g appium
npm install -g authorize-ios
echo "$1" | sudo -S authorize-ios
echo "$1" | sudo -S xcode-select -s /Applications/Xcode.app/Contents/Developer
npm install -g ios-deploy
echo "$1" | gem install xcpretty
brew install carthage
brew install libimobiledevice --HEAD