Skip to main content

8 posts tagged with "tool"

View All Tags

· One min read

intro

# install
npm i -g @slidev/cli

# open
slidev test.md
# http://localhost:3030/

cli

  • dev: "slidev example.md",
  • build: "slidev build example.md",
  • export: "slidev export example.md",
  • screenshot: "slidev export example.md --format png"

demo file

---
theme: default
---

# Slidev

Hello World

---

# Page 2

Directly use code blocks for highlighting

```ts
console.log('Hello, World!')

Page 3


· One min read

Intro

本站使用 博客系统hugo,搭配主题hugo-book

Start

# 本地测试
hugo server -w

# add
hugo new posts/xxx.md

Guide

Intro
Install
Start

Packages
Contributing

About
License

Test

{{< tabs "uniqueid" >}} {{< tab "MacOS" >}} # MacOS Content {{< /tab >}} {{< tab "Linux" >}} # Linux Content {{< /tab >}} {{< tab "Windows" >}} # Windows Content {{< /tab >}} {{< /tabs >}}

百度统计

自定义 layouts/partials/docs/inject/footer.html

· One min read

Intro

快速可自定义的虚拟机,几行命令搞定,不用再设置一堆东西。 自定义文件Vagrantfile实现环境重复利用 https://www.vagrantup.com/intro

Install

https://www.vagrantup.com/downloads
# wget https://releases.hashicorp.com/vagrant/2.2.19/vagrant_2.2.19_x86_64.msi

Start

vagrant init generic/alpine312  # https://vagrantcloud.com/search

vagrant up --provider=hyperv # start
vagrant halt # stop

vagrant ssh

vagrant destroy # delete

Other

vagrant box list                # list image
vagrant global-status # list vm
vagrant destroy 1a2b3c4d

# 手动下包 wget https://app.vagrantup.com/generic/boxes/alpine312/versions/3.6.4/providers/hyperv.box
vagrant box add my/alpine312 hyperv.box

# 127.0.0.1:2222 # root vagrant

Vagrantfile

# touch Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "generic/alpine312"
end

· One min read

clash

# install win mac
https://github.com/Fndroid/clash_for_windows_pkg/releases
https://github.com/Fndroid/clash_for_windows_pkg/releases/download/0.19.12/Clash.for.Windows.Setup.0.19.12.exe
D:\clash

# setting
https://docs.cfw.lbyczf.com/contents/quickstart.html
https://portal.shadowsocks.nz/knowledgebase/182/

# shell
host_ip=$(cat /etc/resolv.conf |grep "nameserver" |cut -f 2 -d " ")
export ALL_PROXY="http://$host_ip:7890"
export ALL_PROXY="http://127.0.0.1:7890"

trojan

https://github.com/trojan-gfw/trojan/releases tar -xvf trojan-1.16.0-linux-amd64.tar.xz

"cert": "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem",

docker

cd /etc/clash

docker-compose.yml
version: "3"
services:
svc-clash:
image: dreamacro/clash
restart: always
ports:
- "7890:7890"
- "17890:9090"
volumes:
- .:/root/.config/clash
environment:
- TZ=utc-8
docker-compose.yml
mixed-port: 7890
allow-lan: true
external-controller: 0.0.0.0:9090
external-ui: /root/.config/clash/ui

#secret: bb975c61-c6b6-4ffe-9a22-0f5d00d7342e

# 后半段 copy windows profiles 里的内容
export http_proxy=http://127.0.0.1:7890
export https_proxy=http://127.0.0.1:7890
export ALL_PROXY=http://127.0.0.1:7890
# 测试代理可用
curl -i google.com
# 在终端取消代理
unset http_proxy
unset https_proxy

· One min read
docker run --restart=unless-stopped --name pmd -d -p 33060:80 phpmyadmin/phpmyadmin:4.7

docker exec -it pmd sh

vi /etc/phpmyadmin/config.user.inc.php

supervisorctl restart all

/etc/phpmyadmin/config.user.inc.php

<?php

// vi /etc/phpmyadmin/config.user.inc.php

$cfg['Servers'] = [];

$cfg['Servers'][1] = [
'auth_type' => 'cookie',
'connect_type' => 'tcp',
'compress' => false,
'AllowNoPassword' => true,
'host' => '139.196.x.x',
'user' => 'root',
];

$cfg['Servers'][] = [
'auth_type' => 'config',
'connect_type' => 'tcp',
'compress' => false,
'AllowNoPassword' => true,
'host' => 'x.x.x.x', // 本机
'user' => 'root',
'password' => 'xxxx',
];

· One min read

doc

Editor

General

Appearance

  • Show method separators 函数分割线

Tools

External Tools

pycharm black setting:

Program: black
Arguments: $FileName$
Work dir: $FileDir$

Terminal

C:\Git\bin\sh.exe --login -i

Code style

java style

adapter for Eclipse Code Formatter
https://github1s.com/alibaba/p3c/blob/master/p3c-formatter/eclipse-codestyle.xml

· 2 min read

静态ip

// http://blog.csdn.net/johnnycode/article/details/50184073
/etc/sysconfig/network-scripts 路径下找到 ifcfg-*
修改eth0
cat /etc/sysconfig/network-scripts/ifcfg-eth0

// change
ONBOOT=yes #开机启动
BOOTPROTO=static #静态IP
// add
IPADDR=192.168.1.101 #本机地址
NETMASK=255.255.255.0 #子网掩码
GATEWAY=192.168.1.1 #默认网关

/etc/sysconfig/network
# Created by anaconda
DNS1=192.168.1.1
DNS2=8.8.8.8

service network restart

ip addr

共享目录

# 加载光驱 VBoxGuestAdditions_5.0.17-106140.iso
mount /dev/cdrom /media/cdrom
cd /media/cdrom

yum install kernel sources
yum install kernel-devel
yum install gcc

sh VBoxLinuxAdditions.run

cd /
mkdir ptest
mount -t vboxsf ptest /ptest

# 取消挂载
sudo umount -f /mnt/shared

lsmod | grep vboxsf
modprobe vboxsf

mount命令

yum install -y psmisc # fuser

cat /etc/filesystems # 文件里是centos7支持的文件系统格式

fuser -km /mountdata/ # 释放链接
umount /mountdata

mkfs.xfs /dev/xvdb -f # 格式化

mount /dev/xvdb /mountdata

u盘ubuntu

进入U盘安装界面时,可选中”try ubuntu without installing”,按下”e”,对出现的命令进行编辑,将”quiet splash —”删掉并换为”nvme_load=YES”,接着按下”F10”