Visual Studio Code – Adding GitLab repository

How do you setup a GitLab repo on Microsoft Visual Code?

There are two main scenarios –

  1. You have the code on your workstation and you want to push into a clean / new repository
  2. You want to pull code from an existing gitlab repository onto your workstation

First go to your local folder on your workstation (either empty or full of code)

git init 
git add .
git remote add origin https://<username>:<usertoken>@gitlaburl.com/project/repo.git

The above commands tell git to run initial setup, add current folder as content then add associated remote gitlab repository.

Note the format to use while using a user token. The user token is issued by GitLab, your username will also be there. You will need to ensure that your token has both read and write access to the repository.

emergency reboot a hung Linux host

Sometimes you need something that can kick a host a bit harder than the standard reboot command. Even if you include the -f switch to force, a hung task can prevent your host from rebooting.

Try this – first enable the sysrq setting, then trigger. Your host should reboot immediately.

sudo echo 1 > /proc/sys/kernel/sysrq
sudo echo b > /proc/sysrq-trigger

Note : This is effectively a hard reset which does not cleanly shut services or tasks down. You may need to check your disk on some operating systems.

HEVC media optimization

Do you have a large collection of video media files not using HEVC (H265) yet? There is a massive amount of disk space coming your way if you flick over to the new video codec format.

HEVC definitely lives up to its name, for most media you can expect a 70% or more disk savings from transcoding from an old codec. There are some catches though… If you want your TV to play it direct (i.e. straight off the file) the codec will need to be supported by it. You can of course get around this by using a media server such as Plex or Emby which will transcode from HEVC back to a compatible format.

Why would you transcode to HEVC? – again, disk space. HEVC as stated above can reduced you Media footprint significantly. You could boost your quality and save your disk space at the same time by recording at a higher resolution then applying the HEVC codec.

I created a powershell script to transcode my media to HEVC using my AMD graphics card. The advantage of doing this is that transcoding completed by my GPU is significantly faster than my CPU. I do not have the graphics card in my media server, so instead connect via SMB and let my gaming machine run the transcoding from remote…

The powershell script uses ffmpeg to ;

  • transcodes video stream to hevc using AMD h/w encoder
  • copys all existing audio and subtitles (i.e. no conversion)
  • works in batches (to prevent constant scanning of files) – able to set max batch size and processing time before re-scanning disk
  • overwrites source with new HEVC transcode if move_file = 1 (WARNING this is default!)
  • checks to see if video codec is already HEVC (if so, skips)
  • writes transcode.log for successful transcode (duration and space savings)
  • writes skip.log for already hevc and failed transcodes (used to skip in next loop, errors in transcode.log)

Check here for updates and script – https://github.com/dwtaylornz/hevcamdwin

Solar – In Summer

Power generation is up in summer :)

The last stat “Total Power (1M-7d)” gives me a view of how much power was generated over a 30 day period 7 days ago (so i can tell if power generation as an average is going up or down). Right now it power generation this on a downward trend.

(see previous post for winter generation)

Solar – modifications complete

Two recent modifications to my solar system have changed the daily generated power considerably.

First section highlighted above – i added the ATS and 24/7 load (this server)

Second section highlighted above – moving the 6 panels from east and west to north facing roof. (only reason i didn’t do this initially is north facing roof is a lot higher and i hate heights!)