Skip to content

Instantly share code, notes, and snippets.

View Karm's full-sized avatar
🎪
Staring at my screen

Karm Michal Babacek Karm

🎪
Staring at my screen
View GitHub Profile
@Karm
Karm / mod_cluster.conf
Last active August 29, 2015 14:02
mod_cluster configuration snippets
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
LoadModule slotmem_module modules/mod_slotmem.so
LoadModule manager_module modules/mod_manager.so
LoadModule advertise_module modules/mod_advertise.so
Listen 192.168.122.74:2181
MemManagerFile "/opt/bpms/load-balancer/jboss-ews-2.0/httpd/cache/mod_cluster"
ServerName 192.168.122.74:2181
@Karm
Karm / mod_cluster.conf
Created July 18, 2014 09:40
mod_cluster HTTPS-only configuration example
# Note: There is only "Listen 192.168.122.204:2181" in conf/http.conf,
# all other configuration including SSL is done here for demonstration purposes.
LoadModule slotmem_module modules/mod_slotmem.so
LoadModule manager_module modules/mod_manager.so
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
LoadModule advertise_module modules/mod_advertise.so
MemManagerFile "/dev/shm/httpd/cache/mod_cluster"
@Karm
Karm / error_log
Created October 7, 2014 14:02
MODCLUSTER-430 pastebin...
mod_manager.c(1907): manager_trans INFO (/)
mod_manager.c(2623): manager_handler INFO (/) processing: ""
mod_manager.c(2672): manager_handler INFO OK
mod_manager.c(1907): manager_trans CONFIG (/)
mod_manager.c(2623): manager_handler CONFIG (/) processing: "JVMRoute=jboss-eap-6.3-2&Host=192.168.122.204&Maxattempts=1&Port=8110&StickySessionForce=No&Type=ajp&ping=10"
mod_manager.c(2672): manager_handler CONFIG OK
mod_manager.c(1907): manager_trans ENABLE-APP (/)
mod_manager.c(2623): manager_handler ENABLE-APP (/) processing: "JVMRoute=jboss-eap-6.3-2&Alias=default-host%2Clocalhost%2Cexample.com&Context=%2Fclusterbench"
mod_manager.c(1347): process_appl_cmd: adding vhost: 1 node: 1
mod_manager.c(2672): manager_handler ENABLE-APP OK
@Karm
Karm / server_logs
Created January 22, 2015 14:52
Session draining
6.4.0.Beta1
-----------
[org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 60) JBAS010281: Started default-host/clusterbench cache from web container
[org.jboss.web] (ServerService Thread Pool -- 60) JBAS018210: Register web context: /clusterbench
[org.jboss.as.server] (ServerService Thread Pool -- 30) JBAS015859: Deployed "clusterbench.war" (runtime-name : "clusterbench.war")
[org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://192.168.122.172:9990/management
[org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://192.168.122.172:9990
[org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss EAP 6.4.0.Beta1 (AS 7.5.0.Final-redhat-17) started in 6734ms - Started 260 of 337 services (124 services are lazy, passive or on-demand)
[org.jboss.web] (ServerService Thread Pool -- 60) JBAS018224: Unregister web context: /clusterbench
@Karm
Karm / unbound_python_notes.md
Last active August 29, 2015 14:19
Unbound Python module: examine response just before it's send to the client

Goal

I would like to examine the response just before it's dispatched to the client. Primarily, I'm interested in the ;; ANSWER SECTION:.

Problem

What had looked like a trivial modification of logDnsMsg function turned out to be a dounting task of browsing reply_info, rrset_ref and ub_packed_rrset_key structures in pursuit of the desired ;; ANSWER SECTION: bytes.

The reason is the logDnsMsg function does not work as expected for A queries ;; ANSWER SECTION:, while it suprisingly operates as expected for ;; AUTHORITY SECTION: on AAAA queries.

@Karm
Karm / mod_cluster.conf
Created August 12, 2015 09:30
Fail_on_status mod_cluster configuration
LoadModule slotmem_module modules/mod_slotmem.so
LoadModule manager_module modules/mod_manager.so
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
LoadModule advertise_module modules/mod_advertise.so
MemManagerFile "/dev/shm/mod_cluster-eapx/jboss-ews-2.1/httpd/cache/mod_cluster"
ProxyPass / balancer://balancerxxx stickysession=JSESSIONID|jsessionid nofailover=on failonstatus=201
ProxyPassReverse / balancer://balancerxxx
ProxyPreserveHost on
@Karm
Karm / CMakeLists.txt
Last active September 6, 2021 20:32 — forked from jcfr/CMakeLists.txt
CMake project allowing to build OpenSSL 32 and 64-bit for Windows and upload the associated "tar.gz" archives on http://packages.kitware.com
cmake_minimum_required(VERSION 2.8.10.2)
#
# This project allows to configure, build, archive and upload an OpenSSL install tree.
#
if(DEFINED UPLOAD_PACKAGE_SCRIPT)
set(MIDAS_URL "http://packages.kitware.com")
set(FOLDER_ID 203)
@Karm
Karm / woker:jboss-eap-7.0-2.log
Created October 21, 2015 09:43
3 Wildfy servers with mod_cluster, web session relication, failover on JVM kill
2015-10-20 14:02:30,638 INFO [org.jboss.modules] (main) JBoss Modules version 1.4.4.Final
2015-10-20 14:02:34,397 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final
2015-10-20 14:02:35,345 INFO [org.jboss.as] (MSC service thread 1-6) WFLYSRV0049: EAP 7.0.0.Alpha1 (WildFly Core 2.0.0.CR5) starting
2015-10-20 14:02:35,362 DEBUG [org.jboss.as.config] (MSC service thread 1-6) Configured system properties:
331122245 = true
[Standalone] =
awt.toolkit = sun.awt.X11.XToolkit
file.encoding = UTF-8
file.encoding.pkg = sun.io
file.separator = /
@Karm
Karm / undertow.batch
Created November 6, 2015 11:15
Undertow mod_cluster proxy ruidementary config
/socket-binding-group=standard-sockets/socket-binding=modcluster-adv:add(multicast-address=224.0.5.12, port=35409, multicast-port=35409)
/subsystem=undertow/configuration=filter:read-resource(include-runtime=true, recursive=true, recursive-depth=100)
/subsystem=undertow/configuration=filter/mod-cluster=modcluster:add(management-socket-binding=http,advertise-socket-binding=modcluster-adv)
/subsystem=undertow/server=default-server/host=default-host/filter-ref=modcluster:add()
/subsystem=logging/console-handler=CONSOLE:write-attribute(name=level,value=DEBUG)
/subsystem=logging/root-logger=ROOT:write-attribute(name=level,value=DEBUG)
reload
import java.lang.management.ManagementFactory
import java.lang.management.OperatingSystemMXBean
/**
* @author Michal Karm Babacek
*/
OperatingSystemMXBean bean = ManagementFactory.getOperatingSystemMXBean()
println "load: ${bean?.getSystemLoadAverage()}"
println "avail. processors: ${bean?.getAvailableProcessors()}"