Disqus search unstable

After seeing that it was being unresponsive, I logged into my AWS and restarted the damn thing and it worked again, but still it’s not giving back all 4000+ comments of BobSykes or 3000+ of Gantal, etc. Instead we only like like 279 or 60. Same for the other endpoint at which it’s deployed, which has not ever crashed since deployed almost four months ago, unlike AWS which I’ve had to restart twice: https://pacific-waters-11622.herokuapp.com. As for not giving back all the comments, Disqus must have changed their API.

I’m busy busy busy no time to debug this. Whoever wants to take over please contact me. I’ve put the code on Github but it’s still private which means nobody except me can see it.

And I’m also hardly ever reading English anymore unless for work and even at work I try to avoid it, which means minimal searches in English, especially on Bing or Google. Disqus is also behind the Chinese firewall. So more reason not to care about it, especially that I have more meaningful things to do now.

Whoever wants to read my blog from now on will probably have to learn Russian or Chinese (or use some online translate service).

Advertisements

如何在国内跑Kubernetes的minikube

minikube start老是被卡住,得到如以下的结果

yunhenyanshideMacBook-Pro:~ yunhenyanshi$ minikube start
😄  minikube v1.2.0 on darwin (amd64)
💡  Tip: Use 'minikube start -p ' to create a new cluster, or 'minikube delete' to delete this one.
🏃  Re-using the currently running virtualbox VM for "minikube" ...
⌛  Waiting for SSH access ...
🐳  Configuring environment for Kubernetes v1.15.0 on Docker 18.09.6
E0805 20:53:39.879197   55701 start.go:403] Error caching images:  Caching images for kubeadm: caching images: caching image /Users/yunhenyanshi/.minikube/cache/images/k8s.gcr.io/k8s-dns-kube-dns-amd64_1.14.13: fetching remote image: Get https://k8s.gcr.io/v2/: dial tcp 64.233.187.82:443: i/o timeout
❌  Unable to load cached images: loading cached images: loading image /Users/yunhenyanshi/.minikube/cache/images/k8s.gcr.io/kube-controller-manager_v1.15.0: stat /Users/yunhenyanshi/.minikube/cache/images/k8s.gcr.io/kube-controller-manager_v1.15.0: no such file or directory
🔄  Relaunching Kubernetes v1.15.0 using kubeadm ...

查百度只得到加个参数

minikube start --registry-mirror=https://registry.docker-cn.com

也不解决这个问题。查了半天,试了半天还是不行,终于灵活起来了,

localhost:k8s.gcr.io yunhenyanshi$ minikube --help
Minikube is a CLI tool that provisions and manages single-node Kubernetes clusters optimized for development workflows.

Usage:
  minikube [command]

Available Commands:
  addons         Modify minikube's kubernetes addons
  cache          Add or delete an image from the local cache.
  completion     Outputs minikube shell completion for the given shell (bash or zsh)
  config         Modify minikube config
  dashboard      Access the kubernetes dashboard running within the minikube cluster
  delete         Deletes a local kubernetes cluster
  docker-env     Sets up docker env variables; similar to '$(docker-machine env)'
  help           Help about any command
  ip             Retrieves the IP address of the running cluster
  kubectl        Run kubectl
  logs           Gets the logs of the running instance, used for debugging minikube, not user code
  mount          Mounts the specified directory into minikube
  profile        Profile gets or sets the current minikube profile
  service        Gets the kubernetes URL(s) for the specified service in your local cluster
  ssh            Log into or run a command on a machine with SSH; similar to 'docker-machine ssh'
  ssh-key        Retrieve the ssh identity key path of the specified cluster
  start          Starts a local kubernetes cluster
  status         Gets the status of a local kubernetes cluster
  stop           Stops a running local kubernetes cluster
  tunnel         tunnel makes services of type LoadBalancer accessible on localhost
  update-check   Print current and latest version number
  update-context Verify the IP address of the running cluster in kubeconfig.
  version        Print the version of minikube

Flags:
      --alsologtostderr                  log to standard error as well as files
  -b, --bootstrapper string              The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm")
  -h, --help                             help for minikube
      --log_backtrace_at traceLocation   when logging hits line file:N, emit a stack trace (default :0)
      --log_dir string                   If non-empty, write log files in this directory
      --logtostderr                      log to standard error instead of files
  -p, --profile string                   The name of the minikube VM being used.  
                                         	This can be modified to allow for multiple minikube instances to be run independently (default "minikube")
      --stderrthreshold severity         logs at or above this threshold go to stderr (default 2)
  -v, --v Level                          log level for V logs
      --vmodule moduleSpec               comma-separated list of pattern=N settings for file-filtered logging
Use "minikube [command] --help" for more information about a command.
localhost:k8s.gcr.io yunhenyanshi$ minikube start -h
Starts a local kubernetes cluster using VM. This command
assumes you have already installed one of the VM drivers: virtualbox/parallels/vmwarefusion/kvm/xhyve/hyperv.

Usage:
  minikube start [flags]

Flags:
      --apiserver-ips ipSlice             A set of apiserver IP Addresses which are used in the generated certificate for kubernetes.  This can be used if you want to make the apiserver available from outside the machine (default [])
      --apiserver-name string             The apiserver name which is used in the generated certificate for kubernetes.  This can be used if you want to make the apiserver available from outside the machine (default "minikubeCA")
      --apiserver-names stringArray       A set of apiserver names which are used in the generated certificate for kubernetes.  This can be used if you want to make the apiserver available from outside the machine
      --apiserver-port int                The apiserver listening port (default 8443)
      --cache-images                      If true, cache docker images for the current bootstrapper and load them into the machine. Always false with --vm-driver=none. (default true)
      --container-runtime string          The container runtime to be used (docker, crio, containerd) (default "docker")
      --cpus int                          Number of CPUs allocated to the minikube VM (default 2)
      --cri-socket string                 The cri socket path to be used
      --disable-driver-mounts             Disables the filesystem mounts provided by the hypervisors (vboxfs, xhyve-9p)
      --disk-size string                  Disk size allocated to the minikube VM (format: [], where unit = b, k, m or g) (default "20g")
      --dns-domain string                 The cluster dns domain name used in the kubernetes cluster (default "cluster.local")
      --docker-env stringArray            Environment variables to pass to the Docker daemon. (format: key=value)
      --docker-opt stringArray            Specify arbitrary flags to pass to the Docker daemon. (format: key=value)
      --download-only                     If true, only download and cache files for later use - don't install or start anything.
      --enable-default-cni                Enable the default CNI plugin (/etc/cni/net.d/k8s.conf). Used in conjunction with "--network-plugin=cni"
      --extra-config ExtraOption          A set of key=value pairs that describe configuration that may be passed to different components.
                                          		The key should be '.' separated, and the first part before the dot is the component to apply the configuration to.
                                          		Valid components are: kubelet, kubeadm, apiserver, controller-manager, etcd, proxy, scheduler
                                          		Valid kubeadm parameters: ignore-preflight-errors, dry-run, kubeconfig, kubeconfig-dir, node-name, cri-socket, experimental-upload-certs, certificate-key, rootfs, pod-network-cidr
      --feature-gates string              A set of key=value pairs that describe feature gates for alpha/experimental features.
      --gpu                               Enable experimental NVIDIA GPU support in minikube (works only with kvm2 driver on Linux)
  -h, --help                              help for start
      --hidden                            Hide the hypervisor signature from the guest in minikube (works only with kvm2 driver on Linux)
      --host-only-cidr string             The CIDR to be used for the minikube VM (only supported with Virtualbox driver) (default "192.168.99.1/24")
      --hyperkit-vpnkit-sock string       Location of the VPNKit socket used for networking. If empty, disables Hyperkit VPNKitSock, if 'auto' uses Docker for Mac VPNKit connection, otherwise uses the specified VSock.
      --hyperkit-vsock-ports strings      List of guest VSock ports that should be exposed as sockets on the host (Only supported on with hyperkit now).
      --hyperv-virtual-switch string      The hyperv virtual switch name. Defaults to first found. (only supported with HyperV driver)
      --image-mirror-country string       Country code of the image mirror to be used. Leave empty to use the global one. For Chinese mainland users, set it to cn
      --image-repository string           Alternative image repository to pull docker images from. This can be used when you have limited access to gcr.io. Set it to "auto" to let minikube decide one for you. For Chinese mainland users, you may use local gcr.io mirrors such as registry.cn-hangzhou.aliyuncs.com/google_containers
      --insecure-registry strings         Insecure Docker registries to pass to the Docker daemon.  The default service CIDR range will automatically be added.
      --iso-url string                    Location of the minikube iso (default "https://storage.googleapis.com/minikube/iso/minikube-v1.2.0.iso")
      --keep-context                      This will keep the existing kubectl context and will create a minikube context.
      --kubernetes-version string         The kubernetes version that the minikube VM will use (ex: v1.2.3) (default "v1.15.0")
      --kvm-network string                The KVM network name. (only supported with KVM driver) (default "default")
      --memory int                        Amount of RAM allocated to the minikube VM in MB (default 2048)
      --mount                             This will start the mount daemon and automatically mount files into minikube
      --mount-string string               The argument to pass the minikube mount command on start (default "/Users:/minikube-host")
      --network-plugin string             The name of the network plugin
      --nfs-share strings                 Local folders to share with Guest via NFS mounts (Only supported on with hyperkit now)
      --nfs-shares-root string            Where to root the NFS Shares (defaults to /nfsshares, only supported with hyperkit now) (default "/nfsshares")
      --no-vtx-check                      Disable checking for the availability of hardware virtualization before the vm is started (virtualbox)
      --registry-mirror strings           Registry mirrors to pass to the Docker daemon
      --service-cluster-ip-range string   The CIDR to be used for service cluster IPs. (default "10.96.0.0/12")
      --uuid string                       Provide VM UUID to restore MAC address (only supported with Hyperkit driver).
      --vm-driver string                  VM driver is one of: [virtualbox parallels vmwarefusion kvm xhyve hyperv hyperkit kvm2 vmware none] (default "virtualbox")
      --xhyve-disk-driver string          The disk driver to use [ahci-hd|virtio-blk] (only supported with xhyve driver) (default "ahci-hd")

Global Flags:
      --alsologtostderr                  log to standard error as well as files
  -b, --bootstrapper string              The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm")
      --log_backtrace_at traceLocation   when logging hits line file:N, emit a stack trace (default :0)
      --log_dir string                   If non-empty, write log files in this directory
      --logtostderr                      log to standard error instead of files
  -p, --profile string                   The name of the minikube VM being used.  
                                         	This can be modified to allow for multiple minikube instances to be run independently (default "minikube")
      --stderrthreshold severity         logs at or above this threshold go to stderr (default 2)
  -v, --v Level                          log level for V logs
      --vmodule moduleSpec               comma-separated list of pattern=N settings for file-filtered logging
localhost:k8s.gcr.io yunhenyanshi$ 

我这傻逼没早想到在终端里的minikube弄个help,毕竟这样说已被搜索结果所建议的--registry-mirror=https://registry.docker-cn.com所暗示,也没想到查了”mainland china minikube”之类的,英语在谷歌查这个能把我带到
https://www.kkito.cn/posts/2019-05-29/kubernetes%E5%AD%A6%E4%B9%A01-%E4%BD%BF%E7%94%A8minikube%E5%AE%89%E8%A3%85kubectl.html以及在百度上搜到的https://www.jianshu.com/p/ba7dd2d04ae3所包含的在github上的minikube的源代码对对应的参数的实现及解释,其为

startCmd.Flags().String(imageRepository, "", "Alternative image repository to pull docker images from. This can be used when you have limited access to gcr.io. For Chinese mainland users, you may use local gcr.io mirrors such as registry.cn-hangzhou.aliyuncs.com/google_containers")

好多我查到的结果(它们好多都是2017-8年的吧)只包含--registry-mirror=https://registry.docker-cn.com而非关键的--image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers,这才是问题解决的根本。

yunhenyanshideMacBook-Pro:k8s.gcr.io yunhenyanshi$ minikube start --vm-driver=none --registry-mirror=https://registry.docker-cn.com --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers
😄  minikube v1.2.0 on darwin (amd64)
✅  using image repository registry.cn-hangzhou.aliyuncs.com/google_containers

⚠️  Ignoring --vm-driver=none, as the existing "minikube" VM was created using the virtualbox driver.
⚠️  To switch drivers, you may create a new VM using `minikube start -p  --vm-driver=none`
⚠️  Alternatively, you may delete the existing VM using `minikube delete -p minikube`

🏃  Re-using the currently running virtualbox VM for "minikube" ...
⌛  Waiting for SSH access ...
🐳  Configuring environment for Kubernetes v1.15.0 on Docker 18.09.6
🔄  Relaunching Kubernetes v1.15.0 using kubeadm ... 
🤹  Configuring local host environment ...

⚠️  The 'none' driver provides limited isolation and may reduce system security and reliability.
⚠️  For more information, see:
👉  https://github.com/kubernetes/minikube/blob/master/docs/vmdriver-none.md

⚠️  kubectl and minikube configuration will be stored in /Users/yunhenyanshi
⚠️  To use kubectl or minikube commands as your own user, you may
⚠️  need to relocate them. For example, to overwrite your own settings:

    ▪ sudo mv /Users/yunhenyanshi/.kube /Users/yunhenyanshi/.minikube $HOME
    ▪ sudo chown -R $USER $HOME/.kube $HOME/.minikube

💡  This can also be done automatically by setting the env var CHANGE_MINIKUBE_NONE_USER=true
⌛  Verifying: apiserver proxy etcd scheduler controller dns
🏄  Done! kubectl is now configured to use "minikube"
yunhenyanshideMacBook-Pro:k8s.gcr.io yunhenyanshi$ 

希望我这个博文得到一些点击,帮一些中国的程序员节省一些时间!


若被以下的iso下载卡住,那是因为它在试从谷歌的https://storage.googleapis.com/minikube/iso/minikube-v1.2.0.iso下载,先下载它,再将它复制到~/.minikube/cache/iso

yunhenyanshideMacBook-Pro:kubernetes-ci-cd yunhenyanshi$ minikube start --registry-mirror=https://registry.docker-cn.com --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers
😄  minikube v1.2.0 on darwin (amd64)
✅  using image repository registry.cn-hangzhou.aliyuncs.com/google_containers
💿  Downloading Minikube ISO ..

然后(在不翻墙的情况下)跑
minikube start --registry-mirror=https://registry.docker-cn.com --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers

可能得试个一俩三次,着不太稳定。

可参考http://muziyuchen.com/kubernetes-2/

Updated my pages of Chinese red songs and Soviet red songs

They are at https://gmachine1729.com/lists/%e4%b8%ad%e5%9b%bd%e7%ba%a2%e6%ad%8c/ and https://gmachine1729.com/lists/%d1%81%d0%be%d0%b2%d0%b5%d1%82%d1%81%d0%ba%d0%b8%d0%b5-%d0%bf%d0%b5%d1%81%d0%bd%d0%b8/.

Additionally I made recently a page of DPRK music videos and films/parades (like The Flower Girl) but this one is quite short and incomplete for now.

Before I basically just a list of links of online videos. Since Russia doesn’t really have its own video site, the Russian ones were all YouTube, and the Chinese ones were half YouTube, half Chinese video sites. I have been aware that WordPress automatically embeds YouTube videos, so it occurred to me that I could with some JavaScript code within the browser pull out all the hrefs with youtube.com. I looked up https://zhidao.baidu.com/question/1239977170942371939.html with some code and based on it I ran

hrefArr = document.getElementsByTagName('a');
for( var i=0; i<hrefArr.length; i++ ){
  if (hrefArr[i].href.indexOf("youtube") > -1) { 
    console.log(hrefArr[i].href)
  }
}

to get

2019-07-09 下午9.28.06

copy pasting the printed urls into a text editor and a s/VM802:1/ and copy pasting the result back into the WordPress editor did the trick.

2019-07-09 下午9.42.01

And yes for the Chinese ones, for all the ones without YouTube links, I found a YouTube video of that song, added it, and when finished with the manual searching and adding, reran the extract and embed all youtube urls process described above.

The result (scrolled screenshot taken via this Nimbus browser plugin):

chinese-red-songs-youtube-embedded-list-part1chinese-red-songs-youtube-embedded-list-part2

Apparently, Google can be an inferior search engine

2019-05-14 下午9.59.292019-05-14 下午9.59.342019-05-14 下午9.59.432019-05-14 下午10.22.07

2019-05-14 下午9.59.53

Of Google, Bing, Yahoo, and DuckDuckGo, Google’s the only one not displaying my disqussearch.com on the first page on querying “disqus comment search” or “disqus search.”

On this, I commented

I thought that Google’s search results are supposed to “far exceed the rest”

Somebody else responded

I don’t think they do anymore. Search is a commodity and they have brand recognition, which is all they need.

But not in China, where they are banned, which means to use any of their services, I have to use a VPN. Just goes to show how more often than not, political power trumps everything.

 

Crossposting to LiveJournal

Using https://wordpress.org/plugins/lj-xp/ I was able to do so not only for some individual entries (it auto cross posted categories too) but also for a bulk of my earliest entries (from back in 2017). However, the 2018 ones and 2019 ones didn’t get cross-posted. I got a timeout with Nginx 500. This was when I clicked on some Update options and cross post all older entries in the settings.

Great tool/plugin. Much appreciation to Stephanie Leary, and the other names involved in the project for their time and effort!

What!? LiveJournal is actually owned by Russian company now? (and has been for a while)

I had noticed before that LiveJournal was more “Russian” than usual. Only today did I find out that it’s actually owned by a Russian company, hosted in Russia.

How did I find out? Well, it occurred to me that I might want to back up this blog more. Fault tolerance, high availability, single point of failure (SPOF), blah blah blah all those distributed systems buzzwords. I’m just one person. I could suddenly end up gone. WordPress could also potentially forcibly shut down this site.

So I asked somebody to possibly replicate some of the stuff on here on Sina. I did make another WordPress under the suggestion that me and a few others create a joint blog, but nothing’s come out of that. So yes, another WordPress helps too, but that’s not as diverse. Ideally, make a github.io (I already have one, and have hardly anything on there) with version control and pull requests. I didn’t have the time/energy and plus there is value in concentrating and accumulating more into one place, as far as media goes.

Continue reading “What!? LiveJournal is actually owned by Russian company now? (and has been for a while)”

Enabled HTTPS for disqussearch.com

Thanks to Jesse Zhang (who I learned is a 2x MOSPer + Harvard CS 18 + interned at Google and Citadel) for making this very straightforward for me by writing and publishing the following document, which I easily found: https://hackernoon.com/how-to-set-up-https-for-your-domain-on-aws-8f771686603d.

I saw that he founded camelot.ai, a YC backed startup, which he advertised in that. Michael O Church hates YC and Paul Graham for classism, ageism, sexism, promoting founder-engineer divide, etc. I won’t really comment on that, have too little experience with them, but I guess I would naturally be suspicious of them.

Continue reading “Enabled HTTPS for disqussearch.com”

I finally used Docker and Amazon Elastic Beanstalk (to deploy Disqus comment search service)

For those of you who don’t want to read this, I have my Disqus comment search deployed now, at disqussearch.com.

From now on, I’ll give an outline of my experience deploying my Disqus comment search web app.

Heroku

I had deployed the Disqus comment search web service I developed on Heroku, with the endpoint being https://pacific-waters-11622.herokuapp.com. What I didn’t expect was to end up blocked on account verification (now I’m pretty sure it’s almost certainly not my problem, since a similar procedure has worked on others), especially given that Heroku is pretty large and established, now a Salesforce company.

So that led me to try AWS. I made an account (it’s kind of a shame that I never cared enough about software engineering to have already made one long ago) and with some looking up info online plus trial and error I got it deployed on Amazon Elastic Beanstalk. As for details, I developed this in Scala using Scalatra and when testing locally, it was powered by Jetty web server, which I ran in sbt. For Heroku all I had to do, after incorporating a

JettyLauncher.scala

Continue reading “I finally used Docker and Amazon Elastic Beanstalk (to deploy Disqus comment search service)”

Ron Maimon on Disqus

I used my Disqus comment search to get all of Ron Maimon’s comments on there. His username is “ronmaimon” as you can verify through https://disqus.com/by/ronmaimon/. For those of you who see this, make sure to be exact on username. So, if you search “ron maimon” (with a space) you will get back something like “No Disqus user with username ron maimon.” I will soon make it such that you can disregard capitalization, which means the system will detect for instance that RonMaimon matches to username ronmaimon.