Create an Empty Branch in Git

To create a new empty branch in Git, we can use the --orphan command line option

git checkout --orphan 

The command above creates the new empty branch and switches into it.
Once the empty branch s created, we can can delete files from the working directory, so they are not committed in to the new branch

git rm -rf .

Now you are in the empty branch without any inherited files or commits.
If you want to push your empty branch to a remote repository, do the following

git commit --alow-empty -m "Init"
git push origin 

Note, that if you try to merge another branch into the empty one, you will receive the error: fatal: refusing to merge unrelated histories

Use the --allow-unrelated-history option to force the merge into the empty branch.

git merge --allow-unrelated-history 

zfs snapshot sort by size

When you see your zpool exploding, but the “used” size isn’t that much, you may take a look at your snaphosts.

First find the dataset with the that has the largest snapshot

zfs list -o name,usedbysnapshots | sort -r -k2

example output

tank/mails                                  56.3G
tank/store                                   261M
tank/docker                                 2.38M

In this case the tank/mails dataset should be looked at.

Snapshots can then be listed for that filesystem by using a command

# zfs list -t snapshot -r 
zfs list -t snapshot -r tank/mails 

ceph scrubbing time

When you don’t scrub your ceph pool it will scrub itself when you don’t want it to scrub: during working hours. To avoid that you can set the time in the night when scrubbing is allowed

the ceph config set is global for the cluster / all nodes.

root@pve-01:/etc/ceph# ceph config get osd osd_scrub_begin_hour
0
root@pve-01:/etc/ceph# ceph config set osd osd_scrub_begin_hour 22
root@pve-01:/etc/ceph# ceph config get osd osd_scrub_begin_hour
22
root@pve-01:/etc/ceph# ceph config get osd osd_scrub_end_hour
0
root@pve-01:/etc/ceph# ceph config set osd osd_scrub_end_hour 7
root@pve-01:/etc/ceph# ceph config get osd osd_scrub_end_hour
7
root@pve-01:/etc/ceph#

ZFS rename disk path

zpool status
  pool: tank
 state: ONLINE
config:

        NAME                                          STATE     READ WRITE CKSUM
        tank                                          ONLINE       0     0     0
          mirror-0                                    ONLINE       0     0     0
            usb-SanDisk_SDSSDA-1T00_0123456789CA-0:0  ONLINE       0     0     0
            da3p4                                     ONLINE       0     0     0

errors: No known data errors
zpool set path=/dev/disk-by-id/sdsdsdsd tank da3p4
zpool set path=/dev/gpt/my_nice_name  

just type `zpool import` and you will see the name that you can import.

if you want to change the mount path use

zpool import -R /other/path poolname

to rename the pool use

zpool import original_name new_name

stuck at Install_SQLSupport_CPU64_Action

While installing SQL Server 2017 Developer Edition, I got stuck at Install_SQLSupport_CPU64_Action,
this happened to me for the second time, once at work and once at home.
The solution: You will need to browse to this installation path: C:\SQLServer2017Media\<YOUR_SQL_ENU>\1033_ENU_LP\x64\Setup
Then while the setup is stuck at Install_SQLSupport_CPU64_Action run SQLSUPPORT.msi
And follow the installation procedure.
Once installed, run the following command in cmd:
taskkill /F /FI "SERVICES eq msiserver"
The SQL Server setup will continue and succeed.

Remove hihonor bloat ware

1) Download ADB
2) Enable USB Debugging on your device
3) Connect to the computer and verify your device is listed with the command “adb devices”
4) Type “adb Shell”
5) Type “pm list packages”, this will show you all packages installed on phone.
6) Type “pm uninstall -k –user 0 com.huawei.search”
7) you should see the word “Sucess” pop up Well I removed some more bloat ware

pm uninstall -k --user 0 com.google.android.apps.books
pm uninstall -k --user 0 com.google.android.youtube
pm uninstall -k --user 0 com.google.android.apps.youtube.music
pm uninstall -k --user 0 com.google.android.apps.photos
pm uninstall -k --user 0 com.google.mainline.telemetry
pm uninstall -k --user 0 com.hihonor.android.fmradio
pm uninstall -k --user 0 com.hihonor.calendar
pm uninstall -k --user 0 com.hihonor.search
pm uninstall -k --user 0 com.pal.train
pm uninstall -k --user 0 com.hihonor.pcassistant
pm uninstall -k --user 0 com.google.android.apps.tachyon
pm uninstall -k --user 0 com.google.android.feedback
pm uninstall -k --user 0 com.hihonor.printservice
pm uninstall -k --user 0 com.hihonor.android.totemweather
pm uninstall -k --user 0 com.hihonor.android.chr
pm uninstall -k --user 0 com.hihonor.android.thememanager
pm uninstall -k --user 0 com.google.android.videos
pm uninstall -k --user 0 com.google.android.apps.messaging
pm uninstall -k --user 0 com.hihonor.id

proxmox qmp command blockdev-snapshot-delete-internal-sync failed

While trying to move a VM from one node to another I got the error message:

VM 100 qmp command ‘blockdev-snapshot-delete-internal-sync’ failed – Failed to get a snapshot list: Operation not supported

One snapshot was stuck and the VM locked. How to solve this?

qm unlock 100
qm listsnapshot 100
qm delsnapshot 100 preFirstBoot --force
qm unlock <ID>
qm listsnapshot <ID>
qm delsnapshot <ID> <snapname> --force

it might be that the snapshot will remain on the hard disk.

Happy unlocking :)

Archive for category Technik

Archives by Month: