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 | |
# | |
# description: Tomcat Start Stop Restart | |
# processname: tomcat | |
# chkconfig: 234 20 80 | |
# | |
# Tomcat 8 start/stop/status init.d script | |
# Initially forked from: https://gist.github.com/valotas/1000094 | |
# @author: Miglen Evlogiev <[email protected]> | |
# |
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
jre=`update-alternatives --display java |grep -om 1 '\ /.*jdk.*jre'` | |
jre=$jre'/lib/fonts' | |
unzip -o -j arimo.zip "*.ttf" -d $jre | |
echo Installed Arimo font to $jre |
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
Enable GZIP Traffic compression for slow LAN - actually sacrifices performance to much faster network access - you should not apply this mindlessly | |
server.xml | |
<Connector | |
className="Http11Nio2Protocol" | |
enableLookups="false" | |
compression="force" | |
URIEncoding="UTF-8" port="8080" protocol="HTTP/1.1" | |
connectionTimeout="40000" | |
socket.directBuffer="true" | |
redirectPort="8443" /> |
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 | |
export TKN=$(curl -X POST 'http://localhost:8080/auth/realms/master/protocol/openid-connect/token' \ | |
-H "Content-Type: application/x-www-form-urlencoded" \ | |
-d "username=admin" \ | |
-d 'password=admin' \ | |
-d 'grant_type=password' \ | |
-d 'client_id=admin-cli' | jq -r '.access_token') | |
curl -X GET 'http://localhost:8080/auth/admin/realms' \ |
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
<Connector port="8443" maxHttpHeaderSize="8192" | |
protocol="org.apache.coyote.http11.Http11NioProtocol" SSLEnabled="true" | |
maxThreads="150" minSpareThreads="25" maxSpareThreads="75" | |
enableLookups="false" disableUploadTimeout="true" | |
acceptCount="100" scheme="https" secure="true" | |
clientAuth="false" | |
algorithm="GostX509" | |
keystoreProvider="JCP" | |
sslProtocol="GostTLS" | |
keystoreType="HDImageStore" |
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
public class SpringBootExternalTest { | |
static CompletableFuture<Throwable> initializationException; | |
@BeforeClass | |
public static void startSpringContext() { | |
initializationException = new CompletableFuture<>(); | |
Thread appThread = new Thread(() -> { | |
SpringApplication springApplication = new SpringApplication( | |
SpringBootApplication.class); | |
springApplication.addListeners((ApplicationListener<ApplicationReadyEvent>) event -> initializationException.complete(null)); |
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
public class Split { | |
public static Pattern whitespace = Pattern.compile("\\s+"); | |
public static void main(String[] s) { | |
List<Block> blocks = splitWithDelimiters("r2ejh2j 24 3"); | |
blocks = splitWithDelimiters("СЛОН ТОПТПАИТ 24 3343"); | |
blocks = splitWithDelimiters(" топтает "); | |
blocks = splitWithDelimiters(" тооп"); | |
blocks = splitWithDelimiters(" "); | |
blocks = splitWithDelimiters(""); |
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
// Tags: | |
// Version name: ignore leading non-digits and everything after the first underscore | |
// Version code: take digits after the first underscore | |
// e.g. tag xxx1.2.3.foo-bar_15_baz will yield versionName 1.2.3.foo-bar and versionCode 15 | |
// Output filename: | |
// <project name>-<release|debug>-<version (from last tag)|"dev" (doesn't have tag)>[-NOTRELEASE (exist changes after last tag)]-<last short commit hash>[-dirty (exist changes)].apk | |
// Sample: | |
// myproject-debug-dev-094cf50.apk | |
// myproject-debug-0.1.0-094cf50.apk |
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
:if ( [/ping 8.8.8.8 count=5 size=64 interval=2s ] =0) do={ | |
:log error "-----No ping"; | |
/system routerboard usb power-reset duration=2; | |
:log error "----Reset USB Power"; | |
/delay 30s | |
:log error "disable"; | |
/interface disable lte1; | |
/delay 5s | |
:log error "enable"; | |
/interface enable lte1; |
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
import requests | |
import json | |
import base64 | |
url = 'http://192.168.0.1/goform/goform_get_cmd_process?isTest=false&cmd=sms_data_total&page=0&data_per_page=500&mem_store=1&tags=10&order_by=order+by+id+desc' | |
s = requests.Session() | |
s.headers.update({'Host': '192.168.0.1'}) | |
s.headers.update({'Referer': 'http://192.168.0.1/index.html'}) | |
r = s.get(url) |
OlderNewer