hostodo ip 被墙

一场倒墙风波过后,我不怎么使用的vps ip也都被ban了,包括hostodo和vultr。

简单的检测方法:ping.chinaz.com

如果国内都不通,国外的通,很明显了。

解决办法:

hostodo 发了个service ticket,说vps cannot access via ssh

当天晚上就发mail,给了个新ip。

服务还是不错的。

vultr 需要新创建实例,然后把旧实例数据restore过去就好。

wordpress 数据库链接失败

今天访问网站,才发现直接提示数据库链接失败

查看mysql的

2019-01-21T03:23:15.998898Z 15638 [ERROR] /usr/sbin/mysqld: Table ‘./mybacc_wordpress/wp_options’ is marked as crashed and last (automatic?) repair failed
2019-01-21T03:23:15.999066Z 15638 [ERROR] /usr/sbin/mysqld: Table ‘./mybacc_wordpress/wp_options’ is marked as crashed and last (automatic?) repair failed
2019-01-21T03:23:22.791382Z 15639 [ERROR] /usr/sbin/mysqld: Table ‘./mybacc_wordpress/wp_options’ is marked as crashed and last (automatic?) repair failed
2019-01-21T03:23:22.791579Z 15639 [ERROR] /usr/sbin/mysqld: Table ‘./mybacc_wordpress/wp_options’ is marked as crashed and last (automatic?) repair failed
2019-01-21T03:23:22.791753Z 15639 [ERROR] /usr/sbin/mysqld: Table ‘./mybacc_wordpress/wp_options’ is marked as crashed and last (automatic?) repair failed

参考:https://stackoverflow.com/questions/8843776/mysql-table-is-marked-as-crashed-and-last-automatic-repair-failed

 

server上用mysql 连接server

repair table wp_options' <table_name>;

image

刷新网站,搞定。

babun 访问gitlab 每次弹出用户名密码

问题:

使用babun自带的git,因为工作项目是放在gitlab上,但是每次git pull,都会弹出询问用户名密码,设置了ssh key也是如此。

解决方案:

http://stackoverflow.com/a/36721316/4377192

Get the GCMW’s latest release, download the zip file (not the installer), extract it’s contents (only .dll and .exe files are needed) to C:\cygwin\usr\libexec\git-core\ for 32-bit Cygwin, or C:\cygwin64\usr\libexec\git-core\ for 64-bit Cygwin. Reference

To tell git to use GCMW, execute: git config --global credential.helper manager

To get GUI prompts for credentials, execute: git config --global credential.modalprompt true

If you want this to be a per-repository setting, remove the --global option.

来源: https://github.com/Microsoft/Git-Credential-Manager-for-Windows/issues/146

下载gcmw的zip包,把里面的EXE,DLL文件都拷贝到babun的git-core 目录下

%Profile%\.babun\cygwin\usr\libexec\git-core\

然后设置

git config –global credential.helper manager

如果只是单项目的,移除–global即可

整合的babun下载:

http://www.odrive.tk/?/%E5%BC%80%E5%8F%91%E5%B7%A5%E5%85%B7/babun-1.2.0-dist.zip

win10 分辨率1080p时显示虚化

win10,连接到外置的显示器,1080p,如果设置缩放100%,字体太小,看的累,

如果设置125%,字体虚,模糊

参考:https://www.zhihu.com/question/34304515

你只需要Windows 10 DPI blurry fix这个小工具。顾扯淡的回答在点上,但是治标不治本。

链接贴在下面。

http://windows10_dpi_blurry_fix.xpexplorer.com/

cba41ebf-a3c4-479f-9202-3b8b0abf1271

DPI 按照设置内的推荐值设置即可。
如果现在是 100,尝试 125

重启之后OK。

Windows替换任务管理器

实现方法:这里其实是使用了一个非常著名的IFEO调试器方法,它可以在某个程序运行的状态下,直接使用注册表中添加的程序信息对其进行替换和调试。在
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe

子键下。只要在其右侧,直接添加“Debugger”字符串值,并手工指定其调试用程序路径,就可以替换已有程序。”C:\PORTABLE\PROCESSEXPLORER\PROCEXP64.EXE”


替换回来:
删除debuger选项

zsh和oh my zsh 配置

zsh 设置

ohmyzsh安装

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

git extras[https://github.com/tj/git-extras]安装

$ git clone https://github.com/tj/git-extras.git
$ cd git-extras
# checkout the latest tag
$ git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
$ [sudo] make install

bash complete

when building android source, need to source >build/envsetup.sh
will complain "complete not found"

because android build use bash as default,complete is bash embed function

add below to .zshrc
bash
autoload -U compinit && compinit
autoload -U bashcompinit && bashcompinit

if build android source still error, and using bash is ok,
try to use

emulate bash

before make.

just ensure you have "#!/usr/bin/env bash" at the first line of your script

emulate sh -c '. ./myscript.sh'

git 命令卡死,cpu 占用率到100%

http://superuser.com/questions/458906/zsh-tab-completion-of-git-commands-is-very-slow-how-can-i-turn-it-off
添加到.zshrc
bash
__git_files () {
_wanted files expl 'local files' _files
}

autojump

autojump is a faster way to navigate your filesystem. It works by maintaining a database of the directories you use the most from the command line.

Directories must be visited first before they can be jumped to.

https://github.com/wting/autojump
bash
git clone git://github.com/joelthelion/autojump.git
cd autojump
./install.py or ./uninstall.py

add the following line(s) to ~/.zshrc:

[[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && source ~/.autojump/etc/profile.d/autojump.sh
autoload -U compinit && compinit -u

GDB debug setting for lazarus

GDB_on_OS_X_Mavericks_or_newer_and_Xcode_5_or_newer

Codesigning gdb

https://sourceware.org/gdb/wiki/BuildingOnDarwin#Method_for_Mac_OS_X_10.5_.28Leopard.29_and_later

Mac(os x)下使用gdb的问题

codesign 之后,运行出现

sudo codesign -fs gdb-cert /usr/local/bin/gdb

The GDB command:
"-gdb-set confirm off"
did not return any result.

终端执行gdb

dyld: Library not loaded: /usr/local/opt/mpfr/lib/libmpfr.6.dylib
Referenced from: /usr/local/bin/gdb
Reason: image not found
[1] 25803 trace trap gdb

参考:
cannot run gdb on mac's terminal even after codesign

build gdb from source

  1. download source from
    ftp://sourceware.org/pub/gdb/releases/
  2. build

    ./configure
    make
    sudo make install

    build error

probe.c:63:28: error: default initialization of an object of const type 'const any_static_probe_ops' without a user-provided default

https://news.ycombinator.com/item?id=16275140

fixed: remove const

- const any_static_probe_ops any_static_probe_ops;
+ any_static_probe_ops any_static_probe_ops;