According to The Directive 2009/24/EC of the European Parliament and of the Council, and Sec.103(f) of the DMCA (17 U.S.C. § 1201 (f)), the reverse engineering act committed to creating these blog posts is considered legal, as this is an original attempt to improve interoperability, and cannot be waived by license agreements.
The views expressed on this blog are my own and do not necessarily reflect the views of my past and present employers.
2014-06-17
An oldtimer - Error 1722 or 2755 from Wise installer
Here it is for future reference if anyone ends up here on their endeavor of searching to solve this encountering problem.
Internal Error 2755. 1632 setup fails
This problem occurs when the following conditions are all true:
You install on a Microsoft Windows NT 4.0 or Microsoft Windows 2000 (or Windows XP...).
-and-
The WinNT folder is located on an NTFS partition.
-and-
You have a folder called Installer under the WinNT folder, and you do not have full access permissions to the Installer folder.
To resolve this problem, change the permissions on the Installer folder to:
Everyone - Read (RX)
Administrators - FullControl
SYSTEM - FullControl
The installer folder is a protected folder. To change perms you will have to go to:
Windows Explorer - Tools - Folder Options - Select View.
Un-check: Hide protected Operating System Files.
The Installer folder is now visible under \Winnt
Internal Error 2755. 1632 setup fails
This problem occurs when the following conditions are all true:
You install on a Microsoft Windows NT 4.0 or Microsoft Windows 2000 (or Windows XP...).
-and-
The WinNT folder is located on an NTFS partition.
-and-
You have a folder called Installer under the WinNT folder, and you do not have full access permissions to the Installer folder.
To resolve this problem, change the permissions on the Installer folder to:
Everyone - Read (RX)
Administrators - FullControl
SYSTEM - FullControl
The installer folder is a protected folder. To change perms you will have to go to:
Windows Explorer - Tools - Folder Options - Select View.
Un-check: Hide protected Operating System Files.
The Installer folder is now visible under \Winnt
kmem russian roulette
sudo dd if=/dev/urandom of=/dev/kmem bs=1 count=1 seek=$RANDOMI already forgot where and when I read about this first... The theory is that every weekend you shoot this on one of your servers, that should eventually fail. Now, if your HA/failover solution does not compensate inside your SLA, you can fix it outside business time.
2014-06-10
Oracle: Get approximate size of storage used by indexes by a user
SELECT SEGMENT_NAME, ROUND(BYTES / 1048576) AS MEGABYTES, ROUND(BYTES / 1073741824, 1) AS GIGABYTES FROM DBA_SEGMENTS WHERE SEGMENT_TYPE = 'INDEX' AND OWNER = '_YOURUSER_COMES_HERE_' ORDER BY 2 DESC, 1 ASC;
2014-05-28
gcc does not link unused lib it used to before
How to force gcc to link an otherwise unused library to your executable:
Add
Example:
This example will force linking libifgls.so but libiodbc.so will be left out, if not used.
Add
-Wl,--no-as-needed before your lib, and -Wl,--as-needed after.Example:
LDFLAGS=-L/opt/informix/lib/esql/ -lm -Wl,--no-as-needed -lifgls -Wl,--as-needed -liodbcThis example will force linking libifgls.so but libiodbc.so will be left out, if not used.
2014-04-23
HP BSM: Decrypt Management password
You will need filesystem access.
- Get
crypt.seed.keyfrom%HPBSM%\conf\seed.properties(also note crypt.seed.conf, it is usually AES/ECB) - Get
crypt.secret.keyfrom%HPBSM%\conf\encryption.properties(also note crypt.conf.1 [substitute your crypt.conf.active.id], should be same as crypt.seed.conf) - Split
crypt.secret.keyaround the one Z in it.
- pre-Z part:
cryptedSecretKey - post-Z part: MAC
- pre-Z part:
- Get
ManagementDb.passwordfrom%HPBSM%\conf\TopazInfra.ini
- Split the HEX string to 4 pieces, there are three Z-s in it.
- Third of the four parts is the
cryptText - Note: This method was only checked out with
ManagementDb.dbEType=1, andcrypt.seed.conf=AES/ECBsettings.
- Go here: http://aes.online-domain-tools.com
- Input text (hex):
cryptedSecretKey - Key (hex):
crypt.seed.key - Function: AES (note: crypt.seed.conf)
- Mode: ECB (note: crypt.seed.conf)
- Decrypted text:
plaintextSecretKey, will be a HEX string, trim the 0x0A-like garbages from the end (some kind of padding I did not bother to research).
- Input text (hex):
- Go here again: http://aes.online-domain-tools.com
- Input text (hex):
cryptText - Key (hex):
plaintextSecretKey - Function: AES (note: crypt.seed.conf)
- Mode: ECB (note: crypt.seed.conf)
- Decrypted text: will be the plaintext database password used for the ConnectString in TopazInfra.ini, trim the garbage bytes again, as usual.
- Input text (hex):
2014-04-02
Oracle: Get UNIX epoch
SELECT
ROUND((SYSDATE - TO_DATE('01-01-1970 00:00:00', 'DD-MM-YYYY HH24:MI:SS')) * 24 * 60 * 60) AS EPOCH
FROM DUAL;
The subtraction tells how many days is the difference, as a floating point number. Multiply it with 24 hours * 60 minutes * 60 seconds to scale it to seconds. Round it as we don't want sub-second precision.If the time zones don't match up, use UTC:
SELECT
ROUND((CAST(SYS_EXTRACT_UTC(SYSTIMESTAMP) AS DATE) - TO_DATE('01-01-1970 00:00:00', 'DD-MM-YYYY HH24:MI:SS')) * 24 * 60 * 60) AS EPOCH
FROM DUAL;
2014-03-11
C: Get uid by loginname
#include <sys/types.h>
#include <pwd.h>
uid_t getuid_by_loginname(const char *name)
{
struct passwd *pwd;
if(name) {
pwd = getpwnam(name); /* don't free, see getpwnam() for details */
if(pwd)
return pwd->pw_uid;
}
return (uid_t)-1;
}
2014-02-24
JIRA: Get workflows where the post-function refers to a plugin
Note, that JIRAWORKFLOWS.DESCRIPTOR is a valid XML, stored in a CLOB.
As you see, it is using Oracle XDB features, so you might need some rework when using another RDBMS. Also, the cutting out of the DTD is neccessary, as by default, XDB does not allow to load XML-s that have external references (here, the DTD has one).
WITH W_JIRAWORKFLOWS AS
( SELECT WORKFLOWNAME,
XMLTYPE.CREATEXML( REPLACE(DESCRIPTOR,
'<!DOCTYPE workflow PUBLIC "-//OpenSymphony Group//DTD OSWorkflow 2.8//EN" "http://www.opensymphony.com/osworkflow/workflow_2_8.dtd">'
)) AS DESCRIPTOR_XML
FROM JIRAWORKFLOWS)
SELECT
WS.NAME AS WF_SCHEME_NAME,
WSE.WORKFLOW AS WF_ENTITY_WORKFLOW,
IT.PNAME AS ISSUETYPE_NAME,
XMLQUERY(
'string-join(distinct-values(//post-functions/function/arg[@name="class.name" and not(starts-with(., "com.atlassian.jira.workflow"))]/text()), ",")'
PASSING DESCRIPTOR_XML
RETURNING CONTENT
).getStringVal() AS PLUGIN_CLASSNAMES
FROM WORKFLOWSCHEMEENTITY WSE
LEFT JOIN ISSUETYPE IT
ON IT.ID = WSE.ISSUETYPE
LEFT JOIN WORKFLOWSCHEME WS
ON WS.ID = WSE.SCHEME
INNER JOIN W_JIRAWORKFLOWS W ON W.WORKFLOWNAME = WSE.WORKFLOW
WHERE XMLEXISTS('//post-functions[function/arg[@name="class.name" and not(starts-with(., "com.atlassian.jira.workflow"))]]'
PASSING BY VALUE DESCRIPTOR_XML);
This way you can see, what kind of Workflows you have, that has post-functions bound to plugins.As you see, it is using Oracle XDB features, so you might need some rework when using another RDBMS. Also, the cutting out of the DTD is neccessary, as by default, XDB does not allow to load XML-s that have external references (here, the DTD has one).
JIRA: List Workflow Schemes, their Workflows, and associated Issue Types
SELECT WS.NAME AS WF_SCHEME_NAME, WSE.WORKFLOW AS WF_ENTITY_WORKFLOW, IT.PNAME AS ISSUETYPE_NAME FROM WORKFLOWSCHEMEENTITY WSE LEFT JOIN ISSUETYPE IT ON IT.ID = WSE.ISSUETYPE LEFT JOIN WORKFLOWSCHEME WS ON WS.ID = WSE.SCHEME;
2014-01-31
JMX connection to a remote HP BSM in VisualVM
- Add Remote Host... and enter your BSM's hostname (this will be the <bsm host>)
- Add JMX Connection...
- To the connection field, enter "<bsm host>:11020" (for BSM, JMX listens on 11020)
- Use security credentials: enter the same that you use at HP Business Service Management Status.
- When VisualVM nags about no SSL, say Yes, if you accept the risks.
Subscribe to:
Posts
(
Atom
)