机械境

这里只是我的后花园,随性而写

准备工作

VSCode 安装 Debugger for Chrome

配置

在 Debug 试图增加下面的配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [{
"name": "Launch localhost with sourcemaps",
"type": "chrome",
"request": "launch",
"url": "http://localhost:4200",
"sourceMaps": true,
"webRoot": "${workspaceRoot}",
"trace": true,
"userDataDir": "${workspaceRoot}/.vscode/chrome",
// "runtimeExecutable": "/opt/google/chrome/google-chrome"
}]
}

需要注意的是 sourceMaps 一定要设成 true, 如果找不到 chrome 的安装路径,可以手动通过 runtimeExecutable 设置,比如我 Manjarro Linux 下的路径为 /opt/google/chrome/google-chrome

启动

一切配置好之后,在 Angular 工程目录通过 ng serve 启动项目,然后就可以打断点,在 Debug 试图通过 Launch localhost with sourcemaps 这个配置开始调试了。

---EOF---

Manjaro 是一款基于 Arch Linux、对用户友好、全球排名第 1 的 Linux 发行版。(排名数据源于 DistroWatch

在 Linux 圈,Arch 的确是一个异常强大的发行版。它有 3 个无与伦比的优势:

  • 滚动更新可以使软件保持最新;
  • AUR 软件仓库有着世界上最齐全的 Linux 软件
  • 丰富的 wiki 和活跃的社区让所有问题都可以快速得到满意的答案

为了解决 ArchLinux 的复杂安装,Manjaro 应运而生!

准备

下载镜像

可以从 官方 下载镜像,官方支持 Xfore, KDE, GNOME 三种桌面环境,社区版有更多桌面环境支持。根据个人喜好选择,我对 GNOME 版本比较熟悉,所以下载了 GNOME 版。也可以从 清华大学开源镜像 下载。

注: 清华的镜像比官方镜像稍微旧一些。

制作 U 盘启动盘

  • Windows
    Manjaro 官方手册推荐用 Rufus 制作启动盘,可惜一直没成功,最后使用 USBwriter 一步到位。
  • Linux
    sudo dd bs=4M if=/path/to/manjaro.iso of=/dev/sd[drive letter] status=progress [drive letter] 为 U 盘盘符。
Read more »

安装 WSL

以管理员权限运行 owershell 并执行下面的指令

1
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Microsoft Store 中安装 Ubuntu。

目前 Windows 支持多种 Linux 发行版,但 Ubuntu 作为使用门槛最低的版本,这里以此为例。

与 Windows 共享配置

通过软链接 Windows 的用户到 WSL,这样就可以共享一些软件的配置信息,比如 git, ssh 等。

1
2
3
4
5
6
# 删除原有用户目录
sudo rm -rf /home/goreng
# 链接 Windows 用户目录到 WSL 中
sudo ln -sf /mnt/c/User/<windows user name> /home/goreng
# 更改访问租信息
sudo chown -R goreng:goreng /home/goreng
Read more »

介绍

Docker nginx 反向代理设置 介绍了通过 nginx 反向代理关联容器。此为真实的使用场景。通过 Gitea 作为代码管理工具;Kanboard 作为任务管理;Jenkins 作为 CI 工具。这样的组合比较适合小型团队使用,相比起 GitLab 这种巨无霸来说,部署简单,使用简单。

准备

  • 安装 Docker

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    $ curl -fsSL get.docker.com -o get-docker.sh
    $ sudo sh get-docker.sh

    <output truncated>

    If you would like to use Docker as a non-root user, you should now consider
    adding your user to the "docker" group with something like:

    sudo usermod -aG docker your-user

    Remember to log out and back in for this to take effect!

    WARNING: Adding a user to the "docker" group grants the ability to run
    containers which can be used to obtain root privileges on the
    docker host.
    Refer to https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface
    for more information.
  • 安装 Docker Compose

    1
    2
    3
    $ sudo curl -L https://github.com/docker/compose/releases/download/1.19.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
    $ sudo chmod +x /usr/local/bin/docker-compose
    $ docker-compose --version

注:Docker 以及 Docker Compose 的安装,官方文档讲得非常清晰,在此不再赘述。

Read more »

缘起

Nutz 是一套开源的 Web Framework (Mvc/Ioc/Aop/Dao/Json),其中 Dao 模块是针对 JDBC 的薄封装,事务模板,无缓存。在数据库已经设计好之后,手动写对应的 Entity 的话,是个无比痛苦且无意义的事情。下面就通过 IDEA 自带的 DataGrip 基础上根据数据库信息一键生成 Entity

插件

  • Scratches 视图下的 Extensions/schema 新建一个文件,命名任意,比如 Generate nutz POJOs.groovy

    Scratches

Read more »

介绍

Scoop 是 Windows 上的命令行安装程序

特点如下:

  • 大多数程序安装不需要管理员权限
  • 自动设置环境变量
  • 命令行操作,类似 macOS 下的 HomeBrew
  • 常见开发环境都可以轻松搞定

安装

  • 以管理员账号启动 Powershell,输入以下命令

    1
    2
    3
    4
    5
    6
    psversiontable.psversion.major # should be >= 3
    set-executionpolicy remotesigned -scope currentuser
    # 自定义安装路径(可选)
    [environment]::setEnvironmentVariable('SCOOP','D:\Scoop','User')
    $env:SCOOP='D:\Scoop'
    iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

    如果没报错,就表示安装成功

  • 添加官网扩展支持

    1
    2
    scoop bucket add extras
    scoop bucket add versions
Read more »

虽然我现在基本上转到 Jetbrains IDEA 了,办公室有些小朋友还是坚守 eclipse,简单整理下常用插件和配置。

插件

名称备注安装
BuildshipEclipse Gradle 插件Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client
Darkest Dark Theme w/DevStyle黑色主题Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client
Checkstyle代码风格检查Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client
Enhanced Class Decompiler反编译插件,集成 JD, Jad, FernFlower, CFR, Procyon seamlessly with EclipsDrag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client
Java Source Attacher下载 jar 包代码包并关联Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client
KotlinKotlin 语言支持Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client
SonarLint for Eclipse代码静态检查Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client
SpotBugs代码静态检查Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client
TestNG测试框架Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client
Read more »

语言相关

  • Kotlin Jetbrains 官方 Kotlin 插件
  • Go Jetbrains 官方 Golang 插件

工具类

  • Key promoter X 快捷键辅助工具
  • .ignore Git ignore 高亮等
  • CheckStyle-IDEA 代码规范检查
  • FindBugs-IDEA 潜在 Bug 检查
  • Statistic 代码统计

代码生成

  • String Manipulation 驼峰式命名和下划线命名交替变化
  • Maven Helper Maven 辅助工具
  • JsonToKotlinClass 转换 Json 字符串 为 Kotlin 类
  • GsonFormat 把 Json 字符串为 Java 类
  • OK, Gradle! Gradle 辅助工具
  • Gradle Dependencies Formatter 转换 Maven 依赖为 Gradle 语法等

---EOF---

0%