Saturday, 3 October 2020

Docker Tinkering: Troubleshoot Is the docker daemon running? Problem

 Got this error:

$ sudo docker build -t name:version .

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

ERRO[0000] failed to dial gRPC: cannot connect to the Docker daemon. Is 'docker daemon' running on this host?: dial unix /var/run/docker.sock: connect: connection refused 

Also problem can be seen down below:

$ sudo service docker status

● docker.service

   Loaded: masked (/dev/null; bad)

   Active: inactive (dead) since Fri 2020-10-02 13:34:41 EDT; 1 day 7h ago

 Main PID: 32072 (code=exited, status=0/SUCCESS)


Solution:

$ sudo systemctl unmask docker

Removed /etc/systemd/system/docker.service.

$ sudo systemctl start docker

$ sudo service docker status

● docker.service - Docker Application Container Engine

   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: e

   Active: active (running) since Sat 2020-10-03 21:28:48 EDT; 3s ago

     Docs: https://docs.docker.com

 Main PID: 11763 (dockerd)

    Tasks: 16

   CGroup: /system.slice/docker.service

           └─11763 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/contai


ref:

https://stackoverflow.com/questions/44678725/cannot-connect-to-the-docker-daemon-at-unix-var-run-docker-sock-is-the-docker

Tuesday, 1 September 2020

Tinkering OpenWRT (20) : Flash Compiled Image

Step 1: 

After compiling, the bin file should be located in :
openwrt/bin/ramips/openwrt-ramips-mt7620-XXXXX-squashfs-sysupgrade.bin

Step 2:

Copy the bin file to board 
scp openwrt-ramips-mt7620-XXXXX-squashfs-sysupgrade.bin root@192.168.1.1:/tmp

Step 3:
Login board, ether via UART or Ethernet

Step 4:
cd /tmp
# make sure the file transfer is completed 
md5sum openwrt-ramips-mt7620-xiaomi-miwifi-mini-squashfs-sysupgrade.bin 
mtd -r write openwrt-ramips-mt7620-xiaomi-miwifi-mini-squashfs-sysupgrade.bin firmware

Wait for it to finish...

Friday, 7 August 2020

apt-get install stuck issue

I was trying to install nutstore but too bad it is discontinued and I am stuck at this error.

Setting up nautilus-nutstore (3.1.0) ...
fetching Nutstore distribution package...
--2020-08-08 01:21:23-- http://jianguoyun.com/static/exe/installer/nutstore_linux_dist_x64.tar.gz
Resolving jianguoyun.com (jianguoyun.com)... 13.75.93.73
Connecting to jianguoyun.com (jianguoyun.com)|13.75.93.73|:80...

The problem is, what ever new things I want to install, apt-get will end up stuck here.

Solution:
$ sudo apt-get remove nautilus-nutstore

Friday, 24 July 2020

To convert a bare repo to a normal one


To convert a bare repo to a normal one:
$ git clone -l <path_to_bare_repo> <new_normal_repo>

Friday, 3 July 2020

Tinkering OpenWRT (19) : HiLink 7866A Serial Login

I don't want to figure this out again, so here it is:

- Use COM0
- screen /dev/ttyUSB0 57600

Thursday, 30 April 2020

Install Ubuntu Dual Boot on Dell with SATA Harddirve

I was installing ubuntu on a new Dell machine with SATA. I booted into the Ubuntu Live USB but at the partitioning part I could only see /dev/sda which is just my USB drive. Where is my hard drive??!!

Here is the fix or prevention...so that you won't just change the SATA setting and lose windows. Then it will be a bit hard to fix.

  1. In Windows, run Command Prompt as admin
  2. Invoke a Safe Mode boot with the command: bcdedit /set {current} safeboot minimal
  3. Restart the PC and enter your BIOS during bootup.
  4. Change from IDE to AHCI mode then Save & Exit.
  5. Windows 10 will launch in Safe Mode.
  6. Right click the Window icon and select to run the Command Prompt in Admin mode from among the various options.
  7. Cancel Safe Mode booting with the command: bcdedit /deletevalue {current} safeboot
  8. Restart your PC once more and this time it will boot up normally but with AHCI mode activated.

Wednesday, 11 March 2020

Error "error: dpkg frontend is locked by another process"


sudo rm /var/lib//dpkg/lock
sudo dpkg --configure -a

ref:
https://www.ostechnix.com/how-to-fix-e-could-not-get-lock-var-lib-dpkg-lock-error-on-ubuntu/
https://www.youtube.com/watch?v=7GQIY37vPQ4

Toubleshoot Sogou Pinying Installing


sudo dpkg -i sogoupinyin_2.2.0.0108_amd64.deb

And got the following problem:

boris@boris-desktop:~$ sudo dpkg -i ~/Downloads/sogoupinyin_2.3.1.0112_amd64.deb
(Reading database ... 129112 files and directories currently installed.)
Preparing to unpack .../sogoupinyin_2.3.1.0112_amd64.deb ...
Unpacking sogoupinyin (2.3.1.0112) over (2.3.1.0112) ...
dpkg: dependency problems prevent configuration of sogoupinyin:
 sogoupinyin depends on libqtwebkit4; however:
  Package libqtwebkit4 is not installed.
 sogoupinyin depends on libopencc2 | libopencc1; however:
  Package libopencc2 is not installed.
  Package libopencc1 is not installed.
 sogoupinyin depends on fcitx-libs | libfcitx-qt0; however:
  Package fcitx-libs is not installed.
  Package libfcitx-qt0 is not installed.

dpkg: error processing package sogoupinyin (--install):
 dependency problems - leaving unconfigured
Processing triggers for libglib2.0-0:amd64 (2.56.4-0ubuntu0.18.04.4) ...
No such key 'Gtk/IMModule' in schema 'org.gnome.settings-daemon.plugins.xsettings' as specified in override file '/usr/share/glib-2.0/schemas/50_sogoupinyin.gschema.override'; ignoring override for this key.
Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for shared-mime-info (1.9-2) ...
Processing triggers for fontconfig (2.12.6-0ubuntu2) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Errors were encountered while processing:
 sogoupinyin

Solution:
sudo apt --fix-broken install



ref:

Saturday, 22 February 2020

Android Studio ERROR: SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

I was trying to import a project and I got the following error when building gradle:

ERROR: SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

Solution:
- Find the file local.properties in ./app folder where gradle files like build and build.gradle live.
- Copy your local.properties file to the folder to the root folder where the project is stored.

ref:
https://stackoverflow.com/questions/27620262/sdk-location-not-found-define-location-with-sdk-dir-in-the-local-properties-fil