Skip to content

Instantly share code, notes, and snippets.

View elendili's full-sized avatar
🐶

elendili elendili

🐶
  • Luxoft
  • Belgrade
  • 17:46 (UTC +02:00)
View GitHub Profile
@elendili
elendili / select_rows_in_concur_report.js
Last active August 25, 2022 08:42
Luxoft Concur. When need to highlight expenses to match specific amount (588 CHF specifically)
/**
1. Open Concur -> Expense -> "View Transactions"
https://www.concursolutions.com/Expense/Client/cardtransactions.asp
2. Open JS Console in browser (tested in Chrome) and copy-paste code from below to run.
3. Upon execution script highlight rows which sum is close to 588 with green color.
4. Then need to click such rows manually.
5. Click 'Add Selected'
*/
from statistics import mean
from time import time
def timer(f):
def wrapper():
start = time()
f()
end = time()
return (end - start) * 1000
# create a load for CPU
dd if=/dev/urandom | gzip -9 >> /dev/null &
# nano usage: ctrl+o for save, ctrl+x to exit
# vim usage: :wq - to write and exit
Network tools:
iftop -p -n
dig - DNS lookup utility
traceroute -- print the route packets take to network host
@elendili
elendili / clojure-helper.clj
Created September 6, 2019 10:56
clojure-helper
;; stalin sort is when every element which is bigger than next is removed from output
(def input [9 10 2 3 11 4 23 -1 0])
(defn stalin-sort [inp]
(reduce #(if (>= %2 (or (last %1) %2)) (conj %1 %2) %1 ) [] inp))
(stalin-sort input)
;; -----------------
@elendili
elendili / streambase-helper.md
Created March 12, 2019 17:24
streambase-helper

jsbc and sbc

jsbc -p16116 list -m | grep BatchOrderCount
jsbc -p16116 list -Cgood_tables
jsbc -p16116 readTable -v --all PositionFile
jsbc -p16116 readTable ---header --limit 2 CompositeDate --where "RDS_RIC == 'CAT'"
jsbc -p16116 readTable ---header --all CompositeDate --where "contains(RDS_RIC,'MSFT_123') and SY_REGION=='US'"

suspend debug

sbd -d address=0.0.0.0:3001,suspend=y

@elendili
elendili / xpath-helper.md
Created March 12, 2019 17:14
xpath-helper
$x("//tr[ (td[5][not(@class='fail') or td[4]/a[contains(@href,'?pageHistory')] ]").forEach( e=> e.remove() )

$x("//a[contains(@class,'deleteLink')]").slice(1).forEach( e=> e.click() ); window.location.reload(true);

$x("//*[@class='expandall']).forEach( e=>e.click() )

$x("//*[@class='expandall']).length

@elendili
elendili / jira-jql-helper.md
Created March 12, 2019 17:06
jira-jql-helper

project=X and status changed by (user1,user2,user3) after "2014/08/01" order by key ASC

@elendili
elendili / win-cmd-helper
Created March 12, 2019 17:02
win-cmd-helper
mklink /J target-folder c:\work\source-folder\
@elendili
elendili / java-helper.md
Created March 12, 2019 13:20
java-helper

get stacktrace of running app

/path/to/jstack 13339 | less

@elendili
elendili / linux-bash-shell-hints.md
Last active March 13, 2019 12:51
linux/bash shell hints

login

sudo -u luxinfra bash -l
sudo -iHu luxinfra

generic file management

find and start app from crontab

crontab -l | grep start | cut -d " " -f6- | xargs -0 bash -c

find files in hostile folders

find . -name "*.cfg" 2>&1 | grep -v 'No such file'