滚熊博客

滚熊博客

Thoughts, rants and discoveries on software development and related stuff.

Vim Cheat Sheet

·Linux

A Great Vim Cheat Sheet Essentials Cursor movement (Normal/Visual Mode) h j k l - Arrow keys w / b - Next/previous word W / B - Next/previous word (space seperated) e / ge - Next/previous end of word 0 / $ - Start/End of line ^ - First non-blank character of line (same as 0w) Editing text i / a - Start insert mode at/after cursor I / A - Start insert mode at the beginning/end of the line o / O - Add blank line below/above current line Esc or Ctrl+[ - Exit insert mode d - Delete dd - Delete line c - Delete, then start insert mode cc - Delete line, then start insert mode Operators Operators also work in Visual Mode d - Deletes from the cursor to the movement location c - Deletes from the cursor to the movement location, then starts insert mode y - Copy from the cursor to the movement location > - Indent one level < - Unindent one level You can also combine operators with motions. Ex: d$ deletes from the cursor to the end of the line. Marking text (visual mode) v - Start visual mode V - Start linewise visual mode Ctrl+v - Start visual block mode Esc or Ctrl+[ - Exit visual mode Clipboard yy - Yank (copy) a line p - Paste after cursor P - Paste before cursor dd - Delete (cut) a line x - Delete (cut) current character X - Delete (cut) previous character d / c - By default, these copy the deleted text Exiting :w - Write (save) the file, but don’t quit :wq - Write (save) and quit :q - Quit (fails if anything has changed) :q!

Read More →
#vim

去掉doc88,360doc,csdn和sfgg的登陆后复制限制

·Linux

各大站都搞这个登陆复制,真的恶心, 尤其是csdn,各种和谐, 虽然有命令,但是每次敲都贼麻烦, 来个油猴脚本吧~~ /* eslint-disable no-undef */ /* eslint-disable no-eval */ // ==UserScript== // @name 去掉doc88,360doc,csdn和segmentfault的登陆后复制限制 // @author ALEX.XU // @version 1.0.0 // @match *://*/* // @require https://cdn.bootcdn.net/ajax/libs/jquery/1.9.1/jquery.min.js // @run-at document-start // @grant unsafeWindow // ==/UserScript== (function() { 'use strict'; $(function(){ if (/www.doc88.com/.test(location.href) || /www.360doc.com/.test(location.href)){ function oncopy() { return true; } setInterval(function(){ try{ unsafeWindow.logined = 1 unsafeWindow.u_v = 1 document.body.oncopy = oncopy //360doc }catch(e){ console.log(e)} }, 1000) }else if(/blog.csdn.net/.test(location.host)){ console.log(mdcp, hljs); if (typeof(mdcp)!="undefined" && 'copyCode' in mdcp){ // $("code").attr("onclick","mdcp.copyCode(event)") // 直接来个狠的 document.body.contentEditable = true; }else if (typeof(hljs)!="undefined" && 'copyCode' in hljs){ $("*").one("mousemove", function(){ $(".hljs-button").attr("onclick","hljs.copyCode(event)") }) } } else if(/segmentfault.com/.test(location.host)){ $("<div></div>").attr("id","SFUserId").appendTo("body") } }) }())

Read More →
#csdn

win10 笔记本 同时接入无线(外网)和有线(内网)

·Linux

连接内网和无线网络 内网和外网都不要禁止,win10系统,以管理员身份运行CMD,在CMD中输入route print IPv4 路由表 上面一行是外网,下面一行是内网。 内网的跃点数高,要手动修改外网的跃点数,打开无线网(外网)IP4属性框中的高级,接口跃点数设置为1。 进入cmd通过route命令来重新设置网络 执行:route delete 0.0.0.0 (删除对所有ip的默认路由设置) 执行:route add 0.0.0.0 mask 0.0.0.0 192.168.0.1(将所有ip路

Read More →
#linux#windows

网络字体包压缩优化方案

·Linux

本文将介绍如何缩小网络字体包大小及优化其加载过程。 优化思路 将字体包转换为 woff2 格式。它具有更小的体积,对现代浏览器非常友好,且无需再 gzip 压缩。 使字体包中仅保留英文、数字、常用字符和常用汉字。 使用非堵塞方式加载字体包。 QA 1、TTF 如何转换为 WOFF2? 使用fonttools转换格式。它是一个依赖于 python 的工具。(若转换时候报错,需要根据提示安装对应依赖的库。) (1)安装: pip install fonttools (2)转换例子: pyftsubset example.ttf --layout-features="" --unicodes=U+0020-007E,U+4E00-9FA5 --flavor=woff2 --output-file=example.woff2 注意

Read More →
#字体包#压缩优化方案

[solved]modprobe: ERROR: ../libkmod/libkmod-module.c:832 kmod_module_insert_module() could not find module by name='off'

·Linux

exute sudo modprobe nvidia error: modprobe: ERROR: ../libkmod/libkmod-module.c:832 kmod_module_insert_module() could not find module by name=‘off’ 02615-oak8kunndy9.png Nvidia对他们的安装做了一些改动。 现在,Nvidia库位于/usr/lib/x86_-linux-gnu中 blacklist-nvidia.conf文件位于/lib/modprobe.d/中 在blacklist-nvidia.conf中,仍然存在未经注释的 alias nvidia off。 注释掉 alias nvidia off 后,如图所示: $ cat /lib/modprobe.d/blacklist-nvidia.conf# Do not modify# This file was generated by nvidia-primeblacklist nvidiablacklist nvidia-drmblacklist nvidia-modeset#alias nvidia offalias nvidia-drm off 参考链接 : https://forums.linuxmint.com/viewtopic.php?t=274958 https://github.com/Bumblebee-Project/Bumblebee/issues/951

Read More →
#nvidia#modprobe

gitExtension 合并与衍合

·Linux

注意到:以下的操作主要是用gitExtension来操作的。 gitExtension配置教程:http://www.cnblogs.com/sorex/archive/2011/08/10/2132359.html 内容提要: Q1、git如何让develop分支合并到master Q2、git如何让develop分支衍合到master Q3、git如何搭建server。 关于Q1: step0:将devel

Read More →
#windows#gitExtension

(solved) The pkg-config package 'libpcre' is required but it could not be found.

·Linux

pkg-confg 确认是否存在。 $ pkg-config --libs libpcrePackage libpcre was not found in the pkg-config search path.Perhaps you should add the directory containing `libpcre.pc'to the PKG_CONFIG_PATH environment variableNo package 'libpcre' found 编辑profile $ vim ~/.bash_profile .bash_profile添加以下。 export PKG_CONFIG_PATH=/usr/lib/pkgconfig 保存 . ~/.bash_profile中 验证 $ pkg-config --libs libpcre-lpcre

Read More →
#pcre

58到家MySQL升级规范[转]

·SQL

一、基础规范 表存储引擎必须使用InnoDB 表字符集默认使用utf8,必要时候使用utf8mb4 解读: (1)通用,无乱码风险,汉字3字节,英文1字节 (2)utf8mb4是utf8的超集,有存储4字节例如表情符号时,使用它 禁止使用存储过程,视图,触发器,Event 解读: (1)对数据库性能影响较大,互联网业务,能让站点层和服务层干的事情,不要交到数据库层 (2)调试,排错,迁移都比较困难,扩展性较差 禁止在

Read More →
#mysql#58