-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent.json
More file actions
1 lines (1 loc) · 13 KB
/
Copy pathcontent.json
File metadata and controls
1 lines (1 loc) · 13 KB
1
{"meta":{"title":"Rex与藻藻泥","subtitle":"love & peace","description":null,"author":"Rex","url":"http://yoursite.com"},"pages":[{"title":"404","date":"2018-11-27T02:02:49.000Z","updated":"2018-11-27T02:02:49.000Z","comments":true,"path":"404/index.html","permalink":"http://yoursite.com/404/index.html","excerpt":"","text":""},{"title":"about","date":"2018-11-29T11:30:24.000Z","updated":"2018-11-29T11:30:53.000Z","comments":true,"path":"about/index.html","permalink":"http://yoursite.com/about/index.html","excerpt":"","text":"I’m Rex. A good man."},{"title":"categories","date":"2018-12-01T11:53:37.000Z","updated":"2018-12-02T05:31:06.000Z","comments":false,"path":"categories/index.html","permalink":"http://yoursite.com/categories/index.html","excerpt":"","text":""},{"title":"archives","date":"2018-12-01T11:53:49.000Z","updated":"2018-12-01T11:53:49.000Z","comments":true,"path":"archives/index.html","permalink":"http://yoursite.com/archives/index.html","excerpt":"","text":""},{"title":"tags","date":"2018-12-01T11:50:58.000Z","updated":"2018-12-02T05:30:57.000Z","comments":false,"path":"tags/index.html","permalink":"http://yoursite.com/tags/index.html","excerpt":"","text":""},{"title":"sitemap","date":"2018-12-01T12:05:36.000Z","updated":"2018-12-01T12:06:00.000Z","comments":true,"path":"sitemap/index.html","permalink":"http://yoursite.com/sitemap/index.html","excerpt":"","text":""},{"title":"search","date":"2018-11-27T02:03:03.000Z","updated":"2018-11-27T02:03:03.000Z","comments":true,"path":"search/index.html","permalink":"http://yoursite.com/search/index.html","excerpt":"","text":""}],"posts":[{"title":"用frp干掉动态IP","slug":"frp内网穿透","date":"2019-02-27T11:19:28.000Z","updated":"2019-02-27T12:02:05.000Z","comments":true,"path":"2019/02/27/frp内网穿透/","link":"","permalink":"http://yoursite.com/2019/02/27/frp内网穿透/","excerpt":"","text":"问题描述:star是内网注册了固定IP的服务器,无root权限;law则每次开机都有一个新的IP,作为服务器经常换IP是不能忍的。 由于问题很简单,这里只描述最简单的配置,不包含安全、网页访问等方面的需求,只说ssh服务的“呼叫转移”。 下载地址:https://github.com/fatedier/frp server端(frps)frps.inistar上的配置如下:12345678910[common]bind_port = 7070[ssh]auth_token = 12345678bind_addr = 0.0.0.0listen_port = 6000[web]vhost_http_port = 80 其中,star的防火墙中7070端口要保证属于已开放的端口。接下来,由于star服务器无root权限,手动设置“开机自启”。 开机自启第一步,在~/bin/目录下创建auto_run_frps文件,并将权限设为755(chmod 755 auto_run_frps)。12345678#!/bin/bashpid=`pgrep frps`if [[ -z $pid ]] ;then echo "[`date`]:frps stoped unexpectedlly,ready to restart it..." >> $HOME/frps.log (cd /data3/users/rex/soft/frp_0.16.1_linux_amd64; nohup ./frps -c frps.ini >> $HOME/bin/frps.log>/dev/null &)else echo "[`date`]:frps is running..." >> $HOME/bin/frps.logfi 第二步,将以上脚本的运行加入.bash_profile:1source $HOME/bin/auto_run_frps 客户端 (frpc)frpc.ini1234567891011[common]server_addr = 172.16.0.*server_port = 7070auth_token = 12345678login_fail_exit = false[ssh]type = tcplocal_ip = 127.0.0.1local_port = 22remote_port = 6000 作为服务的开机自启因为这台机器有root权限,并且分配新IP以后处于失踪状态,这里采用添加服务项的方式进行开机自启。编辑/etc/systemd/frpc.service:1234567891011121314[Unit]Description=frpc daemonAfter=syslog.target network.targetWants=network.target[Service]Type=simpleExecStart=/home/rex/soft/frp_0.16.1_linux_amd64/frpc -c /home/rex/soft/frp_0.16.1_linux_amd64/frpc_star.iniRestart= alwaysRestartSec=1minExecStop=/usr/bin/killall frpc[Install]WantedBy=multi-user.target 日常管理:1234sudo systemctl status frpc.servicesudo systemctl restart frpc.servicesudo systemctl enable frpc.servicesudo systemctl stop frpc.service 总结接下来就可以使用ssh rex@star -p 6000来直接连接law服务器了。 举一反三的话,star如果作为一个暴露公网IP的服务器(比如VPS),这样就实现了内网穿透。","categories":[{"name":"IT","slug":"IT","permalink":"http://yoursite.com/categories/IT/"}],"tags":[{"name":"tech","slug":"tech","permalink":"http://yoursite.com/tags/tech/"}]},{"title":"Kill Zhihu blocking","slug":"Kill-Zhihu-blocking","date":"2018-12-05T08:25:01.000Z","updated":"2018-12-05T08:26:14.000Z","comments":true,"path":"2018/12/05/Kill-Zhihu-blocking/","link":"","permalink":"http://yoursite.com/2018/12/05/Kill-Zhihu-blocking/","excerpt":"","text":"思路:ublock选取条款框和背景黑影+vimium透过鼠标屏蔽。 ublock:123www.zhihu.com##.Modal-backdropwww.zhihu.com##.Modal-innerwww.zhihu.com##.PrivacyConfirm-modal.Modal--default.Modal https://beacon.zhihu.com/c?c=69890733cbce4d285c6383234f11286c2b521e0db55e2a0afb62098b23f9d396&i=1899eee8c37147f6bad598fca5c6f9e0&s=1&t=1525234078&u=http%3A%2F%2Flink.zhihu.com%2F%3Ftarget%3Dhttps%253A%2F%2Fwww.zhihu.com%2Fvideo%2F974971115898179584&utm_campaign=email_admin&utm_source=zhihu-web 看来zhihu的审核系统还是很智能的:","categories":[],"tags":[]},{"title":"内网穿透","slug":"内网穿透","date":"2018-12-02T00:48:29.000Z","updated":"2018-12-02T12:07:10.000Z","comments":true,"path":"2018/12/02/内网穿透/","link":"","permalink":"http://yoursite.com/2018/12/02/内网穿透/","excerpt":"","text":"问题描述:现在有三台机器:star:中科院内网服务器,无法直接从外网访问,IP:1.16.0.jump:中科院跳板服务器,可以从内外网访问,但是只有端口22,IP:159.226.113.*mine:家里的电脑,或PC或Mac,IP:不重要!ok?不重要! 那么,想从家里向服务器传数据,或者下数据怎么破?尤其不想手动跳板怎么破? Mac & LinuxSSH访问mine -> jump -> star这样是带图形界面的,可以xeyes进行测试: 1ssh -t -o ProxyCommand='ssh -Y dam@159.226.113.* -W 1*.16.0.*:22' -Y zy@1*.16.0.* 当然,通常我会在~/.bashrc建立一个alias,省的每次敲着一大串: 1alias sjumpstar=\"ssh -t -o ProxyCommand='ssh -Y dam@159.226.113.* -W 1*.16.0.*:22' -Y zy@1*.16.0.*\" 其中-t是指远程建立一个tty,-o ProxyCommand是设置设定远程代理执行命令的option,-Y是指建立信任的X11传输协议。 scp rsync传输文件mine -> jump -> starscp进行传输,少量传输还挺好,大量数据的备份不推荐: 1scp -r -o ProxyCommand='ssh dam@159.226.113.* -W 1*.16.0.*:22' zy@1*.16.0.*:~/data ./data 其中-r指recursively递归复制,复制单独文件时可以拿掉。 rsync传输,老司机的同步命令,适合大量数据的备份,支持断点续传: 1rsync -avPH -e \"ssh -t -o ProxyCommand='ssh dam@159.226.113.* -W 1*.16.0.*:22'\" zy@1*.16.0.*:~/data ./data star -> jump -> mine也很简单,反过来写: 1scp -r -o ProxyCommand='ssh dam@159.226.113.* -W 1*.16.0.*:22' ./data zy@1*.16.0.*:~/data 1rsync -avPH -e \"ssh -t -o ProxyCommand='ssh dam@159.226.113.* -W 1*.16.0.*:22'\" ./data zy@1*.16.0.*:~/data 当然,也有很多其他方法,比如笨笨的zssh;以及操作复杂的ssh映射本地socks再通过Proxifier配置代理。 sshfs 挂载本地最爽的难道不是将ssh映射到本地当成一块磁盘用吗?探索半天,一条命令足以: 1sshfs zy@1*.16.0.*:/ /mnt -o ssh_command='ssh -J dam@159.226.113.*' 随便拖拽copy开不开心?卸载的话右键弹出即可。 Windows一直认为Mobaxterm比Xshell好用很多,这里可以再次推荐下。首先,它是免费的(至少免费版够用);其次,内置cygwin为底层更加方便,所以以上命令直接写在Moba的local terminal里面就可以直接用,而且左边的简易文件管理器基本做到无缝衔接。最重要的,UI漂亮,可定制! 如果想保存这种设定,也很简单,新建ssh对话的时候有Proxy的选项,把跳板服务器的信息填进去就可以了。","categories":[{"name":"IT","slug":"IT","permalink":"http://yoursite.com/categories/IT/"}],"tags":[{"name":"tech","slug":"tech","permalink":"http://yoursite.com/tags/tech/"}]},{"title":"mac spin-up","slug":"mac-spin-up","date":"2018-11-29T11:26:54.000Z","updated":"2018-12-02T12:26:19.000Z","comments":true,"path":"2018/11/29/mac-spin-up/","link":"","permalink":"http://yoursite.com/2018/11/29/mac-spin-up/","excerpt":"","text":"(zero)网络环境是一切的基础,真正高效的人不寄希望于国内镜像。https://github.com/erguotou520/electron-ssr/releases Brew见到一台嗷嗷待哺的mac,废话不多说,第一件事brew起来。 1/usr/bin/ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\" 直接测试git,不能用会弹提示,顺便装好python,真是贴心。当然也可以xcode-select --install。 基本操作: 12345brew search xxx # 模糊搜索某个软件brew install xxx # 安装某个软件brew upgrade xxx # 升级某个软件brew uninstall xxx # 卸载某个软件brew list xxx # 列出某个软件的所有相关文件 命令行工具系列wget下载点东西少不了的,偶尔挂个torrent活着magnet资源就要上aria2了,proxychains做命令行下的局部代理,sshfs+vifm管理本地与远程文件。 1234567brew install \\ wget \\ #初级下载 aria2c \\ #进阶下载 proxychains-ng \\ #网络代理后面的命令 imagemagick \\ #图像处理 可能有问题 最好加上--build-from-source sshfs \\ #ssh挂载到本地作为磁盘 vifm #vim模式、命令行端的Total Commander Cask APP系列免费区Safari很好,但是我依然选择chrome+firefox双开: 1brew cask install google-chrome firefox 当然,通常我也需要多个浏览器作为单独的环境: 1brew cask install chromium waterfox vivaldi tor-browser 编辑器我选择Vim+Emacs/Spacemacs, 12345brew install macvimln -Fs `find /usr/local -name \"MacVim.app\"` /Applications/ #linkapps命令被brew废了。。心塞brew tap d12frosted/emacs-plusbrew install emacs-plus 一些常规App: 1234567891011121314151617181920212223242526272829brew cask install \\ alfred \\ #spotlight升级以后也不怎么用得到了,但是可拓展性确实强,比较耐玩 caffeine \\ #“mac,两小时内不许睡” cheatsheet \\ #“那个快捷键是什么来着”,“长按command” docker \\ #专治水土不服 dropbox \\ #催眠:18G够用了 google-drive \\ #催眠:17G够用了 onedrive \\ #5T真的不够啊! flux \\ #保护眼睛,从使用黄色屏幕开始。。 sublime-text \\ #Atom最棒,Subl真香 qq \\ #屈服于鹅肠 wechat \\ #不服不行 evernote \\ #从evernote到onenote是一个漫长的过程 owncloud \\ #不用国内云,别问我问什么 scroll-reverser \\ #没有magicmouse也不担心反人类的滚轮方向 rmtrash \\ #妈妈在也不担心我在命令行下rm误删了 htop \\ #监视、管理你的系统进程 mactex \\ #写论文。。 panoply \\ #不学大气的人表示:这什么鬼 neteasemusic \\ #网易云音乐 free-download-manager \\ #支持各种下载 qlcolorcode \\ #空格键预览高亮代码 qlstephen \\ #预览README文件 qlmarkdown \\ #预览md文件 java \\ #java环境 xquartz \\ #ssh -Y看不到GUI不怪你,因为需要重启 imazing \\ #从此看不起iTunes skim \\ #简单而不失强大的PDF阅读器 iina #真的良心,开源免费,堪比Windows下的Potplayer quick look增强系列,详见https://github.com/sindresorhus/quick-look-plugins#install-all: 12345678910brew cask install \\ qlcolorcode \\ #空格键预览高亮代码 qlstephen \\ #预览README文件 qlmarkdown \\ #预览md文件 quicklook-json \\ qlimagesize \\ webpquicklook \\ suspicious-package \\ quicklookase \\ qlvideo 如果你愿意也可以加个字体:加两个源: 12brew tap homebrew/cask-fontsbrew cask install font-source-code-pro 收费区装了Moom多年,很少用,因为Hyperdock的 ctrl+opt+上/下/左/右 满足了我大多数时候整理窗口的需求,在mac下找到windows的窗口管理体验。dock收费,switch免费。 1brew cask install hyperdock hyperswitch 常规软件: 1234567brew cask install surge \\ #网络代理 proxifier \\ #将socks真正变成系统级别代理 cleanmymac \\ #论功能我服,UI我更服 endnote \\ #文献管理 microsoft-office \\ #2016、2019兼容性已经相当好了 iTerms #都说比Termimal好用 放不下windows?你想要的我都有:parallel-desktop MAS不堪忍受App Store的低效率,于是有了MAS。之所以这一部分不用brew是考虑到苹果的授权管理比较方便,不需要保存购买一家家软件的许可凭证,所以App Store上架的应用我一般就直接买了而不是去其自己家的网站下载。 安装: 1brew install mas 常规操作: 12mas search xxxmas install nnn 常用的装了: PDF exportSparkPaste 2PopclipiThoughtsXEvernoteDay OneEudic 不常用的也装了: DaisyDiskMovistPinMagnetEasyResForkliftGrowlBattery Charging AlertReeder 3","categories":[{"name":"IT","slug":"IT","permalink":"http://yoursite.com/categories/IT/"}],"tags":[{"name":"software","slug":"software","permalink":"http://yoursite.com/tags/software/"}]}]}