GitHub to GitLab Fork

Here are the commands to fork a GitHub repository and push it with all the commit comments to a GitLab repository.

>> git clone GitHub-repository.git
>> cd GitHub-repository
>> git remote rename origin old-origin
>> git remote add origin git@your-gitlab.com:your/repo.git
>> git push -u origin --all
>> git push -u origin --tags

That’s all!

Lidl Fotos Album Storage Directory

This time I faced another problem: I had a voucher for a Lidl foto album, created one and wanted to store it on my NAS file server for backup reasons. I searched for the Lidl workspace directory on my harddisk and couldn’t find anything. Also a Google Search and reading the Lidl help site brought no solution. So I had the idea of downloading “Sandboxie” – sandboxed the Lidl app and tracked the folders that were loaded. Here is the result:

C:\Users\your_user_name\AppData\Roaming\PhotoGenie X

Image DateTime Updater

I got a new Android phone and had the problem that during copy process from the old to the new smartphone the file dates of my images changed to the current date. The gallery app showed them all under the same month… The following script helped me to overcome this problem, just follow the instructions presented in the readme file.

Here is the code: https://code.huber.xyz/pub/image-date-handler

GitLab SSH Key Windows

Prerequisites:

  1. Download git-scm
  2. GitLab server
  3. Open the C:/user/your-user/.ssh/ and create the SSH key via git-bash:
    >> ssh-keygen.exe -t rsa -b 4096
  4. Add the public key to your GitLab account
    4.1 Enter your GitLab website
    4.2 Click on your profile, then ‘Setting’ and after that select ‘SSH-Keys’
    4.3 Follow the instructions of GitLab for adding a new key
  5. Create a ‘config‘ file (without extension) in C:/user/your-user/.ssh/ and add the following content:
    Host sample_1
        user git
        hostname git.domain.com
        port 22
        identityfile ~/.ssh/generated-private-key-file_1
    
    # For multiple ssh-key you can add more than one host
    Host sample_2
        user git
        hostname git.domain.com
        port 22
        identityfile ~/.ssh/generated-private-key-file_2
  6. Test it with the git-bash console:
    git clone git@sample:project.git
  7. [Optional] If the key could not be found try to add the following argument to your environment variables:
    Name:  HOME
    Value: %USERPROFILE%

Cloning Bootable Linux Disk

I got a new and bigger HDD for my webserver and so I decided to clone my existing one (128GB) to the new one (512GB). The best thing was that I didn’t need to install and configure all my applications again, so here is a short manual that worked in my case.

  1. Download Ubuntu Desktop
  2. Create a bootable USB disk with Rufus
  3. Start from USB disk and choose “Try Linux from bootable media”
  4. After Linux has started open a terminal and enter the following commands to copy the disk layout:
    >> sudo bash [go to superuser mode]
    >> fdisk /dev/sda [source disk]
    >> o [dump disk layout to file]
    >> q [quit]
    >> fdisk /dev/sdb [destination disk]
    >> d [delete]
    >> I [load disk layout from currently saved sda layout]
    >> w [write layout]
  5. Now clone all data from the source disk to the destination disk by following this command:
    >> dd if=/dev/sda1 of=/dev/sdb1 bs=64K conv=noerror,sync [blocksize 64K, don't stop on error and keep syncing] Don't mix up input and output disk!!!
  6. Now you have to make the destination disk bootable again:
    >> mount /dev/sdb1 /mnt
    >> grub-install --root-directory=mnt /dev/sdb
  7. If all worked correctly you can optionally open gparted and resize the cloned partation to your needings.