Skip to content

Instantly share code, notes, and snippets.

@mardanyan
mardanyan / reset_idea_trial.sh
Created October 5, 2025 12:53 — forked from patchthecode/reset_idea_trial.sh
reset intellij trial
#!/bin/sh
#https://github.com/PythonicNinja/jetbrains-reset-trial-mac-osx/blob/master/runme.sh
for product in IntelliJIdea WebStorm DataGrip PhpStorm CLion PyCharm GoLand RubyMine Rider; do
echo "Closing $product"
ps aux | grep -i MacOs/$product | cut -d " " -f 5 | xargs kill -9
echo "Resetting trial period for $product"
REM Delete eval folder with licence key and options.xml which contains a reference to it
for %%I in ("WebStorm", "IntelliJ", "CLion", "Rider", "GoLand", "PhpStorm", "Resharper", "PyCharm") do (
for /d %%a in ("%USERPROFILE%\.%%I*") do (
rd /s /q "%%a/config/eval"
del /q "%%a\config\options\other.xml"
)
)
REM Delete registry key and jetbrains folder (not sure if needet but however)
rmdir /s /q "%APPDATA%\JetBrains"
@mardanyan
mardanyan / SynchronizationIssue2.java
Created December 3, 2022 21:58
Java Concurrency: Guess why it doesn't work now but works with synchronized(lock) ?
public class SynchronizationIssue2 {
static Integer val = 0;
static Integer lock = 0;
public static void main(String[] args) throws Exception {
CountDownLatch latch = new CountDownLatch(2);
ExecutorService ex = Executors.newFixedThreadPool(2);
for(int i = 0; i < 2; i++) {
@mardanyan
mardanyan / SynchronizationIssue.java
Last active December 3, 2022 21:59
Java Concurrency: Synchronization issue. Try to figure out issue
public class SynchronizationIssue {
static Integer a = 0;
public static void main(String[] args) throws Exception {
CountDownLatch latch = new CountDownLatch(2);
ExecutorService ex = Executors.newFixedThreadPool(2);
for(int i = 0; i < 2; i++) {
ex.submit(() -> {
int count = 1000;
while(count-- > 0) {
@mardanyan
mardanyan / PrintOddEvenWithTwoDifferentThreads.txt
Last active December 1, 2022 21:53
Java concurrency: Print N numbers via 2 threads one for each even and odd number
public class PrintOddEvenWithTwoDifferentThreads {
public static void main(String[] args) throws Exception {
State state = new State(StateEnum.ODD);
Thread th1 = new Thread(new PrinterNumber(state, StateEnum.EVEN, 0));
Thread th2 = new Thread(new PrinterNumber(state, StateEnum.ODD, 1));
th1.setName("Even");
th2.setName("Odd");
th1.start();
List of all books tagged with software-architecture on Goodreads with applied a simple algorithmic rules (relevant to software architecture, content is not obsolete, it must be tech agnostic and average rating > 3.5). Rating is based on the number of written reviews, but also including the average rating, the number of ratings, and the publishing date.
Categories and the best book in each one:
1. ๐—ฆ๐˜†๐˜€๐˜๐—ฒ๐—บ ๐—”๐—ฟ๐—ฐ๐—ต๐—ถ๐˜๐—ฒ๐—ฐ๐˜๐˜‚๐—ฟ๐—ฒ: Clean Architecture, Robert C. Martin. https://lnkd.in/drQ_tyGg
2. ๐——๐—ฒ๐˜€๐—ถ๐—ด๐—ป ๐—ฃ๐—ฎ๐˜๐˜๐—ฒ๐—ฟ๐—ป๐˜€: Head First Design Patterns: Building Extensible and Maintainable Object-Oriented Software, Eric Freeman, Elisabeth Robson. https://lnkd.in/dbgnMGxB
#!/bin/bash
#
# Run following commands on any node of vRLI cluster
# The command used in the varialbe `command` could be modified appropriately
# for every node you need pass ssh password, this way it kept simple. Without any extra package dependencies.
# below line could be modified appropriately
command="service loginsight restart"
file=`/usr/lib/loginsight/application/sbin/li-utility.sh --get_latest_config_file`; list=`cat $file | grep "daemon host" | sed 's/.*daemon host="\(.*\)" port.*/\1/'`
kind: Service
apiVersion: v1
metadata:
name: helloworldservice
spec:
selector:
app: hello-world
ports:
- protocol: "TCP"
# Port accessible inside cluster
@mardanyan
mardanyan / nmap.sh
Last active August 16, 2019 08:19
security check
nmap 10.10.10.10 -p 443 --script ssl-enum-ciphers