10/22/2018

Stop cursor blinking

http://www.jurta.org/en/prog/noblink

For cygwin/mintty + emacs blinking cursor issue, it can be solved by:

To stop the cursor from blinking in Micro$oft Windows applications:

Or just navigate to Control Panel / Keyboard, and under "Cursor blink rate" move the slider all the way to the left.

For Google docs:
Install Stylebot extension:
Use:
.kix-cursor-caret {
    border-color: rgb(255,0,0);
border-width: 3px;
}

.kix-cursor {
    -webkit-animation-iteration-count: 0 !important
}

.docs-text-ui-cursor-blink {
  animation-name: none;
}

===
In Firefox, it's possible to type about:config in the url bar, and
create ui.caretBlinkTime with type integer and value 0.

===
For Qt5 applications: https://github.com/igogo/qt5noblink

===
For Mac:
defaults write -g NSTextInsertionPointBlinkPeriodOn -float 99999999
defaults write -g NSTextInsertionPointBlinkPeriodOff -float 99999999
defaults write -g NSTextInsertionPointBlinkPeriod -float 3600000


10/17/2018

How to get buildifier: the BAZEL BUILD file formatter

  1. Install Go:
Install Go Development Kit on Mac:
Install Go in ubuntu:
Follow    https://golang.org/doc/install#install
mkdir ~/go
    echo export GOPATH=${HOME}/go >> ~/.bashrc
    source ~/.bashrc
2. Install Buildifier by:
go get github.com/bazelbuild/buildtools/buildifier
This will put the buildifier in ~/go/bin/buildifier in mac, go/bin in ubuntu

6/10/2018

How to fix face of a girl by using photoshop

1. Use liquidify to fix the shape of the face
2. Use Alt + click to select a color and paint tool to cover some unwanted colors. Use dodge tool or burn tool to change the exposure of the touched areas.
3. Use the technique in this video: https://www.youtube.com/watch?v=Qw5dUVTmzro. To summarize: separate low frequency and high frequency.
To get low frequency: copy the layer and use Gaussian blur
To get high frequency: copy the layer | Image | Apply Image | select the low frequency layer, blending: substract, scale 2, offset 128. Then change the blending mode to Linear Light for the high frequency layer.
Done.

6/07/2018

Understand Ellipsoid, Geoid, NAVD 88, WGS 84 etc, oh my


Very related reading: https://www.groundcontrolpoints.com/

How do geoids relate to datums?
Undulation values represent the distance along the ellipsoidal normal from the ellipsoid to the geoid.  As such, each geoid is referenced to a specific ellipsoid and datum.  For example, the
Geoid96/Geoid99/Geoid03 undulations are all relative to NAD83, while EGM96 is relative to WGS84.  It is important that the correct datum be selected when using a geoid for MSL height input or output since the horizontal position will determine the undulation value applied.  Where
the difference between datums is small, such as WGS84 and ITRF, the error will be negligible given the grid spacing of the geoid, but for other datums, such as NAD27 and NAD83, the differences are too large to ignore.


https://kknews.cc/world/lknzeo2.html
https://gisgeography.com/vertical-datum/
http://www.lidarmag.com/PDF/LiDARNewsMagazine_Kessler-ImportanceOfDatumsInMapping_Vol4No5.pdf



4/30/2018

Fix Ubuntu doesn't sleep after closing the computer lid

Add
sudo su <
echo LID0 > /proc/acpi/wakeup && echo XHC1 > /proc/acpi/wakeup && echo ARPT > /proc/acpi/wakeup                                      
EOF

To /etc/rc.local file.




4/26/2018

After installing Ubuntu: what else to do? Install Ubuntu, Install Linux

  • http://liangzou.blogspot.com/2018/01/how-to-install-latest-cinnamon-on.html
  • If automatic login wants to be enabled (login Ubuntu without using the password): sudo apt install gnome-system-tools, then start the new Users and Groups application to enable the automatic login
  • Fix Desktop: sudo apt remove nautilus
  • sudo apt install vim
  • Install Sougou shuangpin (need to disable cloud pinyin)
  • Install Collapsible Systray (Right click on panel, Add applets, need to hide fcitx and sougou icons)
  • Fix touchpad:
    • sudo emacs /usr/share/X11/xorg.conf.d/70-synaptics.conf. Comment out Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0
  • gnome terminal tab bar height too high
  • title bar too high: go to settings | Themes | Windows boarders, choose Ambiance
  • Install git & bazel: https://docs.bazel.build/versions/master/install-ubuntu.html
  • Install git-review by using pip install git-review, DO NOT use sudo apt install git-review (too old)
  • Install the good theme: sudo apt-get install numix-gtk-theme numix-icon-theme
  • Disable the audible bell by signing out of Cinnamon and signing in to the default desktop environment. Setting | Sound | Disable Alert volume
  • Add keyboard short:
    • ctrl + shift + Y to gnome-terminal --title=Python -e "/home/liangzou/.pyenv/shims/python"
    • ctrl + shift + A to slack
    • Disable super + shift + S key: right click on the speaker | configure | Remove the show menu hotkey
    • super + shift + S to /home/liangzou/bin/screenshot.sh (content below)
      • #!/bin/sh
      • sleep 0.125
      • gnome-screenshot --area -c
  • Install the MSYH.ttc font: download the font to /usr/share/fonts/windows/, then run: fc-cache
  • Download from OneDrive: ubuntu_home/bin-scripts.tgz and put to ~/bin/, then set up shortcuts.
  • To make the notification settings better: sudo emacs /usr/share/cinnamon/js/ui/messageTray.js and change var NOTIFICATION_TIMEOUT = 86400;
  • Fix the scrolling stop after suspend issue:
#!/bin/sh
if [ $1 = post ] && [ $2 = suspend ]
then /home/liangzou/bin/fix-mouse-arc.sh
fi

Content of fix-mouse-arc.sh:

 #!/bin/bash

sudo service bluetooth restart

  

 

4/16/2018

How to fix grub after upgrading Macbook pro - reinstalling grub

Followed the last step in this post: 

Mac Pro cannot boot


Press Alt while restarting the system with the USB drive inserted. The USB should contain a Ubuntu system.

Run boot-repair by logging into Ubuntu (using a USB if the installed version is broken). After running the fix, I have to use the GRUB menu to start the windows, not the original Alt + Power and select Windows way.

https://help.ubuntu.com/community/Boot-Repair