Rubymine (Intellij) cannot launch because 'process 2' already running
Nov 11, 23 by Juan Lebrijo about rubymine, blog
When I want to startup my intellij on Ubuntu I get an error: "IDE Already Running", Cannot connect to already running IDE instance. CannotActivateException: Process 2 is still running. When I press "V ok" intellij starts up, opens, and then closes immediatly. Solved in my Ubuntu by removing the pid process file:
rm -r /home/jlebrijo/.config/JetBrains/RubyMine2023.2/.lock
Rubymine overloads all CPU cores
Apr 20, 23 by Juan Lebrijo about rubymine, blog
Historically I found that Rubymine indexings breaking other processes running in your machine, included itself. All computer stopped. A solution would be opening the file `~/.config/JetBrains/RubyMine2023.1/rubymine64.vmoptions` and adding the following line depending number of CPUs you want Rubymine should use to not to overload the computer (in my case I have 8, so I will leave 4 for JVM): -XX:ActiveProcessorCount=4 I am using Rubymine, but probably all Jetbrains products have a similar `.vmoptions` file. Hope it helps!
Defining a Smart Contract Lifecycle in Solidity
Jul 22, 22 by Juan Lebrijo about Solidity, Ethereum, blog
address owner;
bool public paused;
constructor() public {
  owner = msg.sender;
}
function setPaused(bool _paused) public {
  require(msg.sender == owner, "you are not authorized for this action");
  pause = _paused;
}
First on DEPLOYMENT you want to be sure that the owner is the only who interacts with the contract for concrete actions:
  • Address of deployer is the owner
  • constructor(): initializes contract class
  • setPaused(): pause control of contract
  • require(): basic owner authorization
function withdrawAll(address payable _to) public {
  require(msg.sender == owner, "you are not authorized for this action");
  require(!paused, "Contract is paused!");
  _to.transfer(address(this).balance);
}
Second during the LIFECYCLE, you can make any actions on contract balance:
  • require(sender): checks auth
  • require(paused): checks if contract is suspended
  • address(this): gets address of this contract
  function destroy (address payable _to) public {
    require(msg.sender == owner, "you are not authorized for this action");
    selfdestruct(_to);
  }
Last, you can disable a contract by selfdestructing and sending balance to any address the owner wants.