Сообщения

Сообщения за 2018

intellij

if u wanna replace with capturing group (src: https://www.jetbrains.com/help/idea/tutorial-finding-and-replacing-text-using-regular-expressions.html) (.)+ this won't work but (.)? will work. yes, strange.

add user with ssh pub key unix

sudo mkdir /home/tomcat8 sudo groupadd tomcat8 sudo useradd -s /bin/sh -g tomcat8 -d /home/tomcat8 tomcat8 usermod -s /bin/sh tomcat8 change user cli usermod -a -G sudo tomcat8 groups groups username chmod 700 -R /home/user sudo chmod 700 /home/user/.ssh sudo chmod 600 /home/almas/.ssh/authorized_keys execute sudo cmd without passwd: sudo visudo In the bottom of the file, type the follow: username ALL=(ALL) NOPASSWD: ALL

игрища с digitalocean

sudo pam-auth-update --package face_authentication sudo rm /usr/share/pam-configs/face-authentication sudo apt-get remove pam-face-authentication src:  https://ubuntuforums.org/archive/index.php/t-1893148.html -------------------- https://www.digitalocean.com/community/tutorials/ubuntu-18-04-ru https://www.digitalocean.com/community/tutorials/mysql-ubuntu-18-04-ru https://www.digitalocean.com/community/tutorials/ufw-essentials-common-firewall-rules-and-commands https://www.digitalocean.com/community/tutorials/how-to-secure-mysql-and-mariadb-databases-in-a-linux-vps https://rtfm.co.ua/digitalocean-znakomstvo-droplet-floating-ip-firewall/ https://www.digitalocean.com/community/tutorials/nginx-let-s-encrypt-ubuntu-18-04-ru https://devtidbits.com/2015/12/08/nginx-as-a-reverse-proxy-to-apache-tomcat/ ->> https://habr.com/post/318952/#podgotovim-nginx-k-polucheniyu-sertifikatov https://www.digitalocean.com/community/tutorials/nginx-ubuntu-18-04-ru ------------

jenkins tomcat spring boot

+++++++++++++++++++++++++ up & run++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++ apache-tomcat-8.5.24\bin\catalina.bat conf/tomcat-users.xml : role rolename="manager-gui"/role role rolename="manager-script"/role role rolename="manager-status"/role role rolename="manager-jmx"/role role rolename="standard"/role role rolename="admin-gui"/role user password="admin" roles="admin-gui, manager-gui,standard,manager-script,manager-status,manager-jmx" username="admin"/user http://localhost:8080/docs/appdev/ http://localhost:8080/manager/status http://localhost:8080/manager/html http://localhost:8080/manager/html/deploy http://localhost:8080/docs/appdev/ +++++++++++++++++++++++++ first of all check open port in firewall : sudo ufw status verbose src:  https://www.cyberciti.biz/faq/how-to-open-firewall-port-on-ubuntu-linux-12-04-14-04-lts/ /etc/

graphql финты ушами

когда надо в параметре передать [Int]! то так неззя надо делать объект который быдет иметь такое поле. -------------------------------------------- Multiple fields In a single GraphQL query, we can write as many root query fields as we need. In the server, all these fields will be processed in parallel and will give you the result as a whole. {   latestPost {     title   },   authors {     name   } } src:  https://medium.com/@tkssharma/wrapping-a-rest-api-in-graphql-querying-graphql-779345035949 make type-resolvers so you can go infinitely deep into the graph. I made a simple server example here that shows deep relationships. Because all the noun-fields are references, it goes infinitely deep for any query. * можно добавлять параметризованные поля в типы, но по смыслу это то же самое что мульти запрос: type Word{     id: String!     value: String!     lang1(var1:Int):String! } data class Word(         val id: Int,         val value: String ) { /* эта

mysql transaction Propagation.REQUIRES_NEW

странный баг когда REQUIRES_NEW то будет несколько транзакций если есть вложенность и на каждом REQUIRES_NEW. это может привести к проблеме зависания в процесслисте мускула update инструкции. в общем читать тут: https://stackoverflow.com/questions/19367186/mysql-update-hangs-with-no-error

java...kotlin

иннер классы иногда не обновляются идеей по замене скомпилированных классов или горячей замене. поэтому мавек клин или удалить target. и потом рестарт полный.

unix man

$() means: "first evaluate this, and then evaluate the rest of the line". Ex : echo $(pwd)/myFile.txt will be interpreted as echo /my/path/myFile.txt On the other hand ${} expands a variable. Ex: MY_VAR=toto echo ${MY_VAR}/myFile.txt will be interpreted as echo toto/myFile.txt sudo -i is the way to go if you don't want to be typing a password every 10 mins while doing modifications in your system (or other systems), and you don't want to modify any system files. It will switch you to root using your sudo user password, when you close the console or type exit you are back to your normal user. src:  https://askubuntu.com/questions/147241/execute-sudo-without-password

unix optimization azure vps swap file

*********** choose B1S for free usage during 12 month. src: https://azure.microsoft.com/en-us/free/free-account-faq/ 750 hours of Azure B1S General Purpose Virtual Machines for Linux 12 months disk: ssd premium the problem is disk IO max limit. 16.9 MB/s solvation: increase swap. by the way - it's completely disabled by default! sudo dd if=/dev/zero of=/swapspace bs=1M count=2000 sudo mkswap /swapspace sudo swapon /swapspace watch -n 1 cat /proc/swaps grep SwapTotal /proc/meminfo src: https://askubuntu.com/questions/566745/allocate-swap-after-ubuntu-14-04-lts-installation https://bogdancornianu.com/change-swap-size-in-ubuntu/ https://www.tecmint.com/commands-to-monitor-swap-space-usage-in-linux/ clear: apt autoclean xbcnbnm от headers after it can be installed firefox: sudo apt-get install firefox before continue: sudo apt-get update CAUTIONS: !!!!!!!!!RDP:  firefox freeze in a ~10 minutes and cause os to stuck. *********** RDP: src: https://www.youtube.c

spring 5 and co

* there is  OAuth2Authentication result = tokenServices.loadAuthentication(accessToken.getValue()); shows how manually load auth. C:/Users/Ya/.m2/repository/org/springframework/security/oauth/spring-security-oauth2/2.2.1.RELEASE/spring-security-oauth2-2.2.1.RELEASE-sources.jar!/org/springframework/security/oauth2/client/filter/OAuth2ClientAuthenticationProcessingFilter.java:103 *