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:
-
Verify how is your sound card's
power_save
parameter:cat /sys/module/snd_hda_intel/parameters/power_save
-
If it returns
1
, do the following to change it temporally:echo "0" | sudo tee /sys/module/snd_hda_intel/parameters/power_save
-
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
-
(Optional) You can also do the same for
power_save_controller
parameter following the steps 1, 2 and 3 replacingpower_save
bypower_save_controller
also changing0
toN
.Note: using the first step will probably return
Y
for this parameter, instead of1
.
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:
- Check out the branch you made the mistake on
- Right click on the commit you want to reset the branch to
- Click "Reset current branch to this commit"
- Select "Hard" mode and click "OK"
Unfortunately you need terminal to do this bit.Typegit 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:
- "Tools" (in the blue bar at the top of the screen)
- "Options"
- "Git" tab
- "Enable Force Push" (2nd section)
- "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 Commentfatal: 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
- Git for Windows <=1.9:
[Git installdir]\bin\curl-ca-bundle.crt
(e.g.,C:\Program Files (x86)\Git\bin\curl-ca-bundle.crt
; configured by the keyhttp.sslCAinfo
in[Git installdir]\etc\gitconfig
). - Git for Windows >= 2.0:
[Git installdir]\mingwXX\ssl\certs\ca-bundle.crt
whereXX
stands for32
or64
(e.g.,C:\Program Files\Git\mingw64\ssl\certs\ca-bundle.crt
; configured by the keyhttp.sslCAinfo
in git config, e.g.C:\ProgramData\Git\config
,C:\Program Files\Git\etc
or your global/local config).
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):
- Open the URL of the site in Internet Explorer
- Click on the lock symbol in the local bar and choose "Show certificates" (or choose Properties of the site and click on "Certificates")
- (Optional) Select the certificate you want to trust on the certificate chain (third tab) and open it
- Go to the second tab "Details"
- 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).
-
Now you have several options
- 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. - 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. - Update the system certificate file, by appending the content of your just saved file to
[path-to-git-trust-store-crt-file]
(e.g. bytype [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
- Use a separate certificate trust store which only contains your just downloaded cert, by executing
Done. Now, this certificate is in the trust store of Git for Windows.
New Comment