Skip to content

Instantly share code, notes, and snippets.

View zygm0nt's full-sized avatar
🥑
AFK

Marcin Cylke zygm0nt

🥑
AFK
View GitHub Profile
#!/bin/bash
# 1st, release all DHCP address and remove all IP address associated
# with the original eth0
#/sbin/dhcpcd -k
kill `pidof dhclient`
/sbin/ip addr flush eth0
# then take the interface down so we can rename it
/sbin/ip link set eth0 down
# now rename the original eth0 to reth0 (Real ETH0)
nameif reth0 00:24:81:43:61:5b
sudo qemu openbsd-4.7.img -net tap -net nic,macaddr=52:54:00:12:34:57,model=ne2k_pci
@zygm0nt
zygm0nt / activemq.xml
Created March 31, 2011 20:04
advisory messages in ActiveMQ
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry queue="my/test/queue" advisoryForDelivery="true" advisoryForConsumed="true"/>
<policyEntry topic=">" producerFlowControl="true" memoryLimit="1mb">
<pendingSubscriberPolicy>
<vmCursor />
</pendingSubscriberPolicy>
</policyEntry>
</policyEntries>
@zygm0nt
zygm0nt / appCtx.xml
Created March 31, 2011 20:07
advisor topics Spring configuration
<bean id="testQueue" class="org.apache.activemq.command.ActiveMQQueue" autowire="constructor">
<constructor-arg value="my/test/queue" />
</bean>
<bean id="deliveredToTestQueueAdvisory" class="org.apache.activemq.command.ActiveMQTopic" autowire="constructor">
<constructor-arg value="ActiveMQ.Advisory.MessageDelivered.Queue.my/test/queue" />
</bean>
@zygm0nt
zygm0nt / add_untrusted_cert.sh
Created May 2, 2011 11:13
creating java keystore 2
mcl@correspondence:~/Desktop$ java InstallCert abc.host.pl keystore_pass
Loading KeyStore keystore.jks...
Opening connection to abc.host.pl:443...
Starting SSL handshake...
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1623)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:198)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:192)
@zygm0nt
zygm0nt / add_untrusted_key.sh
Created May 2, 2011 11:13
creating java keystore
java InstallCert abc.host.pl keystore_pass
@zygm0nt
zygm0nt / servicemix-http-xbean.xml
Created May 2, 2011 11:29
xbean file for servicemix-http based component
<beans xmlns:http="http://servicemix.apache.org/http/1.0"
xmlns:my="http://example.pl/abc">
<http:endpoint
endpoint="default"
locationURI="https://abc.host.pl"
role="provider"
service="my:service-1"
soap="true"
soapVersion="1.1">
@zygm0nt
zygm0nt / InstallCert.java
Created May 2, 2011 11:43
install untrusted certificates to your keystore
/*
* Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
@zygm0nt
zygm0nt / DictionaryValue.java
Created July 12, 2011 06:47
oval dictionary check
import net.sf.oval.configuration.annotation.Constraint;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD})
@Constraint(checkWith = DictionaryValueCheck.class)
@zygm0nt
zygm0nt / jdbc-soapui.groovy
Created November 2, 2011 14:25
soapui and JDBC drivers
if (context.sql == null) {
def driver = 'oracle.jdbc.OracleDriver'
com.eviware.soapui.support.GroovyUtils.registerJdbcDriver( driver )
def sql = Sql.newInstance('jdbc:oracle:thin:' + dbUri, driver)
context.setProperty('sql', sql)
}