wtorek, grudnia 31, 2013

Ko-ciego roku!

Wilanów

Koszerne jedzenie

Marchew o smaku papryki

Stolica po północy we mgle

niedziela, grudnia 22, 2013

Konfiguracja CRM 2011 przez dbo.ServerSettingsProperties i dbo.DeploymentProperties

ColumnName Value
AcceptInvitationEnabled 1
ActivateNowFlyOutCookieExpireInHours 24
ActiveUserTimeWindowMinutes 60
AddLicensesEnabled 1
AddStorageEnabled 1
AggregationDataExporterDiskSpaceErrorThreshold 500
AggregationDataExporterDiskSpaceWarningThreshold 1000
AggregationDataExporterSqlCommandTimeout 600
AllowDeclarativeWorkflows 0
AllowExternalCode 1
AuthExpirationReminderEnabled 1
AuthExpirationReminderTimeInMinutes 20
BillingCallbackThresholdInMinutes 30
CrmKeyArchivalPollingIntervalInSeconds 43200
CrmKeyGeneratorPollingIntervalInSeconds 60
DbDnsEnabled 0
DifferentialDatabaseBackupIntervalInHours 3
DisableUserInfoClaim 0
EnableTwoDnsRecordsForWebApp 0
ExpireInvitationThresholdInDays 14
ExpireLoginThresholdInMinutes 30
ExpireSignupTokenThresholdInDays 365
FailoverAvailable 0
FileGrowthSize 32
FipsEnabled 0
ForceDirectWebAppDomain 0
ForceDisablePrimarySdk 0
ForceDisableSecondarySdk 0
ForceSecondaryWebAppDomain 0
FullDatabaseBackupExpirationInDays 7
FullDatabaseBackupIntervalInDays 1
GladosThrottleLimit 100
HardLimitBufferSize 5
HardLimitPercentage 150
ImportMaxAllowedFileSizeInMB 8
ImportMaxIISThreadsForUnzip 4
ImportMaxUnzipProcess 50
ImportTimeLimitOnUnzipProcessInSeconds 300
LastAccessTimeCacheFlushMinutes 60
LegacySiteAvailable 0
LicenseIdCountCheckIntervalInMinutes 5
LicenseIdCountHighWaterMark 5000
LicenseIdCountLowWaterMark 2500
LogBackupIntervalInMinutes 10
LongQueryThresholdInSeconds 15
MaxExpandCount 6
MaxNumberOfTaskPerResource 10
MaxReservedNameResetCount 5
MaxResultsPerCollection 50
MaxWaitTimeForAsyncJobsInMinutes 10
MBI_SSL_TimeToLive 24
MetadataCacheSlidingExpirationMinutes 20
MirroringPort -1
MonitoringTimerIntervalInSeconds 300
NFS_2HR_0_COMPACT_TimeToLive 2
NlbEnabled 0
NotificationsPageSize 1000
OrganizationReadyThresholdInHours 6
OrgMirroringEnabled 0
PerformanceAuditEnabled 1
PerformanceDataToKeepInDays 30
PostponeAppFabricRequestsInMinutes 0
PostViaExternalRouter 0
ProvisioningCompletionThresholdInMinutes 30
ProvisioningPollingIntervalInMinutes 1
RequestCompletionAggregationPeriodHours 24
ReservationTimeoutInMinutes 30
ReservedNamesCacheExpiryInMinutes 30
RetrievalUpperLimitWithoutPagingCookie 5000
RouterConnectionLimit 100
SecondaryDnsFailoverUpdateDelayInHours 6
ShowAuthenticationErrors 0
SignInEnabled 1
SignUpEnabled 0
SmtpPort 25
SqlErrorRetryInSeconds 10
StatisticsEnabled 0
StatisticsServiceCacheFlushInterval 4
StatisticsServiceWaitTimeMillis 300000
StorageCalculationEnabled 0
StorageNotificationThresholdPercentage 90
TraceCallStack 1
TraceEnabled 0
TraceFileSize 10
TraceRefresh -1
UpdateWaitingTasksIntervalInSeconds 30
UserInviteEnabled 1
WaitTimeForWebStoreInSeconds 25

ColumnName Value
ActivityFeedFollowLimit 100
AggregateQueryRecordLimit 500
AppUseInProcessSdk 1
AsyncItemsInMemoryHigh 50
AsyncItemsInMemoryLow 20
AsyncJobMaxExecutionTime 60
AsyncJobOrgDatabaseMaintenanceInterval 5
AsyncJobsModuloForNewJobRetrieval 8
AsyncJobsTimerFrequencyMultiplier 2
AsyncJobsToProcessAtOnce 1
AsyncJobsToReturnInSql 10
AsyncJobTimeoutLockedInterval 40
AsyncKeepAliveInterval 60
AsyncMaximumOrganizationConcurrentJobs 2
AsyncMaximumPriority 10
AsyncMaximumRetries 10
AsyncMaximumSelectInterval 60
AsyncMaximumServerConcurrentJobs 5
AsyncMaximumThreadsPercent NULL
AsyncMaximumThreadsPerCPU 5
AsyncMoveToReadyInterval 10
AsyncOverdueCoefficient 2
AsyncPriorityCoefficient 3
AsyncRetryBackoffRate NULL
AsyncScaleGroupDatabaseCleanupInterval 12
AsyncSelectInterval 5
AsyncSelectParallelism 4
AsyncStateStatusUpdateInterval 5
AsyncStateStatusUpdateMaxRetryCount 12
AsyncTimeBetweenRetries 10
AsyncTimeoutLockedInterval 30
AsyncTimeUntilLockExpires 30
AsyncUseInProcessSdk 1
AsyncWaitSubscriptionInterval 1800
AttributeValidationEnabled 1
AutomaticallyInstallDatabaseUpdates 1
AutomaticallyReprovisionLanguagePacks 1
ClaimsEnabled 0
ClaimsSessionSecurityTokenLifetime 24
CustomerUpgradeEnabled 0
DashboardMaximumControlsLimit 6
DumpChartXmlInResponse 0
DupBulkDetectBatchSize 1000
DupMatchcodeLength 1000
DupMatchcodePersistenceInterval 5
DupMaxPublishedRules 5
DupPublishAsyncPollingInterval 100
DupPublishPageSize 250
ETMAsyncCollectInterval 30
ETMEnabled 0
ETMStatisticsUpdateEnabled 0
ETMThrottlingEnabled 0
ExecuteMultipleMaxBatchSize 50
ExecuteMultipleMaxConnectionsPerServer -1
ExecuteMultiplePerOrgMaxConnectionsPerServer -1
IfdInternetAccessEnabled 0
IfdIntranetAccessEnabled 0
ImportBatchSize 1000
ImportBatchTime 1000
ImportContentBufferSize 16384
ImportCountUpdateBatchSize 10
ImportMaxColumnsAllowed 1022
ImportMaxRetryCountForDataTruncation 5
ImportParsedColumnDefaultSize 500
ImportPickListBatchSize 100
IncludeSQLParameterDataInEventLog 1
IsBeta 0
MaintenanceWindowEndTime NULL
MaintenanceWindowStartTime NULL
MapiSyncMaxConnectionsPerServer -1
MapiSyncPerOrgMaxConnectionsPerServer -1
MaxBackgroundSendEmailRequestsPerOrgPerServer -1
MaxBackgroundSendEmailRequestsPerServer -1
MessageProcessorMaximumDepth 4
MessageProcessorMinimumInactiveSeconds 3600
MetadataQueryMaxDepthOfNestedFilters 0
MinFrequencyForGoalRollupJob 24
OfflineSyncMaxConnectionsPerServer -1
OfflineSyncPerOrgMaxConnectionsPerServer -1
OnDemandRollupTimeout 10
OutlookSyncMaxConnectionsPerServer -1
OutlookSyncPerOrgMaxConnectionsPerServer -1
PagingLimit 200
RunAsyncServiceInSafeMode 0
SetMaxBufferPoolSize 1
ShowAuthenticationErrors 1
SolutionsMarketplaceEnabled 1
SqlCommandTimeout 40
SqlConnectTimeout 30
SQMEnabled 0
SystemFilterLimit -1
TotalRecordCountLimit 500
TraceCallStack 1
TraceEnabled 0
TraceFileSize 10
UserFilterLimit -1

czwartek, grudnia 19, 2013

Wielowątkowość MS CRM Web

Po ustawieniu liczby wątków roboczych dla endpointu HTTP > 1 zaczynają pojawiać się błędy typu:

The Sandbox SDK Listener failed to start.
 Source: w3wp.exe (19396)
 Endpoint: net.tcp://localhost/CrmSandboxSdkListener-w3wp
 Error: System.ServiceModel.AddressAlreadyInUseException: The TransportManager failed to listen on the supplied URI using the NetTcpPortSharing service: the URI is already registered with the service.

Wyjaśnienia Microsoftu są dwa:
http://support.microsoft.com/kb/2785590
http://support.microsoft.com/kb/2833575,
jedno przeczące drugiemu. Albo usługa .NET jest wielowątkowa albo nie jest. W praktyce wygląda to tak, że CRM Web nie jest napisane w sposób bezpieczny dla wielu wątków i przy używaniu wielu workerów co jakiś czas jeden z nich przestaje komunikować się z IIS-em i zostaje zabity. Widać to po stronie klienta jako reset połączenia TCP/IP.


środa, grudnia 11, 2013

Nowa Octavia ładna jak klasyczne Audi A6


Call external BW process in mapper

Problem: Consider many records of entity A where enrichment needs process call for every record, decomposition before call and composition after call. This may impose serious performance hit.

Solution: Construct Java Custom Function calling Java Event Starter using LinkedBlockingQueue. Static XPath function pushes container with String argument and another LinkedBlockingQueue for response. Java Event Starter receives container, executes actions using argument and pushes response to container's LinkedBlockingQueue.

BW Smart KeyValue Cache pattern

Problem: Consider entity A with field codeName and A' with fields codeName, name. Between A and A' there is key-value enrichment for codeName-name using dictionary D. Map Data activity for 1000+ A records using D with 1000+ records is very slow due to sequential scan on D.codeName. For-each mapping uses non-indexed access to D.codeName.

Solution: Create Java Custom Function control with functions: addMapping(String container, String key, String value), String getMapping(String container, String key), clearMapping. They will use private final static ConcurrentHashMap<String,ConcurrentHashMap<String,String>> for storing key-value associations.

poniedziałek, grudnia 09, 2013

Apache HTTPClient 4.3 + NTLM

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.HashMap;

import org.apache.http.Header;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.NTCredentials;
import org.apache.http.client.AuthCache;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.client.protocol.HttpClientContext;
import org.apache.http.entity.AbstractHttpEntity;
import org.apache.http.impl.DefaultConnectionReuseStrategy;
import org.apache.http.impl.client.BasicAuthCache;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.DefaultConnectionKeepAliveStrategy;
import org.apache.http.impl.client.DefaultServiceUnavailableRetryStrategy;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.message.BasicHeader;


public class HttpClientWrapper {
 
 private static HttpClientBuilder cb = null;
 
 public final static synchronized void initClientBuilder(int requestTimeout, int retryCount, int retryTimeout) {
  if (cb==null) {
   cb = HttpClientBuilder.create();
   cb.setConnectionReuseStrategy(DefaultConnectionReuseStrategy.INSTANCE); 
   cb.setKeepAliveStrategy(DefaultConnectionKeepAliveStrategy.INSTANCE);
   cb.setServiceUnavailableRetryStrategy(new DefaultServiceUnavailableRetryStrategy(retryCount, retryTimeout)); 
   RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(requestTimeout)
    .setConnectionRequestTimeout(requestTimeout).build();
   cb.setDefaultRequestConfig(requestConfig);
  }
 }
 
 private static HashMap<String,HttpClientContext> contextCache = new HashMap<String, HttpClientContext>();
 private static HashMap<String,CloseableHttpClient> clientCache = new HashMap<String, CloseableHttpClient>();
 
 public static synchronized void setAuthContext(String cookie, String user, String pass, String domain) {
  if (contextCache.get(cookie) == null) {
   CredentialsProvider credsProvider = new BasicCredentialsProvider();
   credsProvider.setCredentials(
       new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT, AuthScope.ANY_REALM, "ntlm"), 
       new NTCredentials(user, pass, "localhost", domain));
 
   AuthCache authCache = new BasicAuthCache();
   HttpClientContext context = HttpClientContext.create();
   context.setCredentialsProvider(credsProvider);
   context.setAuthCache(authCache);
   contextCache.put(cookie, context);
  }
 }
 
 public static synchronized CloseableHttpClient getClient(String cookie) {
  CloseableHttpClient cli = clientCache.get(cookie);
  if (cli==null) {
   cli = cb.build();
   clientCache.put(cookie, cli);
  }
  return cli;
 }
 
 public final static String requestReply(String cookie, String fullUrl, final String verb, String payload, final String payloadType) throws ClientProtocolException, IOException {
  CloseableHttpClient cli = getClient(cookie);
  HttpUriRequest httpRequest = null;
  if ("GET".equalsIgnoreCase(verb)) {
   httpRequest = new HttpGet(fullUrl);
  }
  else {
   HttpPost post = new HttpPost(fullUrl) {
    @Override
    public String getMethod() {     
     return verb;
    }
   };
   if (payload != null) {
    final byte[] content = payload.getBytes("UTF-8");
    post.setEntity(new AbstractHttpEntity() {
     
     @Override
     public void writeTo(OutputStream outputstream) throws IOException {
      outputstream.write(content);      
     }
     
     @Override
     public boolean isStreaming() {
      return false;
     }     
     @Override
     public boolean isRepeatable() {
      return false;
     }     
     @Override
     public long getContentLength() {
      return content.length;
     }
     @Override
     public Header getContentType() {
      return new BasicHeader("Content-Type", payloadType);
     }
     
     @Override
     public InputStream getContent() throws IOException, IllegalStateException {
      return new ByteArrayInputStream(content);
     }
    });    
   }
   httpRequest = post;
  }
  CloseableHttpResponse response = cli.execute(httpRequest, contextCache.get(cookie));
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  response.getEntity().writeTo(baos);
  return baos.toString("UTF-8");
 } 
  
 public final static void main(String[] args) throws Exception, Exception {
 initClientBuilder(60000, 3, 3000);
 setAuthContext("GET", "jan.kowalski", "passw0rd", "ENTERPRISE");
 System.out.println(requestReply("GET",
     "https://crm-test/XRMServices/2011/OrganizationData.svc/AccountSet",
     "GET", null, null)
 );
 }
}

Server certificate 33:65:50:08:79:ad:73:e2:30:b9:e0:1d:0d:7f:ac:91 rejected

Certyfikat Thawte DV SSL CA (36:12:22:96:c5:e3:38:a5:20:a1:d2:5f:4c:d7:09:54) wystawiony jest przez:

E = premium-server@thawte.com
CN = Thawte Premium Server CA
OU = Certification Services Division
O = Thawte Consulting cc
L = Cape Town
S = Western Cape
C = ZA

A ten z kolei przez:

CN = thawte Primary Root CA
OU = (c) 2006 thawte, Inc. - For authorized use only
OU = Certification Services Division
O = thawte, Inc.
C = US

Ten drugi jest w dwóch wersjach z tym samym DN ale o różnych numerach seryjnych:
34:4e:d5:57:20:d5:ed:ec:49:f4:2f:ce:37:db:2b:6d (self signed) i 33:65:50:08:79:ad:73:e2:30:b9:e0:1d:0d:7f:ac:91 (podpisany przez Thawte Premium Server CA).
Pierwsza wersja jest w zaufanych certyfikatach Windows, druga nie. Jakim cudem komunikacja SSL w Windows się waliduje względem złego certyfikatu nadrzędnego? Nie powinna. Tymczasem w Javie słusznie nie działa i trzeba zaimportować prawidłowy certyfikat.


Kernel 3.8.13 od Oracle-a dla RHEL 6.5

http://public-yum.oracle.com/public-yum-ol6.repo
http://public-yum.oracle.com/repo/OracleLinux/OL6/UEKR3/latest/x86_64/

Btrfs send-receive wreszcie dostępne.

Ubuntu 13.10 sleep vs hibernation

vi /etc/pm/config.d/00-use-suspend-hybrid
--Insert--
if [ "$METHOD" = "suspend" ]; then
    METHOD="hibernate"
fi
HIBERNATE_MODE=suspend
SLEEP_MODULE=uswsusp
PM_HIBERNATE_DELAY=210
HIBERNATE_RESUME_POST_VIDEO=yes

vi /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
--Edit--
[Re-enable hibernate by default]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes


niedziela, grudnia 08, 2013

V jak Vendetta

Bardzo ładny film.

Dlaczego nie giniesz?
Bo za mną stoi idea, a idee są kuloodporne.

Jak działa kryzys

Zmniejszenie obrotów, pogorszenie płynności finansowej, a przez to zmniejszenie dostępności towarów i tak cyklicznie w dół. Dlatego ważne jest bieżące prowadzenie raportów i odpowiednie reagowanie. Jednak niektóre przedsięwzięcia daje się uratować.

W okresie największej świetności warszawski oddział Znaku mieścił się na Poznańskiej :) a kolejki na parterze były tak duże że trzeba było otworzyć dla klientów pierwsze piętro.

Pewna duża firma telekomunikacyjna zakupiła od małej wyświetlacze LED. Wyświetlacze z jednowątkowym stosem TCP/IP miały być zintegrowane z systemem SAP WM za pomocą telnetu i używane do kontrolowania wydań z magazynu. Niestety sprzęt sieciowy Cisco nie radził sobie z urządzeniami i wyłączał port (nie działała autonegocjacja 10/100 Mbps). Wyświetlacze zostały podłączone przez switch Edimax kupiony w Znaku i tak uratowano projekt.