This file contains hidden or 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
#!/usr/bin/env bash | |
COMMUNITY='public' | |
FDB_OID='.1.3.6.1.2.1.17.7.1.2.2.1.2' | |
TIMEOUT=5 | |
RETRIES=3 | |
if [ "$#" -ne 2 ]; then | |
echo "Usage: $0 <MAC> <IP>" | |
exit 1 |
This file contains hidden or 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 | |
ESB_REQUESTS_LOG_PATH="/opt/esb/Runtime_ESBSE/container/log/*.request.log" | |
#HOSTS=(`cat ./requests/*.request.log | awk '{print $1}' | sort -n | uniq -c`) | |
#HOSTS=(`cat ./requests/2019_12_04.request.log | awk '{print $1}' | sort -n | uniq -c`) | |
# cat ${ESB_REQUESTS_LOG_PATH} | awk '$4 >= "25/May/2020:00:00:00"' | awk '{print $1}' | sort -n | uniq -c | |
HOSTS=(`cat ${ESB_REQUESTS_LOG_PATH} | awk '$4 >= "1/May/2023:00:00:00"' | awk '{print $1}' | sort -n | uniq -c`) |
This file contains hidden or 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 | |
# https://habr.com/ru/post/153135/ | |
# | |
PID=$(top -n1 | grep -m1 java | perl -pe 's/\e\[?.*?[\@-~] ?//g' | cut -f1 -d' ') | |
NID=$(printf '%x' $(top -n1 -H | grep -m1 java | perl -pe 's/\e\[?.*?[\@-~] ?//g' | cut -f1 -d' ')) | |
jstack $PID | grep -A500 $NID | grep -m1 '^$' -B 500 |
This file contains hidden or 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
static unsigned char byte_clamp(int c) | |
{ | |
unsigned char rc = { static_cast<unsigned char>(c), 255, 0 }; | |
unsigned uc = static_cast<unsigned>(c); | |
// +1 if greater 255 | |
// and +1 if bit of sign 1 | |
return rc[!!(uc & ~0xff) + !!(uc & ~(~0u >> 1))]; | |
} |
This file contains hidden or 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
ok=0; err=0; for ((;;)) do curl ${yourip} > /dev/null 2>&1 && { ((ok++)); err=0; echo -en "ok $ok\r"; } || { r=$?; ok=0; ((err++)); echo "error:$r $err"; } ; sleep 1; done |
This file contains hidden or 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
#include <iostream> | |
#include <fstream> | |
#include <vector> | |
char* filename = "test.bin"; | |
size_t chunk_sz = (32*1024); | |
int main(void) | |
{ | |
std::ifstream fin(filename, std::ifstream::ate | std::ifstream::binary); |
This file contains hidden or 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
dnf downgrade gcc --releasever=25 # mustbe not needed | |
dnf install compat-openssl10-devel --allowerasing |
This file contains hidden or 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
go get -u github.com/nsf/gocode | |
go get -u golang.org/x/tools/cmd/guru | |
go get -u github.com/rogpeppe/godef | |
and GOROOT |
This file contains hidden or 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 | |
sudo dnf install -y eclipse-{platform,pydev,cdt-sdk,egit,webtools-javaee} | |
sudo dnf install -y eclipse-dltk-{ruby,mylyn,rse,tests,sdk,tcl,itcl,xotcl} | |
sudo dnf install -y eclipse-color-theme |
This file contains hidden or 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
public static void main(String[] args) { | |
Operationable operation; | |
operation = (x,y)->x+y; | |
int result = operation.calculate(10, 20); | |
} | |
public class LambdaApp { | |
public static void main(String[] args) { | |
Operationable op = new Operationable(){ |
NewerOlder