Skip to content

Instantly share code, notes, and snippets.

View Green-li's full-sized avatar
🎯
Focusing

maolong Li Green-li

🎯
Focusing
View GitHub Profile
@Green-li
Green-li / ohmyzhs-gitee-install.sh
Created February 8, 2023 03:43
Install OhMyZsh using gitee.
#!/bin/sh
#
# This script should be run via curl:
# sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# or via wget:
# sh -c "$(wget -qO- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# or via fetch:
# sh -c "$(fetch -o - https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
#
# As an alternative, you can first download the install script and run it afterwards:
@Green-li
Green-li / fix.md
Created June 25, 2021 06:03
fix the 'no such file' or 'bad file descriptor' of vs-code extensions 'sftp'

Methods is from https://github.com/Natizyskunk/ssh2-streams/commit/e1db386ff9b0fc145c67dc13ada3e969d59cc51f#diff-11c2413775403ed66594f387ae0a38ec06ed746902424f86c7cbbbc7e395f4ca. change the lines in .vscode-server/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams/lib/sftp.js

...
...
  // add after line No. 2730
  // Fix error No such file.
  options.autoDestroy = false;
  
...
@Green-li
Green-li / chinese_quantifier.txt
Last active May 28, 2021 06:18
中文量词词表。在中文中,量词的用法还挺多的,而且很多量词无法对应到英文中。
@Green-li
Green-li / open port on SELinux Centos 7
Last active November 2, 2021 06:40
open port on SELinux Centos 7
1. Start with checking the port allocation and confirming the port you want to allow access to isn't already being used,
`sudo semanage port -l | grep http_port_t`
2. Allow access to port
`sudo semanage port -a -t http_port_t -p tcp 12345`
3. Check firewall ports passthrough
`sudo firewall-cmd --list-all`
4. Add port (and make it permanent)
`sudo firewall-cmd --zone=public --add-port=12345/tcp --permanent`
5. Reload firewall for the changes to take effect
`sudo firewall-cmd --reload`