Skip to content

Instantly share code, notes, and snippets.

@swaldman
swaldman / jconsole_remote_hints
Last active Apr 9, 2020
Some hints on debugging remote jconsole Connection problems
View jconsole_remote_hints
Expressed as ant xml, but these are system properties that should be set on the JVM to be instrumented:
<sysproperty key="com.sun.management.jmxremote" value="true"/>
<sysproperty key="com.sun.management.jmxremote.port" value="38383" />
<sysproperty key="com.sun.management.jmxremote.authenticate" value="false" />
<sysproperty key="com.sun.management.jmxremote.ssl" value="false" />
<sysproperty key="java.rmi.server.hostname" value="10.10.10.10" /><!-- ip address of the JVM you wanna connect to -->
To see debugging information when running jconsole client:
View aaa-coding-links.txt
View gist:1dbb10b77df23219eac8
[root@tickle1 /]# semanage fcontext -a -e /usr/share/nginx/html /home/web/fallback
[root@tickle1 /]# restorecon -vR /home/web/fallback
restorecon reset /home/web/fallback context system_u:object_r:user_home_t:s0->system_u:object_r:httpd_sys_content_t:s0
restorecon reset /home/web/fallback/index.html context system_u:object_r:user_home_t:s0->system_u:object_r:httpd_sys_content_t:s0
restorecon reset /home/web/fallback/somefile context system_u:object_r:user_home_t:s0->system_u:object_r:httpd_sys_content_t:s0
@swaldman
swaldman / GethAsAService.md
Last active Feb 7, 2022
Setting up geth as a service under systemd (Updated for Fedora 27)
View GethAsAService.md

Setting up geth as a service under systemd Fedora 27

Prerequisite: dnf install golang

  1. Create user geth with useradd
  2. As user geth fast sync the blockchain, geth --fast --cache 1024
  3. Manually run geth --rpc as user geth and watch to see that the blockchain continues to sync properly
  4. Install the geth.service file (also in this gist) in /usr/lib/systemd/system/
  5. Make a symlink from /etc/systemd/system/multi-user.target.wants/geth.service to /usr/lib/systemd/system/geth.service
  6. systemctl enable geth followed by systemctl start geth
View Setting_Up_eth-netcompile_fedora_23.md

Setting up ethnetcompile as a service under systemd Fedora 23

  1. Create user eth-netcompile with useradd
  2. sudo mkdir /usr/local/gitproject
  3. in /usr/local/gitproject, git clone git@github.com:swaldman/eth-netcompile.git
  4. in /usr/local/gitproject/eth-netcompile, /usr/local/pkg/node/bin/npm install --save to get dependencies
  5. Install the eth-netcompile.service file (also in this gist) in /usr/lib/systemd/system/
  6. Make a symlink from /etc/systemd/system/multi-user.target.wants/eth-netcompile.service to /usr/lib/systemd/system/eth-netcompile.service
  7. systemctl enable eth-netcompile.service followed by systemctl start eth-netcompile.service
  8. Verify that logging goes to the systemd journal with journalctl --follow -u eth-netcompile
@swaldman
swaldman / keypair-demo.md
Last active Jun 5, 2017
an eth-command-line keypair example
View keypair-demo.md

So, usually you generate wallets, not keypairs directly, to avoid exposing the ultrasensitive private key directly. But if you just want to get a keypair, here's an easy way with some of the tooling I'm working on.

Prerequisite: Java 8 installed on your machine.

Caveats: No warranties, if anybody gets or sees the private key any value associated with the keypair may be stolen, the entropy behind the generation of these keys is the default implementation and seeding of java.security.SecureRandom, which may or may not be adequate. This is a SNAPSHOT version that references lots of other SNAPSHOT libraries, which may not be stable and will be redownloaded with annoying frequency until (hopefully soon) it is upgraded to a release version.

View SimpleToken.sol
/*
* DO NOT EDIT! DO NOT EDIT! DO NOT EDIT!
*
* This is an automatically generated file. It will be overwritten.
*
* For the original source see
* '/Users/swaldman/Dropbox/BaseFolders/development-why/noscm/POOP/src/main/solidity/SimpleToken.sol'
*/
pragma solidity ^0.4.22;
View nick-real-estate.md

‪a quick take‬ ‪(in one sitting, tapping into a smart phone. of course it’s probably wrong.)‬

‪let’s set aside risk, for simplicity. the land is an input to a business, say growing apples. ‬each period you invest in working capital and get less back in sales than you spent, but maybe more than you would have got from a bank. that is the new definition of “profitability”. under risk neutrality, the value of the land is either 0 (if the negative return on working K is the same as the bank rate, perfect competition), infinite (if it will be perpetually higher), or some finite value (if it will be temporarily higher). eventually, after temporary, it is either zero or infinite. but if it is infinite, either it contradicts the perpetual negative rate assumption (as finance availability is scarce relative to infinity, so people bid it to a finite rate), or else the value of the numeraire falls to zero (as infinite finance is made available).

let’s suppose the perfect competition version, so having land effectively

@swaldman
swaldman / aaa-ethdocstore-setup.txt
Last active Apr 27, 2021
Setting up ethdocstore as a service under systemd Fedora 27
View aaa-ethdocstore-setup.txt
This gist describes ethdocstore setup.