Monday, July 04, 2016

allowing a url

netsh http add urlacl url= http://+:51915/Server.wcfService/ user=domian\username

Sunday, June 26, 2016

win 10 november update langsam / slow

build 10240 läuft auf meinem lenovo thinkstation mit core i5 recht flott, build 10586 extrem langsam - besonders visual studio

Tuesday, June 21, 2016

windows build nummer

HKCU\Control Panel\Desktop den DWORD-Wert (32-Bit) mit dem Namen PaintDesktopVersion hinzufügen und auf 1


https://windowsblog.at/2015/07/31/howto-build-nummer-wieder-am-desktop-anzeigen/

Saturday, June 11, 2016

raspberry pi 3 windows 10 iot

windows iot download mit windows iot dashboard installieren (rasperry pi3: insider preview, custom)

ipadresse:8080 webinerface

powershell admin:
start-service winrm
set-item wsman:\localhost\client\trustedhosts -value * -force
enter-pssession -ComputerName 169.254.63.249 -Credential "169.254.63.249\Administrator"

https://www.hackster.io/
Remote "Desktop":
Windows Iot Remote Clint Universal App Insallieren, im Webinterface am Raspi links unten Remote aktivieren



Monday, May 30, 2016

citadel



list usb devices:
sudo lsusb

list devices
sudo blkid

list partitions:
sudo fdsik -l

list disks by ...:
ls -al /dev/disk/by-uuid/
ls /dev/disk/by-label/

ls /dev/sd*




apt-get install:
ntfs-3g
exfat
hdparm


list power mode of hd:
sudo hdparm -C /dev/sda

dmesg

raspberry pi fernzugriff mittels VNC

vnc server:

sudo apt-get update
sudo apt-get install x11vnc
x11vnc -usepw -forever -rfbport 12345 -display :0

startet server mit port 12345

Saturday, May 14, 2016

W10: UWP Packages auf Windows 10 Handy (Mobile) laden deployen

Visual Studio:
rechte Maustaste auf App, Store, Create Package (No Store)


Handy:
Wlan ein
Einstellungen / Update und Sicherheit / Für Entwickler / Entwicklermodus,
Gerätesuche ein
Geräteportal ein
unter Geräteportal steht Verbindung herstellen über:
WiFi
https://x.y.z.a (IpAdresse)

mit Browser auf Handy Ip (steht unter Geräteportal siehe oben) verbinden und koppeln - wichtig: Handy und PC müssen im selben Subnetz sein

in App Manager App Uploaden: ....AppxBundle

Friday, May 13, 2016

rasperry pi

LED am GPIO Pin 12 ein und ausschalten:

import Rpi.GPIO as IO
import time
OI.setmode(IO.BOARD)
IO.setp(12,IO.OUT)
state=True
while True:
  IO.output(12,state)
  state= not state
  time.sleep(1)


falls GPIO nicht vorhanden, mit apt-get installieren


Temperatursensor 
Dallas-18820 
1607C4+23AA

Wednesday, May 04, 2016

oracle can connect with sqlplus but not with sql developper / kann mit sqlplus verbinden aber nicht mit sqldeveloper

sqlplus braucht für Verbindungen zum lokalen host unter Angabe der Sid scheinbar keinen listener:
sqlplus user/pwd@sid

für tns jedoch schon:

splplus user/pwd@tnsName

SQL developper braucht auch einen listener zum verbidnen, wenn also sqlplus funktioniert, dann ist wahrscheinlihc der listener falsch konfiguriert (Hostanem ...)

Thursday, April 28, 2016

oracle tablespace verkleinern / resize smaller


get minimum size of files / minimalgroesse der Datei:
select f.file_name, (t.block_size*max(e.block_id)/1024/1024) MB
from dba_tablespaces t, dba_data_files f, dba_extents e
where e.tablespace_name = 'SYSAUX'
and   e.tablespace_name = f.tablespace_name
and e.tablespace_name = t.tablespace_name
group by f.file_name, t.block_size;


alter database datafile '' resize  ;

durch reorganisieren des frgamentierten Files kann die minimalgroesse herabgesetzt werden - the minimal size can be reduced by reorganicing the fragmented tablespace:

  1. get objects at end of file (first rows):
    set pagesize 3000
    set linesize 3000
    select e.file_id, max(e.block_id),
    e.owner, e.segment_name, segment_type, partition_name
    from dba_extents e
    where e.tablespace_name = 'SYSAUX'
    group by e.file_id, e.owner, e.segment_name, segment_type, partition_name
    order by 1 desc , 2 desc;
  2. reorganize object blocking end of file:
    alter table owner.tablename move;
    alter Index rebuild;
     
  3. get minimum size of file shrink:
    select f.file_name, (t.block_size*max(e.block_id)/1024/1024) MB
    from dba_tablespaces t, dba_data_files f, dba_extents e
    where e.tablespace_name = 'SYSAUX'
    and e.tablespace_name = f.tablespace_name
    and e.tablespace_name = t.tablespace_name
    group by f.file_name, t.block_size;
  4. shrink file:
    alter database datafile 'C:\ORA_DAT\myfile.DBF' resize 4500M;

Thursday, April 14, 2016

Entity Framework AddOrUpdate

funktioniert gut, solange das Objekt nicht im lokjalen Speicher vorhanden ist - dann macht die Methode nämlich gar nichts

https://blog.oneunicorn.com/2012/05/03/the-key-to-addorupdate/

Außerdem ist es möglich, dass die DbSet Listen Einträge mit doppeltem Key enthalten - der wird dann erst beim Schreiben in die Datenbank geprüft und man erhält dann eine Key Violation. Daher besser zunächst zu suchen und dann zu adden.

Saturday, April 02, 2016

ssl zertifikat erstellen und iis https (ssl) einrichten

1) SLL Zertifikat erwerben und installieren am IIS:

1a) Zertifikats Anforderung erstellen:

Im IIS unter server \ serverzertifikate mit rechter Maustasete eine Zertifikatsanforderung erstellen und speichern => man erhält ein Textfile das in etwa so aussieht:
oder auf bestehendes Zertifikat renew klicken

-----BEGIN NEW CERTIFICATE REQUEST-----
blablabla
-----END NEW CERTIFICATE REQUEST-----

1b) Zertifikat von Zertifizierungsstelle austellen lassen:

diesen Text dann in die Zwischen ablage kopieren und beim Zertifikatsanbieter einfügen.
kostenlose Webzertifikate gibt z.b. startssl.com - allerdings seit ende 2016 werden diese von vielen Browsern nicht mehr als sicher erachtet.

1) email adresse angeben => erhalte code, mit diesem wird dann ein zertifiakt ausgestellet, das man in den Webbrowser importieren muß (neu starten des Webbrowsers) dann wieder startssl.com ansurfen, einloggen
2) hostname validieren
3) zertifikat erstellen mittels wizard => zip file enthält iis.zip, dieses enthält ein CRT File

sslmarket.at
1) konto erstellen
2) zertifikat beantragen => brauche Emailadresse für die ssl domain


1c) Zertifikat importieren in IIS:

Intermediate Zert sollte vorher in die Zwischenzertifizierungsstellen importiert werden (Zert Manager)

das File von der Zertifizierungsstelle dann im IIS unter server\serverzertifikate mit rechter Maustaset Zertifikatsanforderung abschließen importieren (*.* bei txt auswählen)
bei Problemen zunächst als Perönliches Certt abschließen, exportieren (pfx), löschen und neu importieren als Webhosting

2) Webinhalt für https freigeben

2a) Website ssl Bindung hinzufügen

Website auswählen, bei Bindungen https hinzufügen und zuvor importiertes Zertifikat auswählen, es sollten dann z.b.  eine Bindung für Port 80 und eine für 443 existieren,

2b) Firewall Port 443 freigeben

2c) Web Servicekonfigurieren

http://blog.adnanmasood.com/2008/07/16/https-with-basichttpbinding-note-to-self/

The modified basicHttpBindinging to allow security mode = Transport
<bindings>
            <basicHttpBinding>
                <binding name="defaultBasicHttpBinding">
                    <security mode="Transport">                        <transport clientCredentialType="None"/>
                    </security>
                </binding>
            </basicHttpBinding>
        </bindings>
        <services>
            <service behaviorConfiguration="MyServiceBehavior"
            name="MyServiceName">   
                <endpoint address="https://AdnanMasood.com/MyService.svc"
                            binding="basicHttpBinding"
                            bindingConfiguration="defaultBasicHttpBinding"
                            contract="Axis.IServiceContract" />
            <serviceBehaviors>           
                <behavior name="MyServiceBehavior">
                    <serviceMetadata httpsGetEnabled="true"/>
                    <serviceDebug includeExceptionDetailInFaults="false"/>
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <add key="CustomIISServiceHostEndPoint" value=https://AdnanMasood.com/MyService.svc"/>
    </appSettings>

which corresponds to your end point.
<system.serviceModel>        
and the httpsGetEnabled
<behaviors>
and last but not least, if hosting in IIS, here is the key for custom factory. Details about how to do this part can be found on the MSDN article "Deploying an Internet Information Services-Hosted WCF Service" referenced below.
    <appSettings>        




Tuesday, March 29, 2016

The relationship between the two objects cannot be defined because they are attached to different ObjectContext objects.

When using more then one Context, Objects have to be detached before added to another one

Saturday, March 26, 2016

Adding Wcf Service Logging

you don't need to change your source code just add to your service web.config:

<system.diagnostics>
<sources>
<source name="System.ServiceModel"
                    switchValue="Information, ActivityTracing"
                    propagateActivity="true">
<listeners>
<add name="traceListener"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData= "C:\Log\wcf.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>

Friday, March 25, 2016

visual studio or iis: HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory.

HTTP Error 403.14 - Forbidden

The Web server is configured to not list the contents of this directory.


solution: add  <directoryBrowse enabled="true" /> for root path:



  <location path=".">
    <system.webServer>
      <directoryBrowse enabled="true" />
    </system.webServer>
  </location>

Tuesday, March 22, 2016

Disk / Drive / Partition Image software

Norton Ghost:
takes long to install, installer often opens command prompt and interrupts you, complicated gui, can' t read Linux partitions

DriveImageXML: can`t read Linux partitions

Acronis2016: can read Linux partitions, very comfortable gui, but I tried to use test version to make backup didn't work

Partition Image: is a dos tool, doesn't work under windows 10 (first attemp, no time for second try)

compare andronoid - windows 10 phone

I had a Samsung S3 neo and switched to Lumia 640.

summary: windows phone 10 has fewer apps than andronoid, but those apps are more stable and faster than andronoid

Writing is faster and reliabler on Windows 10 phone than on the andronoid system.

Navigation: on Lumia there is the here navigation installed, which has offline maps and speed warning, but I didn't find the traffic jam visualisation like google maps.

Energy: the Lumia Akku endures longer then the Samsung, I think windows phone 10 is more power saving

Thursday, March 10, 2016

Continous Integration Build with visualstudio online: No queue was specified in the build request.

if you get error        
No queue was specified in the build request.
set
General Tab -> Default agent queue = Hosted


to set up new CI build:
Go to Build Menu of your project
create new Build definition by pressing +
General Tab -> Default agent queue = Hosted

Wednesday, February 10, 2016

Update Wpf StatusLabel from other thread - Status Label auf richtigem Thread updaten

        ///


updates StatusLabel on Gui Thread
        /// StatusText to set
        private void UpdateStatus(string sStatus)
        {
            Trace.WriteLine(sStatus);
            if (!LblStatus.CheckAccess()) //Check if correct Thread
            {
                LblStatus.Dispatcher.BeginInvoke(DispatcherPriority.Send, //Wrong Thread
                    new Action(UpdateStatus), sStatus); //start again on correct thread
                return; //and leave
            }
            LblStatus.Content = sStatus; //only on correct thread the label is set
        }



call like this:
1) start longrunning Task:

Task.Factory.StartNew(MyLong,TaskCreationOptions.LongRunning);


2) call Update Status from Longrunning Task
        private void MyLong()       
{
            UpdateStatus("do some Long time ...");       

}