1 2 3 4 5 6 7 8 9 10 Next »

Annoying click/popping sound on Ubuntu 20.04

Create Date: October 22, 2020 at 05:19 PM         Tag: UBUNTU         Author Name: Sun, Charles

Annoying click/popping sound on Ubuntu 20.04

It was happening because Ubuntu turned on the sound card power-saving capabilities. Turning it off can be the only way to get rid of the annoying sound:

  1. Verify how is your sound card's power_save parameter:

    cat /sys/module/snd_hda_intel/parameters/power_save
    
  2. If it returns 1, do the following to change it temporally:

    echo "0" | sudo tee /sys/module/snd_hda_intel/parameters/power_save
    
  3. If the previous step worked for you, persist that configuration (otherwise the problem will continue after reboot):

    echo "options snd_hda_intel power_save=0" | sudo tee -a /etc/modprobe.d/audio_disable_powersave.conf
    
  4. (Optional) You can also do the same for power_save_controller parameter following the steps 1, 2 and 3 replacing power_save by power_save_controller also changing 0 to N.

    Note: using the first step will probably return Y for this parameter, instead of 1.

New Comment

Undo merge in Git

Create Date: August 19, 2020 at 06:35 PM         Tag: SOURCE CONTROL         Author Name: Sun, Charles

The below is just a reference. It is not really working. The command below works for me. I wouldn't recommend on a branch that was shared. Please never merge other working branch to you branch. The best way to create a release branch and push each branch to this branch.

git reset --hard  //it is reverse commit hash id (right click the commit to get it in SourceTree)
git push -f
git log / git status

Other useful git commands: 

git pull
git clean -f

Removing/undoing a merge on Sourcetree

This method is based on history deletion:

  1. Check out the branch you made the mistake on
  2. Right click on the commit you want to reset the branch to
  3. Click "Reset current branch to this commit"
  4. Select "Hard" mode and click "OK"
  5. Unfortunately you need terminal to do this bit. Type git push origin name_of_branch --force into terminal (you may need to enter your git repo username and password for it to accept the command)

Update: The current version of source tree supports forced pushes. That means you don't need to use the command mentioned in step 5! There is a check box visible when pushing that is labled "force". It is usually disabled.

How to enabled the force push checkbox:

  1. "Tools" (in the blue bar at the top of the screen)
  2. "Options"
  3. "Git" tab
  4. "Enable Force Push" (2nd section)
  5. "OK"

Check that checkbox when pushing to also fix the mistake on the origin server.

This is probably the easiest way to do it but since it is based on history deletion, If others are working on the project, make sure to let them all know what you are doing so you don't break anyone's git repository.

Update 2: If you use Visual Studio Code as your code editor, I highly recommend installing the "Git Graph" extension. It allows you to do practically everything that Source Tree allows you to do, but you can do it from directly inside your code editor! The steps for doing this using Git Graph are roughly the same as the steps for doing this in Source Tree.

New Comment

fatal: unable to access 'https://bitbucket.org': SSL certificate problem: self signed certificate in certificate chain

Create Date: July 24, 2020 at 06:32 PM         Tag: SOURCE CONTROL         Author Name: Sun, Charles

git config http.sslVerify false is working. :)

Set up an SSH key

Invalid SSL certificate when pushing to Git server

Git for Windows has its own trust store of trusted certificates which is normally located in the file

Disabling checking of certificates (e.g., by setting git config http.sslVerify false) is not a good idea and might be extremely dangerous (as all security checks are disabled and MitM attacks are easily possible - depending where this is set it applies for all new https connections).

In order to add a certificate (may it be a self-signed one or another root certificate) to this trust store in order to automatically trust it, you have to perform the following steps (the first five steps are just to gather the certificate, this can also be done with your favorite browser, but might require different tasks):

  1. Open the URL of the site in Internet Explorer
  2. Click on the lock symbol in the local bar and choose "Show certificates" (or choose Properties of the site and click on "Certificates")
  3. (Optional) Select the certificate you want to trust on the certificate chain (third tab) and open it
  4. Go to the second tab "Details"
  5. Click on "Save to file", choose "Base64-encoded X.509 (.CER)" and save it with a unique name (remember that name; a name w/o spaces is recommended).
  6. Now you have several options

    1. Use a separate certificate trust store which only contains your just downloaded cert, by executing git config --global http.sslCAinfo "[yourfilename]" in a cli shell in order to only use this certificate as the trust store.
    2. Use a separate certificate trust store which contains your just downloaded cert and all certificates from the git trust store, by appending all content from the system trust store file (path see above) and then execute git config --global http.sslCAinfo "[yourfilename]" in a cli shell in order to use this new trust store.
    3. Update the system certificate file, by appending the content of your just saved file to [path-to-git-trust-store-crt-file] (e.g. by type [yourfilename] >> [path-to-git-trust-store-crt-file] in a cli shell running with administrative rights) OR using notepad (make a copy of the ca-bundle.crt file on desktop, append the content of the downlaoded .crt file and then copy it back). Disadvantage: changes might get overwritten on git update

Done. Now, this certificate is in the trust store of Git for Windows.

New Comment
1 2 3 4 5 6 7 8 9 10 Next »