Use Deep Learning to Restore Landsat 7 Gap Images

I am recently working on fixing the Landsat 7 gaps by using deep learning technique. Because I found that the tools and methods provided by USGS are not very ideal for me.

Depending on your scenarios, USGS give out two solutions:

for display only

for scientific analysis

My idea is simple: use the SLC-on Landsat 7 images and Landsat 5 as training datasets to train a deep neural network (a latest one, maybe ResNet or UNet for image fusion). Use the trained network to fill the gaps in the SLC-off images.

As one of the most accurately corrected remote sensing satellite, the images of Landsat 7 have a lot to discover. But the gaps since 2003 are annoying and have been the major obstacle to let people full utilize it. Hope this method could revive Landsat 7 images in better exploring the Earth dynamics.

Computer automatically open browser and visit a virus redirecting link to ads

In the past half year, I am disturbed by this annoying malware. If I don’t shut down the computer, I will see a new web page is there every morning. I thought it must be a malware and tried a lot of virus protection software. Ironically nothing works.

After numerous times of being frustrated with the automatically popped ads page, I decided to find out it my self and it turns out to be extremely easy. I search my browser history and find that it shows up exactly at 8:49PM every day. This is a scheduled task in computer task library! It is not a malware problem, but a configuration problem. That is why all the virus scan software lose their power.

The solution is straightforward:

right click This PC -> click Manage -> choose Task Scheduler Library. You will see that little bunny task called “PPI Update” which will open a URL “″(ads/malware link, don’t open). Remove this task and the world will become peaceful again.

Issues in installing NVIDIA 390/396 driver on Ubuntu 18.04

Met some strange problems when following this instruction to install NVIDIA-396 driver on Ubuntu 18.04 (kernel 4.15.0-33-generic x86_64). It tells the driver is successfully installed. But when I run:


to check the status. It tells me:

NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

Tried another command:

lsmod | grep nvidia

Nothing is printed out. Definitely, something is wrong. I remove the installed drivers using:

sudo apt remove –purge *nvidia*

Rerun the installation command:

sudo ubuntu-drivers autoinstall

Finally, I found in the log that the installation encountered an error building event :

Error! Bad return status for module build on kernel: 4.15.0-33-generic (x86_64)

Apt suggests to check the make file /var/lib/dkms/nvidia/396.54/build/make.log for details. The tail 300 lines of this file is as follows:

cc -Wp,-MD,/var/lib/dkms/nvidia/396.54/build/nvidia/.nv-frontend.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-linux -gnu/4.8/include -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arc h/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -Iubuntu /include -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wch ar -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -mno-sse -mno-mmx -mno-sse2 -mno-3 dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mtune =generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -DCONFIG_X86_X32_ABI -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNA L_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_AVX512=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -pipe -Wno-sign-compare -fno- asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -DRETPOLINE -fno-delete-null-po inter-checks -O2 -Wno-maybe-uninitialized –param=allow-store-data-races=0 -DCC_HAVE_ASM_GOTO -Wframe-larger-than=10 24 -fstack-protector-strong -fno-omit-frame-pointer -fno-optimize-sibling-calls -pg -I/var/lib/dkms/nvidia/396.54/bu ild/common/inc -I/var/lib/dkms/nvidia/396.54/build -Wall -MD -Wno-cast-qual -Wno-error -Wno-format-extra-args -D__KE RNEL__ -DMODULE -DNVRM -DNV_VERSION_STRING=\”396.54\” -Wno-unused-function -Wuninitialized -fno-strict-aliasing -mno -red-zone -mcmodel=kernel -DNV_UVM_ENABLE -I/var/lib/dkms/nvidia/396.54/build/nvidia -DNV_BUILD_MODULE_INSTANCES=0 – DNVIDIA_UNDEF_LEGACY_BIT_MACROS -UDEBUG -U_DEBUG -DNDEBUG -DMODULE -DKBUILD_BASENAME='”nv_frontend”‘ -DKBUILD_MOD NAME='”nvidia”‘ -c -o /var/lib/dkms/nvidia/396.54/build/nvidia/nv-frontend.o /var/lib/dkms/nvidia/396.54/build/nvidi a/nv-frontend.c
cc -Wp,-MD,/var/lib/dkms/nvidia/396.54/build/nvidia/.nv-instance.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-linux -gnu/4.8/include -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arc h/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -Iubuntu /include -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wch ar -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -mno-sse -mno-mmx -mno-sse2 -mno-3 dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mtune =generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -DCONFIG_X86_X32_ABI -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNA L_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_AVX512=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -pipe -Wno-sign-compare -fno- asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -DRETPOLINE -fno-delete-null-po inter-checks -O2 -Wno-maybe-uninitialized –param=allow-store-data-races=0 -DCC_HAVE_ASM_GOTO -Wframe-larger-than=10 24 -fstack-protector-strong -fno-omit-frame-pointer -fno-optimize-sibling-calls -pg -I/var/lib/dkms/nvidia/396.54/bu ild/common/inc -I/var/lib/dkms/nvidia/396.54/build -Wall -MD -Wno-cast-qual -Wno-error -Wno-format-extra-args -D__KE RNEL__ -DMODULE -DNVRM -DNV_VERSION_STRING=\”396.54\” -Wno-unused-function -Wuninitialized -fno-strict-aliasing -mno -red-zone -mcmodel=kernel -DNV_UVM_ENABLE -I/var/lib/dkms/nvidia/396.54/build/nvidia -DNV_BUILD_MODULE_INSTANCES=0 – DNVIDIA_UNDEF_LEGACY_BIT_MACROS -UDEBUG -U_DEBUG -DNDEBUG -DMODULE -DKBUILD_BASENAME='”nv_instance”‘ -DKBUILD_MOD NAME='”nvidia”‘ -c -o /var/lib/dkms/nvidia/396.54/build/nvidia/nv-instance.o /var/lib/dkms/nvidia/396.54/build/nvidi a/nv-instance.c
cc: error: unrecognized command line option ‘-fstack-protector-strong’
scripts/ recipe for target ‘/var/lib/dkms/nvidia/396.54/build/nvidia/nv-frontend.o’ failed
make[2]: *** [/var/lib/dkms/nvidia/396.54/build/nvidia/nv-frontend.o] Error 1
make[2]: *** Waiting for unfinished jobs….
cc -Wp,-MD,/var/lib/dkms/nvidia/396.54/build/nvidia/.nv.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.8/ include -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arch/x86/inc lude/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -Iubuntu/include -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -Werro r-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno -avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -DCONFIG_X86_X32_ABI -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG _AS_AVX2=1 -DCONFIG_AS_AVX512=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -pipe -Wno-sign-compare -fno-asynchron ous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -DRETPOLINE -fno-delete-null-pointer-che cks -O2 -Wno-maybe-uninitialized –param=allow-store-data-races=0 -DCC_HAVE_ASM_GOTO -Wframe-larger-than=1024 -fstac k-protector-strong -fno-omit-frame-pointer -fno-optimize-sibling-calls -pg -I/var/lib/dkms/nvidia/396.54/build/commo n/inc -I/var/lib/dkms/nvidia/396.54/build -Wall -MD -Wno-cast-qual -Wno-error -Wno-format-extra-args -D__KERNEL__ -D MODULE -DNVRM -DNV_VERSION_STRING=\”396.54\” -Wno-unused-function -Wuninitialized -fno-strict-aliasing -mno-red-zone -mcmodel=kernel -DNV_UVM_ENABLE -I/var/lib/dkms/nvidia/396.54/build/nvidia -DNV_BUILD_MODULE_INSTANCES=0 -DNVIDIA_U NDEF_LEGACY_BIT_MACROS -UDEBUG -U_DEBUG -DNDEBUG -DMODULE -DKBUILD_BASENAME='”nv”‘ -DKBUILD_MODNAME='”nvidia”‘ -c -o /var/lib/dkms/nvidia/396.54/build/nvidia/nv.o /var/lib/dkms/nvidia/396.54/build/nvidia/nv.c
cc: error: unrecognized command line option ‘-fstack-protector-strong’
scripts/ recipe for target ‘/var/lib/dkms/nvidia/396.54/build/nvidia/nv-instance.o’ failed
make[2]: *** [/var/lib/dkms/nvidia/396.54/build/nvidia/nv-instance.o] Error 1
cc: error: unrecognized command line option ‘-fstack-protector-strong’
scripts/ recipe for target ‘/var/lib/dkms/nvidia/396.54/build/nvidia/nv.o’ failed
make[2]: *** [/var/lib/dkms/nvidia/396.54/build/nvidia/nv.o] Error 1
Makefile:1552: recipe for target ‘_module_/var/lib/dkms/nvidia/396.54/build’ failed
make[1]: *** [_module_/var/lib/dkms/nvidia/396.54/build] Error 2
make[1]: Leaving directory ‘/usr/src/linux-headers-4.15.0-33-generic’
Makefile:79: recipe for target ‘modules’ failed
make: *** [modules] Error 2

What is “‘-fstack-protector-strong’“? My instinct tells me it is related to the gcc or g++. After searching in Google, I decide to upgrade the current gcc/g++ from 4.8 to 4.9. Since 4.9 is not available in Ubuntu 18.04 repository yet, I temporarily add the 16.04 repository to the apt source list.

First, add xenial to /etc/apt/sources.list temporarily : sudo gedit /etc/apt/sources.list

deb xenial main
deb xenial universe

and do sudo apt update && sudo apt install g++-4.9See stackflow for details.

Remember to remove the xenial from the sources.list after the installation is done.

Then, remove the old NVIDIA driver

sudo apt remove –purge *nvidia*

and re-install it.

sudo ubuntu-drivers autoinstall

Everything looks fine. Try nvidia-smi, the output is correct this time:

WeChat Screenshot_20180823122141

How to convert PDF to Word

This will be very short. One word: Word. Use MicroSoft Word 2016 to open your PDF file and save as a word docx file.

Don’t be scammed to download all those junk and fake-open-source software like “UniPDF or Nemo or Free PDF-to-Word Converter” from Internet. Don’t install any software from any unknown websites, especially those with all sorts of ads posting everywhere. 99% of their software are virus.

How to install Cloudstack to Ubuntu 18.04 Bionic Beaver

It would be a disaster if you want to install Cloudstack onto Ubuntu 18.04 at this time (one month after its release). All the dependencies are running into incompatible issues and making it impossible to do it. However, in my situation I have to do this right now. I have read all the posts on the web, including Rohit’s blog which is not helping. Thank Robit anyway as I finally found someone facing the same problem.

But I told myself that now is 2018 and no technical issue is unsolvable. The answer is actually simple: docker. Install docker onto Ubuntu 18.04 and install cloudstack inside docker container. Use docker container as either a cloudstack management or a cloudstack agent, according to your choice.

Dell inspiron 15 7000 gaming laptop automatically shutdown after a while

I bought a new Inspiron (honestly, open box at a very good price) and want to run deep learning program on it. I started the program before taking off and left it running for the whole night. When coming back in the morning, it really shocked me when I found it was mysteriously shut down. What the hell? I instantly googled everything about this automatically-shut-down thing and tried all the solutions, but the problem still persists after another night. I almost returned it at that time, but it is a very nice deal and looks really stunning. Will feel very bad since I already spend two days on it and set up the software environment. So I move on to find solutions.

Finally. Long story short, go to the control panel -> power options ->edit plan settings -> change advanced power settings -> turn off hard disk after (set it to never). Problem gone. That’s it.