20 March 2021

Backup and sync Google Drive

Using "Backup and sync Google Drive" on a computer with multiple users

  • Backup and sync Google Drive is a client program for Windows 10 that enables you to see your Google Drive in Windows Explorer.
  • I encountered a problem when I wanted to install this program when I was logged in as a second user on that PC: It did not work.
  • The solution was NOT to install backup and sync a second time, but to configure backup and sync as the second user
    • So to enable backup and sync logged in as the extra user:
      • Login as the extra user
      • Start "Backup and sync Google Drive"
      • Enter the credentials for Google Drive  for this extra user
      • Follow the instructions on screen
      • Be patient while the client downloads / uploads your files
    • In Windows Explorer you can see Google Drive in your Favorites

Link to download Backup and sync Google Drive on Windows 10:
Choose Individuals
Scroll down to "For Individuals" > Backup and Sync > Download




Lesson learned:

Only install  Backup and sync Google Drive once on a computer
but configure the program logged in as a second, third, fourth ... user on a Windows 10 PC

Remove system folders from external disk

Delete system folders on external disk using Windows 10

 Problem

  • I got a hard disk from a broken portable and wanted to use that disk as an external disk to put my backups on
  • Lot's of space was used by system folders on that disk e.g. Windows, Progam Files, Users ...
  • I wanted to free up space on that external disk, but it was not so easy to delete these system folders

Solution


To delete the system folders on the external disk, I used the following procedure:

  • Take ownership of these system folders

    • In Windows Explorer > Select the folder you want to delete on the external disk e.g. D:\Windows
    • Press Alt+Enter to view the Properties of the folder
    • [Security] > [Advanced]
    • Owner: specify the user with administrative permissions on your computer e.d. Administratror
      [x] Replace owner on sub containers and objects
      [OK]
      [OK]

  • Add the Administrator to the "Name of Groups of Users"
      • In Windows Explorer > Select the folder you want to delete on the external disk e.g. D:\Windows
      • Press Alt+Enter to view the Properties of the folder
      • [Security]
      • [Edit]
      • [Add] > Administrator
      • [x] Full Control
      • [OK[
      • [OK]

    • Inheritance -> Convert to explicit privileges

      • In Windows Explorer > Select the folder you want to delete on the external disk e.g. D:\Windows
      • Press Alt+Enter to view the Properties of the folder
      • [Security] > [Advanced]
      • [Change privileges]
      • [x] Replace privliges on sub objects ...
      • [Enable inheritance]
      • [Convert inhertited priviliges for this object into explicit privileges]
      • [OK]
      • Continue? [Yes]
      • [OK]
    Now you can delete the folder from the external disk

    24 January 2021

    Download all your photos from Google photos with a raspberry pi

    How to download all your photos from Google Photos on your raspberry pi using the command line

    • Export your photos via Google TakeOut
      • Surf to Google Takeout
      • Create an export (Seach for photos on this webpage and select only this row)
      • Export to tgz format size 50GB so you will have one large file with all your photos
      • It will take a while before Google sends you a mail with the download link
      • Start the download ..

    To use a raspberry pi to download the tgz file containing all your Google photos:

    • Get the download URL:
      • Start the download in a browser on a (windows) PC
      • Via right mouse click on the file being downloaded, you can copy the download URL
      • You can now cancel the download in the browser on your PC and
        launch the download on your raspberry pi using wget
    • Download the tgz file
      • On the raspberry pi, use wget to download the URL
        e.g.  
        nohup wget -b -o GoogleTakeout.log -O GoogleTakeout.tgz "https://00f74ba.....-apidata.googleusercontent.com/download/storage/v1/b/takeout-eu/o/.......XivE&isca=1"
      • Depending on how large the tgz file is, it can take a  long time to download ....
        The download speed is (at home with a 50Mbps download linkspeed) : around 3.3MB/s = 12GB/hour
      • Check if download is working:
        ls -l GoogleTakout.tgz
        la -lh GoogleTakeout.tgz
        tail -f GoogleTakeout.log
        jobs
        ps -ef|grep wget
    Tips (Copied from shell - Difference between nohup, disown and & - Unix & Linux Stack Exchange (thanks for the clear explication))

    • & puts the job in the background, that is, makes it block on attempting to read input, and makes the shell not wait for its completion.
    • disown removes the process from the shell's job control, but it still leaves it connected to the terminal. One of the results is that the shell won't send it a SIGHUP. Obviously, it can only be applied to background jobs, because you cannot enter it when a foreground job is running.
    • nohup disconnects the process from the terminal, redirects its output to nohup.out and shields it from SIGHUP. One of the effects (the naming one) is that the process won't receive any sent SIGHUP. It is completely independent from job control and could in principle be used also for foreground jobs (although that's not very useful).


    21 October 2020

    AWS Lightsail ssh web trouble - ubuntu

    After upgrading Ubuntu 18.04 LTS to 20.04 LTS ssh via web is broken.

    ssh via putty still worked.

    I have found the solution here:

    https://help.okta.com/en/prod/Content/Topics/Adv_Server_Access/docs/sftd-ubuntu.htm

    For servers running Ubuntu 20.04, you have to allow certificate authorities (CAs) to use the ssh-rsa algorithm to sign certificates. To do this, add the following line to your OpenSSH daemon file (which is either /etc/ssh/sshd_config or a drop-in file under /etc/ssh/sshd_config.d/)

    To fix it, add following 2 lines to /etc/ssh/sshd_config

    TrustedUserCAKeys /etc/ssh/xxxxxxx 
    CASignatureAlgorithms +ssh-rsa

    Replace xxxxxxx by the public key you can find in /etc/ssh

    The public key file is probably called lightsail_instance_ca.pub

    Restart sshd service after changing the sshd_config file:

    sudo service sshd stop
    sudo service sshd start

    OR

    sudo service sshd restart

    Tip: To find the non-comment lines in sshd_config:

    grep '^[[:blank:]]*[^[:blank:]#;]' /etc/ssh/sshd_config

    Include /etc/ssh/sshd_config.d/*.conf
    PasswordAuthentication no
    ChallengeResponseAuthentication no
    UsePAM yes
    X11Forwarding yes
    PrintMotd no
    TCPKeepAlive yes
    ClientAliveInterval 30
    AcceptEnv LANG LC_*
    Subsystemsftp/usr/lib/openssh/sftp-server
    TrustedUserCAKeys /etc/ssh/xxxxxxx
    CASignatureAlgorithms +ssh-rsa

    02 October 2020

    WSL Debian

     Install Windows subsystem linux on Windows 10


    step 1: 

      install Debian Linux subsystem:

        - PowerShell as administrator: "Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux" | go to "turn windows future on or off"

        - Microsoft Store: install "Debian"


    step 2: 

      install mate tesktop on Debian:

        - open Debian

        - sudo apt-get update

        - sudo apt install task-mate-desktop


    OR

      install mate desktop on Ubuntu:

        - open ubuntu console

        - sudo apt install tasksel

        - sudo apt update

        - sudo tasksel install ubuntu-mate-desktop

        

    step 3: 

      install VcXsrv in windows 10:

        - download from: https://sourceforge.net/projects/vcxsrv/

          - about X server: https://en.wikipedia.org/wiki/X_Windo...

        - open XLauch

          - select: "One large window"

          - Display number: 0

          - next

          - Start no client

          - next 

          - finish


    step 4: 

      setup display: 

        - export DISPLAY=:0

        - export LIBGL_ALWAYS_INDIRECT=1


    step 5: 

      start Mate-desktop environment: 

        - mate-session

    26 December 2019

    Enter bios

    Enter BIOS


    On some computers it is difficult to change the bios settings.
    Most  computers use one of the following keys to enter the bios
    • ESC
    • Del
    • F1
    • F2
    • F10
    • F9
    • Ctrl+Esc F1 (Toshiba)
    If none of the above keys help, try to enter shutdown /s /t 0 to  shutdown the computer. After the shutdown has compled, press the power on button and press one of the key combinations above.

    Good luck !

    11 January 2019

    Update Gitlab on CentOS

    Updating CentOS and gitlab is normally as simple as:


    • yum check-update
    • yum update
    The problem was that we postponed the updates too long and created a version lag for gitlab.

    The installed gitlab-ce version was 10.6 and we had to update to version 11.6.3.
    We got the message we had to do an intermediate update to 10.8 prior to updating to 11.6.3.


    gitlab preinstall: It seems you are upgrading from 10.x version series
    gitlab preinstall: to 11.x series. It is recommended to upgrade
    gitlab preinstall: to the last minor version in a major version series first before
    gitlab preinstall: jumping to the next major version.
    gitlab preinstall: Please follow the upgrade documentation at 
    https://docs.gitlab.com/ee/policy/maintenance.html#upgrade-recommendations
    gitlab preinstall: and upgrade to 10.8 first.
    Failed:
      gitlab-ce.x86_64 0:10.6.2-ce.0.el7     gitlab-ce.x86_64 0:11.4.5-ce.0.el7
    The following steps succesfully upgaded gitlab-ce from version 10.6.2 to 11.6.3  

    1. Determine CentOS version
      cat /etc/redhat-release
      CentOS Linux release 7.5.1804 (Core)
    2. Install all CentOS updates:
      yum check-update
      yum update
      All packages are updated automatically except gitlab, so we had to manually update gitlab
    3. Some good reads:
      1. https://docs.gitlab.com/omnibus/update/README.html
      2. https://blog.securityevaluators.com/upgrading-gitlab-ce-from-a-6-9-2-source-installation-to-10-1-0-omnibus-a-novel-cf8c4f78bf99
        I was more lucky than this guy, because we were only 1 version behind ;-)
    4. To check your gitlab installation for issues, run:
      gitlab-rake gitlab:check SANITIZE=true
    5. From version 10.0 GitLab requires the version of PostgreSQL to be 9.6 or higher, so check PostgreSQL version:
      /opt/gitlab/embedded/bin/psql --version
    6. Before updating gitlab, it is a good idea to backup it using
      gitlab-ctl start (needed in case gitlab is not already running)
      sudo gitlab-rake gitlab:backup:create   (you can add the option STRATEGY=copy)
    7. Backup configuration files
      The secrets file is essential to preserve your database encryption key.
      cd ~
      mkdir gitBackupConfig
      cd gitBackupConfig
      cp  /etc/gitlab/gitlab-secrets.json .
      cp  /etc/gitlab/gitlab.rb .
    8. Check the currently installed gitlab version:
      Login to the admin page of your gitlab server
      http://gitlab.mycompany.org/admin  (adapt the URL to your needs)
      Dashboard > Groups: 3 > Components > update asap
      Below that title you can see the current gitlab version (in my case 10.6.2)
    9. The official update instructions :
      https://about.gitlab.com/update/#centos-7
    10. Determine the version you need
      https://unixy.net/secure/knowledgebase/104/What-does-el5-el6-and-el7-mean.html
      We need el7 as we use centos release 7 (EL7 is the download for Red Hat 7.x, CentOS 7.x, and CloudLinux 7.x.)
    11. Search and  Download gitlab 10.8.0
      1. Search the correct package at
        https://packages.gitlab.com/gitlab/gitlab-ce
        I need
        https://packages.gitlab.com/app/gitlab/gitlab-ce/search?q=gitlab-ce-10.8...
        Click on the link gitlab-ce-10.8.0-ce.0.el7.x86_64.rpm and follow the instruction
      2. Download the correct version
        curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
    12. Install this version (10.8):
      sudo yum install gitlab-ce-10.8.0-ce.0.el7.x86_64
      Updated:
        gitlab-ce.x86_64 0:10.8.0-ce.0.el7
      Complete!
    13. So now we are at version 10.8 and can update to 11.6.3 the easy way:
      yum update
      Updated:
        gitlab-ce.x86_64 0:11.6.3-ce.0.el7
      Complete!
    14. Take a look at the gitlab admin page:
      http://gitlab.mycompany.org/admin
      Press F5 to refresh the webpage
      OK no updates are available and we are on GitLab 11.6.3
    15. To be sure everything works fine now :
      gitlab-ctl restart
      shutdown -Fr now
    16. And try to login again
      http://gitlab.mycompany.org
    In order to prevent this update problem in the future: 

    • Do on a monthly basis:
      yum check-update
      yum update
    This way gitlab and CentOS will be kept up to date

    13 December 2017

    Veeam Backup 9.5 :& Restore Linux Files

    This week I had to restore some files on a (Turnkey) Linux Virtual Machine (VM) on VMware.

    The backup of the VM is done with Veeam Backup & Replication 9.5

    During the restore, Veeam creates a temporary VM, boots it up and then you can selectively restore files to the destination machine.

    VeeamBackup 9.5 - Restore Linux Files

    Veeam uses ports 2500-5000 so I needed to open these ports on the firewall on the destination machine.

    nmap nor netstat -tulpn helped me to see whether these ports were open or closed. Maybe I used the wrong parameters ...

    We use the Linux Firewall "iptables", so I needed to add INPUT chains.

    iptables config for VeeamBackup:


    cat /etc/network/if-pre-up.d/iptables  start this script to reload the firewall <<<<<<<<
      
        #!/bin/sh  
        /sbin/iptables-restore < /etc/iptables.up.rules  
    

    chmod +x /etc/network/if-pre-up.d/iptables

    Edit file /etc/iptables.up.rules and add

    # Needed for VeemBackup  FLR restore files to linux  
    -A INPUT -m state --state NEW -m tcp -p tcp --dport 2500:5000 -s xxx.xxx.xxx.xxx -j ACCEPT
    # To be sure I added some other hosts which might be involved in the restore process  
    -A INPUT -m state --state NEW -m tcp -p tcp --dport 2500:5000 -s 192.168.yyy.yyy -j ACCEPT  
    -A INPUT -m state --state NEW -m tcp -p tcp --dport 2500:5000 -s 192.168.zzz.zzz -j ACCEPT  
    -A INPUT -m state --state NEW -m tcp -p tcp --dport 2500:5000 -s 192.168.www.www -j ACCEPT  
    -A INPUT -m state --state NEW -m tcp -p tcp --dport 2500:5000 -s 192.168.uuu.uuu -j ACCEPT  
    
    
    and reload the firewall:
    /etc/network/if-pre-up.d/iptables
    After making these changes, the restore worked !
    
    
    
    
    see also:
    https://helpcenter.veeam.com/docs/backup/vsphere/used_ports.html?ver=95#linux_servers
    https://community.spiceworks.com/how_to/103485-configuring-a-veeam-linux-backup-repository
    
    

    23 September 2017

    Map network drive at startup



    Update 03-2021: 
    Some time ago TransIP stopped this free service ....

    I use free storage at https://www.transip.nl/stack/ and can access it via webdav.

    And even nicer : I can map a network drive to this storage.

    Here is a simple bat script I use to map the network drive.
    It made it run at startup to be sure it is always available.
    I added some delay to give the computer enough time to process every command.

    C:\bat\MapZ-Stack.bat

    @echo off
    timeout /t 15
    if exist z:\nul net use z: /del
    timeout /t 5
    echo Create Z:-disc for StackStorage
    net use z: https://YourAccount.stackstorage.com/remote.php/webdav/ YourPassword /user:YourAccount

    Replace YourAccount en YourPassword with the proper values you got from Transip

    Run a batch file at boot in Windows 8 and 10 users
    (copied from https://www.computerhope.com/issues/ch000322.htm)


    • Create a shortcut to the batch file.
    • Once the shortcut has been created, right-click the file and select Cut.
    • Press the Start button and type Run and press enter.
    • In the Run window, type shell:startup to open the Startup folder.
    • Once the Startup folder has been opened, click the Home tab at the top of the folder and select Paste to paste the shortcut into the folder.
    So, now I have the Z:-drive everytime I login.


    16 September 2017

    How to find Microsoft Office license keys

    Als je Office 2010 of ouder hebt en een schone installatie van Windows 10 wilt uitvoeren, zoek dan eerst je Office-productcode. Tips voor het vinden van je productcode vind je in De productcode voor Office 2010 zoeken of De productcode voor je Office 2007-programma invoeren.

    https://products.office.com/2010-microsoft-office-suites-license-designations

    https://support.office.com/article/Enter-the-product-key-for-your-Office-2007-program-fabe03d9-fbc3-452e-8fd4-d1c2e661d518

    see also
    http://www.belarc.com/info_ms_product_keys


    How to Change Microsoft Windows and Office Product Keys

    Sometimes a Microsoft product key shown in Belarc software doesn't match the key on the Microsoft sticker, or only shows a few characters of the key.  One common cause of this is that the software was pre-installed by the computer manufacturer and your personal product key was sent on a separate card or sticker.  Computer manufacturers often use their product key, instead of yours, when pre-installing software at the factory so that's the key you're seeing. 
    Another common cause is that recent Office installers remove all but the last five characters of the install product key once the installation completes.
    To change the product key currently on your computer (and reported by Belarc) to your full personal key, you can follow the steps outlined below.

    Windows product keys

    You can change your Windows product key by following the instructions at this Change Product Key Microsoft web page.  Those instructions work on many versions of Windows.

    Finding your Office 2013 and later product key

    Purchasers of Office 2013 and later usually receive only a Product Key Card and instructions to download office from the office.com web site.  The 25 character key on that Product Key Card is not your office install key, but instead an entitlement key allowing you to install office from that web site.
    You can see the product key that is used to install office by signing into your office.com account here.  Once signed in, choose Install from a disc under Account Options.  You'll see your office installation product key to the right of your options.

    Changing your Office 2010 and later product keys

    You can change your Office 2010 and 2013 Professional Plus or later product key like this
    1. Open the Windows Control Panel and run "Uninstall a program" in the Programs group. (On Windows XP, just run the Add or Remove Programs control panel.)  You'll find the Control Panel on the Start menu or on Windows 8 by searching for it with the Search charm.
    2. Find and select the Office product you'd like to change the product key for in the list of programs.  Then click Change.
    3. In the resulting dialog box select the "Enter a Product Key" option and click Continue.
    4. Type your product key and select the option "Attempt to automatically activate my product online".  Then click Continue and on the next screen click Install Now.
    Note: You must have an internet connection to reactivate Office online. However, you can also activate Office at a later time by opening any Office app, clicking on the File tab, and selecting Help.

    Changing your Office 2007 and earlier product keys

    You can change your Office 2007 (or older version) product key by following the instructions at the How to change the product key for Office XP, for Office 2003, and for the 2007 Office system Microsoft web page. 

    16 January 2017

    Website gehost bij Antagonist.nl : https configureren met gratis SSL certificaat van ZeroSSL [Updated 1/6/2017]

    Waarom https i.p.v. http gebruiken?

    • veiligheid: alle verkeer van en naar je website wordt geëncrypteerd
    • vertrouwen: bezoekers weten zeker dat ze op jouw website zitten; In de URL staat een gesloten slotje; in Chrome is dit slotje groen gekleurd
    • Het helpt je ranking bij Google
    • Vertrouwelijkheid, Authenticiteit, Integriteit
    Opdat je site https zou kunnen gebruiken, heb je een SSL certificaat nodig. Zo'n certificaat kost normaal gezien geld (vanaf 8 euro/jaar ), maar het kan ook gratis al moet je dan wel elke 3 maanden het certificaat vernieuwen.

    De procedure om een WordPress website gehost bij antagonist.nl te voorzien van een gratis SSL certificaat zodat https kan gebruikt worden,  wordt hieronder beschreven:

    [Update 1/6/2017] Antagonist.nl voorziet voortaan zelf de gratis certificaten zodat onderstaande procedure niet meer moet uitgevoerd worden.

    Gratis SSL certificaat aanvragen bij ZeroSSL.com

    1. Surf naar http://zerossl.com
    2. Online tools > Start
    3. Vul bij domains: [jouwDomainNaam.xxx] in en accepteer onderaan de 2 voorwaarden.
    4. Klik op Next en Yes (include www-prefixed version too?) zodat ook www.jouwDomainNaam.xxx  in https mode kan gebruikt worden
    5. Er wordt nu een CSR gegenereerd 
    6. Download de CSR
    7. Klik op Next. Er wordt een account key gegenereerd
    8. Download de account key (= RSA PRIVATE KEY)
    9. Klik op Next
    10. Volg de instructies voor de verification. Je moet 2 files aanmaken en op de site plaatsen:
      • Verification
        Je bewijzen dat je toegang hebt tot de webserver waarvoor je het SSL certificaat aanvraagt.
        Daarom moet je een file met een lange filename en met de Text als inhoud uploaden (via ftp) in .well-known/acme-challenge/ folder
        Let op dat de filename GEEN extensie (bv: .txt) bevat !
        En upload file via ftp in
        /domains/[jouwDomainNaam.xxx]/public_html/.well-known/acme-challenge/
        (vergeet het puntje niet voor well-known)
        Voorbeeld van zo'n filename:
        O1zoMcIK1t9j4CdOP1K-q6jljeUJ_ufbhs0MGiFz5AE
        Inhoud van die file: O1zoMcIK1t9j4CdOP1K-q6jljeUJ_ufbhs0MGiFz5AE.8uULhAGr4bCmGiLXjmaeFdudtbUmv9UvP_AzJ9hDBUsJe kan daarna te testen of de link bereikbaar is door erop te klikken http://[jouwDomainNaam.xxx]/.well-known/acme-challenge/O1zoMcIK1t9j4CdOP1K-q6jljeUJ_ufbhs0MGiFz5AE
    11. Klik op Next
    12. Op deze pagina krijg je het certificate (=public key) te zien. Download die files ook
      1. Tip:Print die pagina als pdf  
        Klik op “Download” om het certificaat te downloaden > domain-crt.txt
    13. Copy en paste de private key (RSA) en public key via (eerst inloggen op je DirectAdmin account bij antagonist.nl) DirectAdmin > Home !!!! > SSL Certificates
        • Copieer private key (RSA) en public key (certificate)  in dezelfde textarea als “Paste a pre-generated certificate and key” . Let op: er mogen geen lege lijnen in de textarea voorkomen.
        1. In de tekst area staat nu iets in de zin van:
          ----BEGIN RSA PRIVATE KEY-----
          MIIJKgIBAAKCAgEAilWecOgQNt42MqkZljyPmuv8FENQBK1i76YaYnfihFSXbnmh
          ...
          -----END RSA PRIVATE KEY-----
          -----BEGIN CERTIFICATE-----
          MIIGGjCCBQKgAwIBAgISAzPpG9pskoG46sUoOAGxqD4kMA0GCSqGSIb3DQEBCwUA
          ...
          -----END CERTIFICATE-----
          -----BEGIN CERTIFICATE-----
          MIIEkjCCA3qgAwIBAgIQCgFBQgAAAVOFc2oLheynCDANBgkqhkiG9w0BAQsFADA/
          ...
          -----END CERTIFICATE-----
        2.  klik op Save

      Bezoekers automatisch doorsturen via HTTPS

      Makkelijkst is om alle http traffiek automatisch te redirecten naar https.
      Wijzig public_html/.htaccess op je website: voeg volgende rewrite rule bovenaan toe:

      RewriteEngine On
      RewriteCond %{HTTPS} !=on
      RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


      Oplossing voor mixed content - Wordpress plugin SSL Insecure Content Fixer

      Als je Wordpress gebruikt worden alle links vast gecodeerd als http://[jouwDomainNaam.xxx]/..
      Daardoor zal je pagina als mixed content worden beschouwd en niet beveiligd zijn.
      Gelukkig bestaat er een plugin die dit oplost zodat je niet alle htmlcode moet aanpassen:
      SSL Insecure Content Fixer.

      Installeer Wordpress plugin SSL Insecure Content Fixer



      1. Ga naar je Wordpress dashboard en kies Plugins.
      2. Zoek plugin SSL Insecure Content Fixer, installeer en activeer die plugin.
      3. Bij instellingen van de plugin kies je:
      4. Instellingen > SSL Insecure Content Fixer Settings
      5. [x] Content (zodat de http:// voor images vervangen wordt door https://)

      Voilà, voortaan wordt [youwDomainNaam.xxx] automatisch via https afgehandeld.

      P.S. Vergeet niet het gratis SSL certficaat elke 3 maanden te vernieuwen !

      16 November 2016

      Download music from youtube using Linux



      Simple procedure to download music from youtube using the command line in Lubuntu (probably works also in other Linux distributions)

      16/11/2016
      • Open Xterm
      • Download software (needed only once):

        • sudo apt-get install parcellite
          (this helps to copy & paste from e.g. firefox navigaton bar to Xterm window)
        • sudo apt-get install lame
          More info about the mp3 encoder Lame
        • sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
        • sudo chmod a+rx /usr/local/bin/youtube-dl
           
      • Download a song (put everything on 1 line !)
        /usr/local/bin/youtube-dl --extract-audio --audio-format mp3 https://www.youtube.com/watch?v=.......
        
      • The mp3 file is saved in the current directory op your Xterm window
      References:
      • http://askubuntu.com/questions/237942/how-does-copy-paste-work-with-xterm
      • http://askubuntu.com/questions/791969/error-while-using-youtube-dl
      • http://askubuntu.com/questions/178481/how-to-download-an-mp3-track-from-a-youtube-video 

      13 July 2016

      Run Windows 10 on Linux Mint using virtualbox

      The screen of my portable is acting strange from time to time. 
      Maybe the video controller has a problem ...
      To be sure I do not loose anything from my portable, I decided to virtualize it and check to see if I could run this virtualized pc on Linux Mint using virtualbox.

      Important: my portable runs Windows 10 - 64-bit, so in order to run the virtualized version I also need a 64-bit OS. I chose Linux Mint Mate 64-bit as host OS.

      The test succeeded : I can run my Windows 10 64-bit portable in Linux Mint using virtualbox.

      Here is what I did:
      • Virtualize the portable
        • (on my running portable I wanted to virtualize:)Using "VMware vCenter Converter Standalone" I converted my portable running Windows 10 64-bit to a virtual machine. The result was a vmdk file. I copied the files (vmdk and vmx file) on an external usb disk.
        • The software can be found at : https://www.vmware.com/products/converter
      • Download and install Linux Mint on a USB stick
        • (on a windows pc) On the internet, search for "Download Linux Mint 18 Sarah"
        • Download linux mint :
          • https://www.linuxmint.com/download.php
          • Download the Mate 64-bit version from one of the servers listed.
            I used the server in Europe > Netherlands > Triple IT
            (1.6 GB is being downloaded)
        • (on a windows pc) Burn iso to USB stick
          • Use UNetbootin to burn the downloaded ISO to a USB stick (USB stick needs of course at least 2 GB of free space)
            • [x] Diskimage  - ISO
            • Navigate to your download folder
            • select linuxmint-18-mate-64bit.iso
            • Type: USB-disk  E:\   [OK]
          • Alternatives for UNetbootin:
            see http://www.howtogeek.com/127377/the-best-free-tools-for-creating-a-bootable-windows-or-linux-usb-drive/
        • Start Linux Mint from USB stick
          • Boot the PC you want to use with the Linux on your USB stick
          • On some computers you can/need press F12 or Esc and F9   to choose the (USB) device you want to boot from.
          • If boot does not work, check bios.
        • Optionally change keyboard layout (Menu > Keyboard > Layouts > Add > Country: Belgium > Add
          Move "Belgian" above "English (US)" > Close
        • Download, install and start virtualbox
          • Start Terminal
          • Type "sudo apt-get install virtualbox-qt" to download and install virtualbox (this will take quite some time so be patient).
          • Type "virtualbox" in the terminal window to start virtualbox
            • Add and the virtual machine
              • Be sure the USB disk with the Windows 10 vmdk file is attached to your PC
              • New
                • Name : type some name e.g. vmWin10
                • Type: Microsoft Windows
                • Version: Windows 10 (64-bit)
                  • Next
                • 2 GB Ram is sufficient
                  • Next
                • [x] Use an existing virtual hard disk file
                  • Navigate to the vmdk file on the external hard disk > Open > Create
              • Click on the Start (green arrow) (and wait at least 5 minutes ... it takes some time to start Windows 10 in virtualbox, but it works !
                P.S. In virtualbox, the Ctrl+Alt+Delete is replaced by right Ctrl+Del to login in Windows

        Using RDP (Remote Desktop) to connect to vmWin10


        • Configure virtualbox > Machine > Settings > Display > Remote display > [x] Enable Server (Server Port: 3389)
        • Configure virtualbox > Netwerk > Attached to : Bridged adapter (Name: enp2s0)
        • Enable RDP in vmWin10 : Control Panel > System > Properties > Remote Desktop > [x] Allow remote connections to this computer
        • If necessary : Disable firewall in vmWin10 (or allow RDP through) : Control Panel > System and Security > Windows Firewall > Turn Windows Firewall on or off 
        • Verify IP address of you vmWin10 : in Windows > Start > cmd > ipconfig
          Note the IPv4 address (in most cases something like 192.168.x.y)
        • On another pc on your network : start > mstsc /v:192.168.x.y (replace by ip address of your vmWin10)



        12 May 2015

        eID reader - Linux Mint, Windows 7 en Windows 10 [Last update 23/6/2017]

        Belgische Identiteitskaart (eID) gebruiken onder Linux Mint 17, Windows 7 en Windows 10


        Voor Linux Mint 17

        Onderstaande procedure werkte voor mij om de eId bruikbaar te maken onder Linux Mint 17 :
        1. Sluit de eid-lezer aan op een USB poort en steek je Identiteitskaart in de lezer
        2. Ik heb eerst dit geprobeerd, maar dat bleek niet onmiddellijk te werken:
          eid-archive.deb (DEB, 6.01 Kb)
          Klik op bovenstaande link.
          Na het downloaden kan je dit bestand dubbeklikken en autom. zal de Package Installer de software installeren
        3. Menu (> Administration) > Software Manager
        4. Download en installeer : (tik onderstaande stuk voor stuk in om te downloaden)
          1. beid-mozilla-extension
          2. eid-archive
          3. eid-mw
          4. eid-viewer
        5. Voor de oudere versies van de ACS ACR38U kaartleze, installeer je ook nog libacr38u als volgt:
          1. Menu > Terminal
          2. sudo apt-get install libacr38u
        6. Nu kan je testen kan via Menu > Accessoiries > eID Viewer
        7. Tip: Gebruik Firefox om bv. bij de CM (http://www.cm.be) in te loggen met je eID kaart.
          Je krijgt wel allerlei foutmeldingen, maar na installatie als "Exceptions" lukt het wel.
          (het is me niet gelukt met Google Chrome)
        8. Als je wil verifiëren of je lezer herkend wordt, gebruik dan pcsc_scan . Daarvoor kan je pcsc-tools downloaden via de Software Manager
        9. Nog inlogproblemen met firefox : zie onderstaande link:
          Hoe beveiligingsapparaten laden 'Belgium eID PKCS#11 module' 'libbeidpkcs11.so.0'
          https://eid.belgium.be/nl/aanmelden#7504

        Bron en Meer info vind je in deze FAQ 
        http://test.eid.belgium.be/faq/faq_nl.htm#Firefox_Instellen_voor_eID
        https://csam.be/ (CSAM, de toegangspoort tot de diensten van de overheid)


        Voor Windows 7 en Windows 10:


        1. Log in met een windows account met administrator privileges (administrator of beheerder)
        2. Niet nodig in Windows 10: Java installeren
          Voor Windows 7, indien nog niet geïnstalleerd: download en installeer java (http://www.java.com)
        3. Download en installeer EID software : https://eid.belgium.be/nl (sluit de EID reader pas aan op het moment dat dit gevraagd wordt !)
        4. Indien nog niet gebeurd, download en installeer Firefox: http://www.mozilla.org 
        5. Start Firefox en voeg add-on toe voor Eid Belgium : In firefox: rechts bovenaan: "Open Menu"  -  Add-ons  -  Get Add-ons  -  onderaan : See more add-ons  -  Zoek : Belgium eID  -  Add to firefox  (of  https://addons.mozilla.org/en-US/firefox/addon/belgium-eid/ ) (Deze add-on moet geïnstalleerd worden voor elke windows user die de Eid wil gebruiken)
        6. Aanmelden is makkelijkst via https://iamapps.belgium.be/sma/generalinfo?view=home
        7. Voor de belastingaangifte : Surf naar http://taxonweb.be en kies je taal
        8. Klik om Naar mijn aagifte

        Problemen met eID

        [01/06/2017]
         (Voor firefox) 
        Check waarvoor certificaat van Belgium Root CA? kan gebruikt worden:
        Het certificaat van Belgium Root CA3 moet vertrouwd worden voor o.a. websites te identificeren -in firefox : Opties - Geavanceerd - Encryptie en Certificaten bekijken - zoek Belgium Root CA3 - Bewerken : vink de 3 checkboxes aan

        [23/06/2017]
        Error: Popup om pincode in te geven verschijnt niet maar melding "Aanmelden mislukt"
        Oorzaak Kaspersky Internet Security
        Oplossing:

        • Open Kaspersky Internet Security
        • Links onderaan op het radertje (instellingen)
        • Extra - netwerk
        • [x] Versleutelde verbindingen niet scannen
        Met dank aan http://www.aideacces.be/12.php?langue=NL Op die site vind je nog meer tips om eID problemen op te lossen.


        28 November 2014

        View photos that are stored on your Linux Mint Pc on your Android tablet

        How to view photos on a tablet (photos are stored on a PC)

        I currently use Linux Mint as desktop PC and an Android tablet.
        My photos are stored on the desktop PC, but I wanted to view them also on my tablet.

        This is what I did:

        1. On the Linux Mint desktop PC : download system-config-samba
        2. Start this program and click on the + to add a directory (in my case: /mnt/data/Our Pictures)
          1. On the Basic tab :
            1. Directory : /mnt/data/Our Pictures
            2. Share name : Our Pictures
            3. [x] Visible
          2. On the Access tab : [x] Allow access to everyone
            Note: If you want a more secure access, you can choose to allow access to specific users
        3. On the Android tablet: Go to the Play Store and Search for "smb client"; Download (and install of course) ES File Explorer File
        4. Start ES File Explorer
        5. On the top left click on the 3 horizontal bars to display the menu and choose "Network" > Lan
          Click on the + (New):
          1. Server: /Our Pictures e.g. 192.168.1.3/Our Pictures
          2. [x] Anonymous
          3. Display as : Our Pictures on my desktop PC
        6. Now if you click on "Our Pictures on my desktop PC" you'll see the files  on the desktop pc
        References:

        23 March 2013

        Down the mountain with my new Nokia Lumia 800 (Stabilized)

        How to turn a shaky movie made with a Nokia Lumia 800 into a much better (stabilized) experience.


        The video has been modified with the YouTube standard image stabilization because it's a very shaky film
        You can also watch the original to compare the result.
        Search for "nokia lumia 800 stabilizer" on youtube if the link does not work.

        P.S. The film is not mine, I just place a link to it from my blog. All rights belong to the person who originally uploaded the movie on youtube.

        01 March 2013

        Windows 7 startup slowly at home

        Windows 7 takes a long time to start at home


        Problem

        When I am not connected to the LAN at work, windows 7 takes a long time to startup while displaying "Waiting for the User Profile Service"

        Solution

        Thanks to Chris Buchanan, I have found the solution at http://www.chrisbuchanan.ca/Blog/Lists/Posts/Post.aspx?ID=17

        What you need to do is to change the Local Group Policy setting the max. wait time for the network ... to 0

        Procedure:


        1. Start  > gpedit.msc
        2. Computer Configuration > Administrative Templates > System > User Profiles
        3. Edit the policy "Set maximum wait time for the network if a user has a roaming user profile or remote home directory" to "Enabled" and set the value Wait for network for maximum (seconds) to 0.
        4. OK
        5. Close policy editor
        6. Then force an update of the group policy (gpupdate /force) (this worked only when I was connected to the LAN at work)

        Since I did this, the startup time decreased from more than 1 minute to 20 sec. on my Dell XPS 15z (Core i7) laptop.

        More details can be found  at http://www.chrisbuchanan.ca/Blog/Lists/Posts/Post.aspx?ID=17


        02 November 2012

        Connecting Mobile Phone through Portable PC


        Connect your smartphone to the internet via your portable


        So, I got myself a new smartphone (with Windows Phone7.5) (Nokia Lumia 800).

        At some places I have no wireless network available, but I still want to reach the internet via my smartphone.

        This is possible if
        • you have a portable PC with Intel My WiFi Technology
        • your portable is connected to the Internet
        • you follow the configuration instructions below





        Configuration instructions:

        On your Portable PC (which is connected to the internet):


        1. Start - Network and Sharing center
        2. Change adapter settings
          Change Adapter Settings
          Change Adapter Settings
        3. Choose your interface (which is connected to the internet)
          e.g. Wireless Network home or Local Area Network

          Interface with Internet access
        4. Doubleclick this interface and choose Properties
        5. Tab Sharing
          • [x] Allow other network users to connect through this computer's Internet Connection
            Home networking connection: choose the correct name e.g. PC37Dhotspot
        6. PC37Dhotspot - Microsoft Virutal WiFi Miniport Adapter @2) : 192.168.137.175
          • Assign PC37Dhotspot IP address 192.168.137.175 netmask 255.255.255.0

        1. Start - Intel My WiFi Utility
        2. Options

          Options
        3. General
          [x] Autom. enable Intel My WiFi Technology on system startup
          [x] Show taskbar icon
        4. Notifications
          [x] Notify when devices connect to this computer
          [x] Notify when devices disconnect from this computer
          [x] Nofify when new devices try to connect to this computer
        5. DHCP
          assign your DHCP range to e.g.
          Start IP 192.168.137.173
          End IP 192.168.137.181
        6. Power
          Enable Intel My WiFi only when power source is
          [x] Any power source
          Autom. disabling: Never
        7. Profile
        8. Intel Wireless PAN (preset) - Edit Profile name : Intel Wiireless PAN
          SSID : D4B.....-..190 (choose your own SSID ;-)
          Security
          Security Type: WPA2-PSK
          Encryption Type: AES-CCMP
          Password: ....... (choose your own password)
          Sharing
          ICS and Bridging filter : Disabled
          DHCP and DNS : Enabled (at home) or Disabled (at work because other DHCP and DNS servers are available

        Be sure Enabled is visible on the same line as the Options... Help links
        Disable/Enable toggle

        On your mobile


        1. Settings
        2. Wifi
        3. Switch to on by moving the slider to the right
        4. Find your SSID (D4B.....-..190) and tap on it to connect
        5. Wait a few seconds ... Connected should appear under the SSID

        Now you can start using the internet on your mobile (traffic goes via your pc)

        19 February 2012

        VirtualBox - Oracle VM - networking

        I had some trouble finding a working solution for running Oracle ( ovm3 ) in Virtualbox 4.1.8 on Windows 7 Professional 64-bit.

        After a while, I found this configuration works (at least the connection between Host and Guest) :


        1. After installing Virtualbox, an extra networking device appears : VirtualBox Host-only Network (1)
          (see Control Panel > Network and Inteternet > Network Connections > Change adapter settings)
          Host-only means you can only establish a connection between guest and host,  your guest will not be able to connect to e.g. the internet
        2. This adapter  (1)  has IP address 192.168.56.1
          (see Control Panel > Network and Inteternet > Network Connections > Change adapter settings > Select VirtualBox Host-Only network > Details
        3. Now change the settings of the virtual machine ovm3 in Oracle VM VirtualBox Manager:
          1. Select ovw3
          2. Click on Settings (and wait until the config is fully read)
          3. Click on Network and choose Adapter 1
            1. [x] Enable Network Adapter
            2. Attached to: Host-only Adapter
            3. Name: VirtualBox Host-Only Ethernet Adapter
            4. In the Advanced section I left the settings to their defaults:
              1. Adapter Type: Inter PRO/1000 MT Desktop (82540EM)
              2. Promiscuous Mode: Deny
              3. Mac address .....
              4. [x] Cable connected
        4. Start the virtual machine ovm3
        5. Configure the network settings as follows:
          1. System > Administration > Network
          2. Enter password for root
          3. Tab Devices : select eth0 and click on Edit
            1. Statically set IP address:
              1. Address: 192.168.56.56   (or another in range 192.168.56.x)
              2. Subnet mask: 255.255.255.0
              3. Default gateway: 192.156.56.1
          4. Tab Hosts: I entered the same IP (..56) for the current hostname (don't know if this is really necessary)
        6. Save this configuration: File > Save
        7. Go back to tab Devices , click on Deactivate and Activate to finalize the network setup 
        8. Now you should be able to ping 192.168.56.56 and 192.168.56.1:
          Applications > Accessoires > Terminal
          ping 192.168.56.56     ...  OK
          ping 192.168.56.1    ...  OK
          pinging other IP addresses won't work because we are using the host-only  configuration in VirtualBox.
        9. Test login OVM console:
          From e.g. Internet Explorer in Windows:
          http:192.168.56.56:7001/ovm/console
          Login as admin/Welcome1
        10. Test sql*plus
          In ovm3: start sql*plus and login as ovs/Welcome1@XE
          Also working :
          -  connect system/Welcome1@XE
          - connect sys/Welcome1@XE as sysdba
        11. Start Oracle Application Express
          http://localhost:8080/apex/apex_admin
          Login als admin/Welcome1 ... je moet onmiddellijk je paswoord wijzigen (Welkom9!)

        12. Login as sys/Welcome1
          Create a new database user:
          Database username: mvr
          Application username: mvr
          Password: Welcome1
          Create Workspace mvr
          Manage workspaces > mvr > Manage developers and users > create/edit user mvr en ken paswoord toe
          Use http://localhost:8080/apex to login workspace mvr username admin password Welkom9! .. lukt niet (ook niet als user mvr)

          Oeps ... I can't yet connect  to http://192.168.56.56:80/apex from Windows
          (Might not be needed anymore, because the cause was the firewall, see further)
          EXEC DBMS_XDB.SETHTTPPORT(8080);exec dbms_xdb.setListenerLocalAccess (l_access =>FALSE)
          ;
          Solution: Disable the firewall in ovm3 (or add port 8080 to the exception list)
          System  > Administration > Security Level and Firewall > Firewall: Disabled
          Now I can use I.E. in Windows to use   http://192.168.56.56:8080/apex
        13. Accessing APEX from SQL*Developer
          1. Tried but failed:
            Hostname: 192.168.56.56
            Port 1521
            SID: XE
            Got error:
            Status: Failure - Test failed: IO Error: The Network Adapter could not establish the connection
          2. Solution:
            In ovm3:
            1. /etc/hosts:
              Verify/add 
              192.168.56.56   wwwdevpc37d.as.local    wwwdevpc37d
            2. In listener.ora and tnsnames.ora:
              replace localhost with   wwwdevpc37d.as.local 
            3. tnsping wwwdevpc37d.as.local
          3. In windows:
            1. c:\windows\system32\drivers\etc\hosts
              Verify/add 192.168.56.56 wwwdevpc37d.as.local
            2. In sql*developer add a Connection:
              Connection name: test1
              Username:sys
              Password: Welcome1
              [x] Save password
              Connection type: Basis  Role: sysdba
              Hostname: wwwdevpc37d.as.local
              Port: 1521
              SID: XE





        14. Info Listener.ora :
          su - root
          su - oracle

          .
          /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh  (don't forget the point + space at the start of this line)

          locate listener.ora

          nano 
          /u01/app/oracle/product/11.2.0/xe/network/admin/listener.oralsnrctl status
        15. Finally got bridged network working. This way the guest machine also can reach the internet.
          (this works for me:)

          Make sure host and guest OS share the same network segment e.g. 192.168.1.*
          Use the correct interface in Settings > Network:
          In my case:
          Adapter 1 [x] Enable Network Adapter
          Attached to: Bridged Adapter
          Name: Intel(R) Centrino(R) Advanced-N 6230 (=my wireless network adapter of the host)
          Advanced (leave the defaults): Adapter Type: Intel PRO/1000 MT Desktop 58254OEM)
          Promiscuous Mode: Deny
          [x] Cable connected


          In the guest VM :
          Not a bad idea to record your ip address and hostname in /etc/hosts
          Assign IP address, gateway and DNS:
          System > Administration > Network
          Doubleclick the eth0 interface and fill out a static IP address, mask and gateway (same as your host)
          On the DNS tab, fill out the Hostname, DNS (same as your host or e.g. 8.8.8.8)

          File > Save
          Activate
        16. Nice link:
          http://devhub.fm/setting-up-an-oracle-11g-sandbox-dev-environment/
        17. Enterprise managerstart Oracle simply type “emctl start dbconsole” into the console .. does not work
          Probably because some environment variables need to be set correctly in emctl
          su - root
          su - oracle
          . ./setenv.sh
          locate emctl
          ... to be continued
          https://localhost.localdomain:1158/em/console/aboutApplication

        10 February 2012

        GlobeSurfer Icon 7.2 USB stick - Windows 7 Prof. 64-bit - driver installation

        Problem:
        I encountered following problem when trying to use the WLAN USB stick of Mobistar on a Win 7 Pro 64-bit: the software did not install correctly.


        Solution:
        go to: http://www.option.com/en/support/software-download/mobile-devices-solutions/icon225/
        download: GlobeTrotter® Connect 3.1 ( iCON® 225 )
        version: 3.1d0-1162


        Don't forget : in Belgium you need to use APN web.pro.be in order to connect to your work VPN.


        Cause:
        I guess the drivers that come with the Globetrotter Icon 7.2 are 32-bit, so they are not signed to use on 64-bit systems and fail to load.