![](https://img-blog.csdnimg.cn/20210728155616861.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
Tool
平日常用的一些工具和代码操作记录下来,提高复用效率,减少搜索时间,好记性不如烂笔头
lincs_
分布式系统、区块链、机器学习
展开
-
Zotero使用Onedrive实现云同步
备忘原创 2022-12-12 15:59:51 · 432 阅读 · 1 评论 -
[curl] 开启代理加速下载
curl开启代理加速echo '--proxy="127.0.0.1:1080"' >>~/.curlrcGitHub 作为世界上最大的软件开源集结地,集中了大量开发人员的最大生产力,虽然我们访问主站正常,但是在 git clone 也是经常出错,而且 git 并不走系统代理,故而需要对它进行单独配置:git config --global http.proxy http://127.0.0.1:1080git config --global https.proxy https.原创 2022-05-03 16:15:41 · 1641 阅读 · 0 评论 -
[pip3] Linux下pip3替换为国内镜像
如果没有安装,就先安装pip3sudo apt install python3-pip使用pip3时,会发现下载Python第三方库特别慢,因此改为国内镜像以提速vim ~/.pip/pip.conf这里直接替换为[global]timeout = 6000index-url = https://mirrors.aliyun.com/pypi/simple/trusted-host = mirrors.aliyun.com...原创 2021-08-25 14:59:09 · 436 阅读 · 0 评论 -
[Vim] 删除包含特定字符串的行
:g/str/dstr表示特定字符串原创 2021-08-25 14:23:43 · 3654 阅读 · 0 评论 -
[SDKMAN] linux下管理多个java版本
我们会遇到需要用到不同版本java的时候这里采用SDKMAN来进行不同Java版本的管理sdk list java输入命令,将会打印出各种不同版本的可用java================================================================================Available Java Versions==============================================================.原创 2021-08-18 18:14:08 · 494 阅读 · 0 评论 -
[Git] 生成/添加SSH公钥
生成ssh key,这里采用rsassh-keygen -t rsa -C "xxxxx@xxxxx.com" # Generating public/private rsa key pair...注意:这里的 xxxxx@xxxxx.com 只是生成的 sshkey 的名称,并不约束或要求具体命名为某个邮箱。将生成的key打印出来cat ~/.ssh/id_rsa.pub复制并粘贴在你的SSH keys页面里测试下是否添加成功ssh -T git@gitee..原创 2021-08-10 21:23:21 · 187 阅读 · 0 评论 -
[Linux] Ubuntu18.04更换国内清华源
Ubuntu 的软件源配置文件是 /etc/apt/sources.list将系统自带的该文件做个备份sudo cp /etc/apt/sources.list /etc/apt/sources.list.cp进入编译原文件 /etc/apt/sources.listsudo vim /etc/apt/sources.list将该文件替换为下面内容,即可使用 TUNA 的软件源镜像。# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释deb http.原创 2021-08-08 23:39:09 · 496 阅读 · 0 评论 -
[Vim] .vimrc配置文件(自用)
syntax onfiletype plugin indent onset nuset nobackupset expandtabset tabstop=4set shiftwidth=4set autoindentset aiset ciset hlsearchset backspace=2set icset nowrapset mouse=aset encoding=utf-8set fileencoding=utf-8set fileencodings=utf-8s原创 2021-05-04 18:42:46 · 81 阅读 · 0 评论 -
[WSL] WSLg中显示中文(解决中文乱码)
生成locale配置文件$ sudo locale-gen$ locale$ sudo apt install language-pack-gnome-zh-hans$ sudo dpkg-reconfigure localesSharing Windows fonts with WSL$ sudo apt install fontconfig$ sudo vim /etc/fonts/local.confpaste<?xml version="1.0"?>&.原创 2021-08-08 19:58:39 · 7046 阅读 · 11 评论 -
[Linux] 系统语言更改
打开配置文件,并进行修改$ sudo vim /etc/default/locale显示中文LANG=zh_CN.UTF-8显示英文LANG=en_CN.UTF-8重启$ reboot原创 2021-08-07 23:59:12 · 65 阅读 · 0 评论 -
[Maven] 国内maven构建提速 使用阿里源
使用sdk安装maven$ sdk install maven由于我使用sdk安装的maven,故对应的安装目录在此$ cd /home/lincs/.sdkman/candidates/maven打开 maven 的配置文件 conf/settings.xml ,在标签中添加 mirror 子节点:<mirror> <id>aliyunmaven</id> <mirrorOf>*</mirrorOf> <.原创 2021-08-04 15:13:02 · 84 阅读 · 0 评论 -
[Java] int转化为String时间格式 “hh:mm“
// Returns a string representation of this clock, using the format HH:MM.public String toString(){ return String.format("%02d:%02d", hour, minute);}output:$ 01:02原创 2021-08-04 10:29:58 · 223 阅读 · 0 评论 -
[Gradle] 国内gradle构建提速 使用阿里源
在项目的build.gradle文件中进行修改:allprojects { repositories { maven { url 'https://maven.aliyun.com/repository/public/' } mavenLocal() mavenCentral() }}如果要用其他代理仓,以spring仓为例:allProjects { repositories { maven { url 'htt.原创 2021-08-03 14:44:11 · 139 阅读 · 0 评论 -
[Linux] Ubuntu20.04 安装 Java
安装java运行时环境$ sudo apt install default-jre安装Java开发者工具,来编译和运行程序$ sudo apt install default-jdk原创 2021-08-03 09:57:07 · 219 阅读 · 0 评论 -
[Linux] Ubuntu20.04 LTS 更换清华源
Ubuntu 的软件源配置文件是/etc/apt/sources.list将系统自带的该文件做个备份,将该文件替换为下面内容,即可使用 TUNA 的软件源镜像。# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse# deb-src https://mirrors.tuna.tsin.原创 2021-08-02 17:58:58 · 1255 阅读 · 0 评论 -
[Linux] 如何使用dpkg管理deb
查看已安装的软件包列表$ dpkg --list安装.deb软件包$ sudo dpkg -i [.deb]此时若出现error,则需要修复依赖关系$ sudo apt-get -f install移除软件包$ sudo dpkg --remove [package file]原创 2021-07-31 13:05:34 · 62 阅读 · 0 评论 -
[PyCharm] 导入模块
点击 “File” 中的"Setting"“Project:“中的 “Project Interpreter”,再点击”+”搜索要安装的模块,点击"Install Package"原创 2021-07-30 16:43:56 · 339 阅读 · 0 评论 -
[SQL] MySQL 常用查询语句
列出对应数据表的字段和注释SELECT column_name, column_comment FROM information_schema.COLUMNS WHERE table_name = 'talbe_name';原创 2021-07-30 16:16:37 · 47 阅读 · 0 评论 -
[SQL] PostgreSQL 常用查询语句
列出数据表的所有字段SELECT pg_attribute.attname as Field_name FROM pg_class, pg_attribute where pg_class.relname = 'table_name';原创 2021-07-29 10:52:34 · 816 阅读 · 0 评论 -
[Java] 求解立方根
I didn’t find any clear solution, so let me go直接调用Math库public static double cbrt(double num){ return Math.cbrt(num);}原创 2021-07-28 14:40:49 · 119 阅读 · 0 评论 -
[Bash] 光标操作快捷键
Ctrl + a:光标移动到行首Ctrl + e:光标移动到行尾Ctrl + r:搜索之前的命令Ctrl + f:光标右移Ctrl + b:光标左移Esc + f:右移一个词Esc + b:左移一个词原创 2021-07-28 11:29:18 · 429 阅读 · 0 评论 -
[Bash] java -cp导入stdlib.jar包来编译运行
javac编译时导入stdlib.jarjavac -cp "C:\Users\Lincs\COS126\demo;C:\Users\Lincs\COS126\demo\.lift\stdlib.jar" Main.javajava运行时导入stdlib.jarjava -cp "C:\Users\Lincs\COS126\demo;C:\Users\Lincs\COS126\demo\.lift\stdlib.jar" Main原创 2021-07-27 18:18:59 · 201 阅读 · 0 评论 -
[IDEA] 开启输入流重定向
打开 “edit configurations”click on “edit configuration templates”in “Modify options” we can see “Redirect input”原创 2021-07-27 18:00:25 · 397 阅读 · 1 评论 -
[Java] 判断double值是否为整数
double num;if (Math.abs(num - Math.round(num)) < 1e-10){ // 几乎可以认为该double已经是integer}原创 2021-07-27 17:35:51 · 3785 阅读 · 0 评论 -
[IDEA] 快捷键
快速新建类:ALT + INSERT快速格式化代码:CRTL + ALT + L原创 2021-07-27 15:49:58 · 38 阅读 · 0 评论 -
[Vim] 替换及全局替换
全局old替换为new:%s/old/new/g当前行将old替换为new:s/old/new/g原创 2021-07-26 17:34:09 · 89 阅读 · 0 评论 -
[Python] 利用openpyxl操纵excel
from openpyxl import Workbookworkbook = Workbook()sheet = workbook.activesheet["A1"] = "hello"sheet["B1"] = "world!"workbook.save(filename="hello_world.xlsx")原创 2021-07-26 16:17:03 · 50 阅读 · 0 评论 -
[Python] 利用open进行文件扫描逐行输出
import oswith open(file=filename, mode="r", encoding="UTF-8") as input_file: for line in input_file: print(line)原创 2021-07-26 15:14:07 · 257 阅读 · 0 评论 -
[Bash] Ubuntu20.04 设置terminal 快捷启动IDEA
sudo ln -s /home/lincs/idea-IU-211.7628.21/bin/idea.sh /usr/local/bin/idea原创 2021-07-17 11:03:18 · 322 阅读 · 0 评论 -
[IDEA] JAVA项目导入.jar包
“File” 下的 “Project Structure”“Modules” 下"Dependencies"中的"+"选择"JARs or Directories"原创 2021-07-09 15:25:34 · 153 阅读 · 0 评论 -
[Bash] Shell常用脚本
求文件1和文件2的差集# print lines in file1 not in file2, and vice versacomm -3 file1 file2原创 2021-07-08 17:42:43 · 77 阅读 · 0 评论 -
[Java] 利用 BufferedReader 进行文件扫描输出
import java.io.*;import java.util.*;public class Main{ public static void main(String[] args) throws IOException { // Use BufferedReader rather than RandomAccessFile; it's much faster BufferedReader f = n原创 2021-07-07 10:59:48 · 107 阅读 · 0 评论