Extremely Serious

Month: May 2019

Resetting sa password in SQL Server Express

  1. Open the Services application and look for SQL Server (SQLEXPRESS).
  2. Stop the SQL Server (SQLExpress) service.
  3. Right-click the SQL Server (SQLExpress) service and select Properties.
  4. At the Start parameters field type in -m.
  5. Click the Start button.
  6. Close the Services application.
  7. Open a Command Prompt in elevated mode.
  8. Execute the following command:
    osql -S <LOCAL_PC_NAME>\SQLEXPRESS -E

    Note: The <LOCAL_PC_NAME> must be changed appropriately.

  9. At the prompt generated by the previous command invoke the following commands in sequence:
    sp_password NULL,'<NEW_PASSWORD>','sa'

    Note: Change <NEW_PASSWORD> to your desired password.

    go
    quit
  10. Close the  elevated Command Prompt.
  11. Repeat steps 1 to 6, but on step 4 remove -m  from the Start parameters field, if it exists.

Configuring Archiva with MariaDB in Synology Diskstation

  1. Install Tomcat 7 package in Diskstation
  2. Download archiva war file from the following address:
    https://archiva.apache.org/index.cgi
  3. Place the downloaded war file (e.g. apache-archiva-2.2.3.war) into the following directory:
    /volume1/@appstore/Tomcat7/src/webapps/
  4. In MariaDB, add the following user with appropriate password.
    archivauser

    and the following database

    archiva
  5. Download the following jar files:
    mail-1.4.jar 
    mariadb-java-client-1.5.x.jar
  6. Place the download jar files in the following directory:
    /volume1/@appstore/Tomcat7/src/lib
  7. Create archiva.xml file in the following location:
    /volume1/@appstore/Tomcat7/src/conf/Catalina/localhost

    Add the following entries:

    <?xml version="1.0" encoding="UTF-8"?>
    <Context path="/archiva" docBase="/volume1/@appstore/Tomcat7/src/webapps/<ARCHIVA_WAR_FILENAME>">
    <Resource name="jdbc/users" auth="Container" type="javax.sql.DataSource"
    	username="archivauser"
    	password="<PASSWORD_HERE>"
    	driverClassName="org.mariadb.jdbc.Driver"
    	url="jdbc:mariadb://<MARIADB_HOST_IP>:<MARIADB_HOST_PORT
    	/archiva?autoReconnect=true" />
    <Resource name="mail/Session" auth="Container" 	type="javax.mail.Session" mail.smtp.host="localhost"/>
    </Context>

    Note: The <ARCHIVA_WAR_FILENAME>, <PASSWORD_HERE> <MARIADB_HOST_IP> and <MARIADB_HOST_PORT tokens must be replaced by the downloaded war file from step 2, password used from step 4, IP address of MariaDB and port used by MariaDB repectively.

  8. Access archiva using the following address:
    http://<DISKSTATION_HOST_IP>:7070/archiva

    Note: Update the token <DISKSTATION_HOST_IP> with the IP of your Synology Diskstation.