Skip to content

Instantly share code, notes, and snippets.

@dejanb
dejanb / mesh-test.md
Last active February 8, 2024 15:41
Test Bluetooth mesh

start clean mesh (first terminal):


$ rm -rf ~/.config/meshcfg/config_db.json
$ sudo rm -rf /var/lib/bluetooth/mesh
$ sudo mkdir /var/lib/bluetooth/mesh
$ sudo /usr/libexec/bluetooth/bluetooth-meshd -nd --debug

provisioner (second terminal):

@navidshaikh
navidshaikh / crc_setup.txt
Last active January 30, 2020 16:20
Get CRC running on local machine
1 - Get CRC:
https://github.com/code-ready/crc/releases
excerpts:
Downloads are available at:
https://mirror.openshift.com/pub/openshift-v4/clients/crc/1.4.0/ .
To use these binaries, please follow the instructions at https://cloud.redhat.com/openshift/install/crc/installer-provisioned
to obtain the needed pull-secret.
(download the pull-secret in your machine in a file)
2 - Extract the tar downloaded (there is a crc binary in there, add the extracted dir to your $PATH)
[jim@thinky poorsmatic]$ for i in $(rhc app show --gears | sed '1,2 d' | cut -d ' ' -f 6); do echo "HOST: $i"; ssh $i jstat -gcutil $\(jps -l \| grep jboss-modules \| awk \'{print \$1}\'\); done
HOST: 5203f3cae0b8cd0552000935@poorsmatic-jimi.rhcloud.com
S0 S1 E O P YGC YGCT FGC FGCT GCT
49.59 0.00 63.45 85.27 99.90 54 7.798 1 2.828 10.626
HOST: 52040513500446daa5000c2c@52040513500446daa5000c2c-jimi.rhcloud.com
S0 S1 E O P YGC YGCT FGC FGCT GCT
0.00 0.00 100.00 99.16 99.88 1110 140.653 194 568.457 709.110
HOST: 52040513500446daa5000c2d@52040513500446daa5000c2d-jimi.rhcloud.com
S0 S1 E O P YGC YGCT FGC FGCT GCT
0.00 45.88 98.27 89.67 99.87 55 8.342 1 2.471 10.813
<subsystem xmlns="urn:jboss:domain:jgroups:1.1" default-stack="tcp">
<stack name="tcp">
<transport type="TCP" socket-binding="jgroups-tcp"/>
<!-- Use S3_Ping because we need to discover the IPs of
the other nodes, and AWS doesn't have multicast. -->
<protocol type="S3_PING">
<property name="secret_access_key">topsy</property>
<property name="access_key">krets</property>
@xeqi
xeqi / pallet.clj
Last active December 14, 2015 23:39
immutant and pallet
(require
'[pallet.crate.git :refer [git clone]]
'[pallet.crate.java :refer [java]]
'[pallet.crate.lein :refer [lein leiningen]])
(def repo "git://github.com/jcrossley3/random-apps-of-kindness.git")
(def demo-directory "random-apps-of-kindness/demo")
(defplan setup-machine
@jcrossley3
jcrossley3 / todo.org
Created January 24, 2012 16:55
Simulated clustering

To test clustering using a single JBoss instance on a single server, use the properties jboss.node.name, jboss.server.data.dir, and jboss.socket.binding.port-offset

In one shell, run

$JBOSS_HOME/bin/standalone.sh --server-config=standalone-ha.xml -Djboss.node.name=one -Djboss.server.data.dir=/tmp/one

In another, run

$JBOSS_HOME/bin/standalone.sh --server-config=standalone-ha.xml -Djboss.node.name=two -Djboss.server.data.dir=/tmp/two -Djboss.socket.binding.port-offset=100
require 'java'
require 'rubygems'
def require_module_jar(path)
require File.join( ENV['TORQUEBOX_HOME'], "/jboss/modules/", path )
end
require_module_jar "javax/jms/api/main/jboss-jms-api_1.1_spec-1.0.0.Final.jar"
require_module_jar "javax/transaction/api/main/jboss-transaction-api_1.1_spec-1.0.0.Final.jar"
require_module_jar "org/hornetq/main/hornetq-core-2.2.7.Final.jar"
$ rvm install jruby
$ rvm --create jruby@torquebox
$ gem install bundler
$ gem install torquebox-server --pre --source http://torquebox.org/2x/builds/LATEST/gem-repo/
$ gem install rails
$ rails new myapp -m $(torquebox env TORQUEBOX_HOME)/share/rails/template.rb
$ cd myapp
$ torquebox deploy
$ torquebox run
require 'torquespec'
TorqueSpec.local {
require 'capybara/dsl'
require 'akephalos'
Capybara.register_driver :akephalos do |app|
Capybara::Driver::Akephalos.new(app, :browser => :firefox_3)
end
require "#{File.dirname(__FILE__)}/../../twitter/spec/spec_helper"
require 'torquebox-core'
remote_describe "tweet consumption testing" do
# Necessary for injection in examples
include TorqueBox::Injectors
# Deploy our apps
deploy <<-END.gsub(/^ {4}/,'')