Skip to content

Instantly share code, notes, and snippets.

View zhimoe's full-sized avatar
🎯
Focusing

zhimoe zhimoe

🎯
Focusing
View GitHub Profile
@zhimoe
zhimoe / rime输入法配置.md
Last active January 31, 2021 07:50
rime输入法配置
@zhimoe
zhimoe / go_search_file.go
Last active June 14, 2020 10:46
go_search_file
package main
import (
"bufio"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"strings"
@zhimoe
zhimoe / notes_programming_in_scala.md
Created March 30, 2019 16:24 — forked from jamesyang124/notes_programming_in_scala.md
Notes for programming in Scala 2nd edition.

#Note for Programming in Scala


##Chp.0 SBT & Scala Interpreter

  1. Call scala interpreter by sbt.

    // enter scala interpreter
@zhimoe
zhimoe / bash-prepend-text-into-file.sh
Created March 17, 2019 15:23
bash-prepend-text-into-file
for i in *; do if [ ${i: -3} == ".md" ];
then echo "---
title: '"${i::-3}"'
date: 2019-01-01
tags:
- java
- code
---
$(cat $i)" > $i;
@zhimoe
zhimoe / WSL-ssh-server.md
Created February 24, 2019 03:16 — forked from dentechy/WSL-ssh-server.md
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change PasswordAuthentication to yes. This can be changed back to no if ssh keys are setup.
  2. Restart the ssh server:
    • sudo service ssh --full-restart
  3. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on:
@zhimoe
zhimoe / elasticsearch-6.5-sample-data.json
Created January 20, 2019 16:15
elasticsearch 6 sample data
#PUT entinfoindex
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0,
"index": {
"analysis": {
"analyzer": {
"default": {
"tokenizer": "ik_smart"
@zhimoe
zhimoe / gh-pages-deploy.md
Created October 20, 2018 11:34 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@zhimoe
zhimoe / wsl-install-spark.sh
Created September 10, 2018 14:05
win 10 wsl install spark
# 1. change source.list in /etc/apt/
sudo apt update &&
sudo apt install openjdk-8-jdk-headless openjdk-8-jre-headless git unzip vim maven scala -y
#for multi java version
sudo update-alternatives --config java
sudo vim /etc/profile.d/xiongdahu.env.sh
#put these line in xiongdahu.env.sh
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre
eclipse -application org.eclipse.equinox.p2.artifact.repository.mirrorApplication -source https://spotbugs.github.io/eclipse/ -destination .\spotbugs
eclipse -application org.eclipse.equinox.p2.metadata.repository.mirrorApplication -source https://spotbugs.github.io/eclipse/ -destination .\spotbugs


eclipse -application org.eclipse.equinox.p2.artifact.repository.mirrorApplication -source https://ecd-plugin.github.io/update/ -destination .\ecd
eclipse -application org.eclipse.equinox.p2.metadata.repository.mirrorApplication -source https://ecd-plugin.github.io/update/ -destination .\ecd
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>xiong.dahu</groupId>
<artifactId>scalamvn</artifactId>
<version>1.0-SNAPSHOT</version>