SonarQube 6.7 Community with Postgres 9.6 in Docker on Ubuntu

This is a very quick install for SonarQube on Ubuntu 18.04 LTS. I presume you got the latest Docker CE 18.09 and docker-compose 1.24 installed.

# create folders for sonarqube files and postgres
sudo mkdir -p /var/sonarqube/{conf,data,logs,extensions}
sudo chown -R 999:999 /var/sonarqube
sudo mkdir -p /var/sonarqube/postgres
# make folder for all Docker files in home
mkdir ~/sonarqube
cd sonarqube
# create docker-compose.yml with following content
version: '3.1'
services:
  db:
    image: postgres:9.6-alpine
    restart: unless-stopped
    volumes:
      - /var/sonarqube/postgres:/var/lib/postgresql/data
    environment:
     - POSTGRES_USER=sonar
     - POSTGRES_PASSWORD=sonar

  sonarqube:
    image: sonarqube:6.7-community
    ports:
      - 9000:9000
      - 9092:9092
    restart: unless-stopped
    volumes:
      - /var/sonarqube/conf:/opt/sonarqube/conf
      - /var/sonarqube/data:/opt/sonarqube/data
      - /var/sonarqube/logs:/opt/sonarqube/logs
      - /var/sonarqube/extensions:/opt/sonarqube/extensions
    environment:
      - SONARQUBE_HOME=/opt/sonarqube
      - SONARQUBE_JDBC_USERNAME=sonar
      - SONARQUBE_JDBC_PASSWORD=sonar
      - SONARQUBE_JDBC_URL=jdbc:postgresql://db/sonar
# launch 
docker-compose up -d

You can then access your SonarQube instance on http://<ServerIP>:9000 with the credential admin/admin.

 

Migrate SonarQube from MySQL to PostgreSQL

For checking the quality of my private programming code, I have been using the free edition of SonarQube for multiple years. It is actually a cool project with a massive flaw: They did allow to use MySQL as Database - but not MariaDB. This struggle kept me a bit at bay, as I parted with MySQL years ago - with this one exception.

Some days ago I then stumbled upon the anouncement of SonarQube that did not fix this long-standing issue, but will be parting completly from MySQL. So the only choice would be to migrate to Oracle, MS SQL or PostgreSQL.

They even provided a tool called mysql-migrator for this purpose. However, this did not work. It always kept on complaining that it could not detect the schema version, etc.

Long story short: If you want (or in my case must...) switch from MySQL to PostgreSQL, use pgloader, which is available as Ubuntu package - all infos here.

I just installed a fresh PostgreSQL 9.6 in Docker, bundeled it with the postgres 9.6 alpine, fired it up and then migrated it with the following command:

pgloader mysql://<mysqluser>:<mysqlpassword>@<mysqlserverip>:3306/sonar pgsql://<psqluser>:<psqlpassword>@1<psqlserverip>/sonar

Due to all things Docker, one had to play a bit around with the correct IPs, Ports and permissions to get the tool working, but once that was said and done, everything worked fine:

                    table name       read   imported     errors      total time
------------------------------  ---------  ---------  ---------  --------------
               fetch meta data        180        180          0          0.357s
                Create Schemas          0          0          0          0.001s
              Create SQL Types          0          0          0          0.004s
                 Create tables        106        106          0          2.842s
                Set Table OIDs         53         53          0          0.015s
------------------------------  ---------  ---------  ---------  --------------
            sonar.active_rules       1993       1993          0          0.116s
  sonar.active_rule_parameters        268        268          0          0.107s
             sonar.ce_activity          1          1          0          0.074s
      sonar.ce_scanner_context          0          0          0          0.040s
           sonar.ce_task_input          0          0          0          0.025s
     sonar.analysis_properties          0          0          0          0.157s
      sonar.duplications_index          0          0          0          0.020s
                  sonar.events        349        349          0          0.173s
                  sonar.groups          2          2          0          0.330s
             sonar.group_roles         12         12          0          0.433s
                sonar.ce_queue          0          0          0          0.033s
                  sonar.issues       7508       7508          0          1.546s
 sonar.ce_task_characteristics          0          0          0          0.029s
       sonar.default_qprofiles          9          9          0          0.162s
                sonar.es_queue          0          0          0          0.143s
            sonar.file_sources        500        500          0          1.733s
        sonar.loaded_templates         13         13          0          1.498s
                 sonar.metrics        246        246          0          1.564s
           sonar.organizations          1          1          0          1.744s
           sonar.org_qprofiles         26         26          0          1.722s
   sonar.perm_templates_groups          4          4          0          1.724s
            sonar.groups_users          3          3          0          1.283s
sonar.perm_tpl_characteristics          0          0          0          1.673s
                sonar.projects        542        542          0          1.850s
     sonar.internal_properties          2          2          0          1.384s
           sonar.issue_changes        501        501          0          1.522s
         sonar.manual_measures          0          0          0          1.306s
           sonar.notifications          0          0          0          1.297s
    sonar.organization_members          2          2          0          1.504s
           sonar.project_links          0          0          0          1.532s
    sonar.permission_templates          1          1          0          1.453s
       sonar.project_qprofiles          0          0          0          1.483s
    sonar.perm_templates_users          0          0          0          1.417s
        sonar.qprofile_changes       2001       2001          0          1.616s
                 sonar.plugins         13         13          0          1.366s
     sonar.qprofile_edit_users          0          0          0          1.545s
        sonar.project_branches          3          3          0          1.356s
 sonar.quality_gate_conditions          4          4          0          1.353s
          sonar.rules_metadata       1763       1763          0          1.311s
        sonar.project_measures      35940      35940          0          1.792s
          sonar.rules_profiles         26         26          0          1.503s
       sonar.schema_migrations        495        495          0          1.369s
                   sonar.users          3          3          0          1.497s
             sonar.user_tokens          5          5          0          1.489s
              sonar.properties          8          8          0          0.941s
    sonar.qprofile_edit_groups          0          0          0          0.924s
           sonar.quality_gates          1          1          0          0.834s
                   sonar.rules       1866       1866          0          1.069s
        sonar.rules_parameters        278        278          0          1.021s
       sonar.rule_repositories         21         21          0          0.999s
               sonar.snapshots        280        280          0          1.047s
              sonar.user_roles          0          0          0          0.960s
      sonar.webhook_deliveries          0          0          0          0.942s
------------------------------  ---------  ---------  ---------  --------------
       COPY Threads Completion          4          4          0          3.049s
                Create Indexes        127        127          0         22.308s
        Index Build Completion        127        127          0          1.460s
               Reset Sequences         33         33          0          0.051s
                  Primary Keys         51         51          0          0.051s
           Create Foreign Keys          0          0          0          0.000s
               Create Triggers          0          0          0          0.001s
              Install Comments          0          0          0          0.000s
------------------------------  ---------  ---------  ---------  --------------
             Total import time      54690      54690          0          8.412s

 

Windows 10 Change Wifi / WLAN Network Priority

1.) Open cmd.exe
2.) netsh wlan show profiles
The wifi profile names will be shown in the current priority order under the section "User profiles". Its important to note, that the section starts with "Profiles on interface INTERFACE", where INTERFACE is the interfacename. If you got multiple wifi interfaces, that section will reoccur with its own "User profiles" and priority list.
3.) To change the priority of one network, enter:
netsh wlan set profileorder name="WIFIPROFILE" interface="I" priority=NUMBER
You need to give the correct wifi name as WIFIPROFILE, the interface which uses said profile as I and the NUMBER for the priority, with 1 being the highest, i.e. should be used prefered. You can also define priorities lesser than 1.

Source

Windows 10 Update Error 0x80070001

I had two Windows 10 machines which had stopped pulling upgrades from Microsoft for quite long (1703, anyone?) and I could not get it back working.
Windows Update just showed me the error 0x80070001 and did refuse to do anything.

Tried:
- Clearing Windows Update Cache
- WSUS Offline Patching (installed the updates, but the normal Windows Update did not start working after that...)
- Windows Update Repair Tool from Microsoft

Nothing did really work, until I stumbled upon a post by OksiQuatzel:
Culprit was the installed ImDisk, a virtual Floppy Drive. With this installed and an A Drive mounted - this error arose.
As soon as I unmounted the drive and removed the driver - everything started working again.
Kind of nuts that something like this could occur.

Actually I tried it with ImDisk, Virtual Floppy Drive 2.1 and other Virtual Floppy Drives and RAMdisk drives - there is a high chance that - if you use such a program, the Windows 10 Update does cease function...

Source in german

BeagleLogic

To get your Beaglebone Black (BBB) to work as an Logic Analyzer, you can use BeagleLogic:

1.) Download latest version of BeagleLogic
from: https://beaglelogic.readthedocs.io/en/latest/beaglelogic_system_image.html
Released on 2017-07-13, sha256sum = be67e3b8a21c054cd6dcae7c50e9e518492d5d1ddaa83619878afeffe59c99bd
https://goo.gl/RiXGBs

2.) Burn it onto sdcard with Etcher

3.) Put SDCard into BeagleBone Black

4.) Hold "Boot" Button, plug in BBB with Mini USB Cable to your PC

5.) After 10 seconds or so, release "Boot" Button (this will just boot from SDcard with this trick)

6.) Wait some time and login to 192.168.7.2 via SSH
Username: debian
password: temppwd

7.) Test if BeagleLogic works
ls -l /dev/beaglelogic
There should be entry /dev/beaglelogic as answer, if not check the BeagleLogic Website

8.) Change uEnv.txt
sudo vi /boot/uEnv.txt
#go to following lines:
##enable Generic eMMC Flasher:
##make sure, these tools are installed: dosfstools rsync
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

remove # from #cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

#save and exit

9.) Shutdown
sudo shutdown now

10.) Boot again, this time with flasher
Hold "Boot" Button, plug in BBB with Mini USB Cable to your PC, after 10 seconds, release the button.
During the flash process of the eMMC, the 4 leds will make a "Knight Rider" like lightshow.
This will take some minutes. The BBB will shutdown afterwards (all LEDs off).

11.) Remove SDCard, replug Mini USB and boot without holding any buttons

12.) Wait some time and login to 192.168.7.2 via SSH
Username: debian
password: temppwd

13.) Open your webbrowser and go to: http://192.168.7.2:4000/#

Next:
- Upgrade
- this enables you to also use the BeagleLogic as "external analyzer" and control it from i.e. a Window System running a special version of pulseview 🙂
- More infos: https://goo.gl/L9QUrt
Connect to Ethernet / Internet
cd /opt/BeagleLogic/
git config http.sslVerify false
git pull
sudo apt update
sudo ./install.sh --upgrade
sudo reboot now

Useful infos:
https://beagleboard.org/getting-started#update
http://beagleboard.org/latest-images
https://beaglelogic.readthedocs.io/en/latest/beaglelogic_system_image.html
https://beaglelogic.readthedocs.io/en/latest/install.html

Cannot start Virtual Machine on ESXi 6.5

As described by JC-LAN, I had a lot of trouble with one particular "special" VMDK on a ESXi 6.5 system, which did not start after a reboot of the ESXi host.

The power-on failed with "File system specific implementation of LookupAndOpen[...] failed" - however in the end it just gave me the overall error that it failed to start the machine. As it turned out, the VMDK was corrupted.

1.) Enable SSH on the ESXi host with the corrupted VMDK - and login

2.) Check the main VMDK (not with the name -s####.vmdk, the main file!) with

vmkfstools -x check /absolute/path/vm.vmdk

3.) It will probably report that the fail is defective. Repair with

vmkfstools -x repair /absolute/path/vm.vmdk

4.) Now you can try to start the VM again, helped me already 3 times 🙂

Taken from: https://jc-lan.tk/2017/02/01/esxi-6-5-host-crash-then-guest-fails-to-power-on/