Skip to content

Instantly share code, notes, and snippets.

@mresetar
mresetar / femDeleteFilter.py
Created December 20, 2017 12:25
Delete FEM events by using the filter
# lookup the failed event manager
objstr = AdminControl.completeObjectName('WebSphere:*,type=FailedEventManager')
obj = AdminControl.makeObjectName(objstr)
# create filter and return filtered events
import com.ibm.wbiserver.manualrecovery.QueryFilters
filter1 = com.ibm.wbiserver.manualrecovery.QueryFilters()
#filter1.setFilterArray('EVENT_TYPE', ['SCA','JMS','BPC','MQ'])
filter1.setFilterArray('EVENT_TYPE', ['SCA'])
dateFilter = java.util.Date("12/1/2016");
@mresetar
mresetar / femDelete100.py
Created December 20, 2017 12:01
Delete 100 FEM events
# lookup the failed event manager
objstr = AdminControl.completeObjectName('WebSphere:*,type=FailedEventManager')
obj = AdminControl.makeObjectName(objstr)
# count the overall number of failed events
fecount = AdminControl.invoke(objstr, "getFailedEventCount")
print "Before discarding failed events"
print fecount
# create filter and return filtered events
@mresetar
mresetar / femPrint.py
Created December 20, 2017 11:56
Prints failed events
# lookup the failed event manager
objstr = AdminControl.completeObjectName('WebSphere:*,type=FailedEventManager')
obj = AdminControl.makeObjectName(objstr)
# count the overall number of failed events
fecount = AdminControl.invoke(objstr, "getFailedEventCount")
print "Total number of failed events"
print fecount
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:primjer="http://www.croz.net/StanjeRacunaServis/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="StanjeRacunaServis"
targetNamespace="http://www.croz.net/StanjeRacunaServis/">
<wsdl:types>
<xsd:schema targetNamespace="http://www.croz.net/StanjeRacunaServis/">
<xsd:element name="StanjeRacunaRequest" type="primjer:StanjeRacunaRequestType" />
<xs:schema attributeFormDefault="unqualified" targetNamespace="http://www.example.org/vjezba2"
elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="recipe">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="title" />
<xs:element name="ingredient" maxOccurs="unbounded"
minOccurs="0">
<xs:complexType>
<xs:simpleContent>
<?xml version="1.0" ?>
<recipe xmlns="http://www.example.org/vjezba2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.example.org/vjezba2 vjezba2.xsd" name="bread"
prep_time="5 mins" cook_time="3 hours">
<title>Basic bread</title>
<ingredient amount="8" unit="dL">Flour</ingredient>
<ingredient amount="10" unit="grams">Yeast</ingredient>
<ingredient amount="4" unit="dL" state="warm">Water</ingredient>
<ingredient amount="1" unit="teaspoon">Salt</ingredient>
<instructions>
<?xml version="1.0" ?>
<recipe name="bread" prep_time="5 mins" cook_time="3 hours">
<title>Basic bread</title>
<ingredient amount="8" unit="dL">Flour</ingredient>
<ingredient amount="10" unit="grams">Yeast</ingredient>
<ingredient amount="4" unit="dL" state="warm">Water</ingredient>
<ingredient amount="1" unit="teaspoon">Salt</ingredient>
<instructions>
<step>Mix all ingredients together.</step>
<step>Knead thoroughly.</step>
@mresetar
mresetar / DateDemo.java
Created April 24, 2015 10:36
Prints current system date and time from Java
import java.util.*;
import java.text.*;
/**
* First compile class: c:\java\jdk1.7.0_71\bin\javac.exe DateDemo.java
* Secondly run it with: java -cp . DateDemo
*/
public class DateDemo {
public static void main(String args[]) {
final Date dNow = new Date( );
<link rel="import" href="../core-pages/core-pages.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<polymer-element name="my-element">
<template>
@mresetar
mresetar / batchConvert.bat
Created March 24, 2013 11:16
Batch convert Olympus PL-1 video files to smaller MPEG4 AAC H264 video with Lame 128KB MP3
@echo off
set ffmpeg_dir=e:\portable\ffmpeg\bin
for /F "delims=" %%I in ('"dir /B | findstr -E -I "P[0-9][0-9]*.*\.avi""') do (
%ffmpeg_dir%\ffmpeg.exe -i %%I -c:v libx264 -preset slow -crf 18 -b:a 128k Converted_%%I
)