Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fat guy101 patch 1 #127

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/jekyll.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll site to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
with:
ruby-version: '3.1' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Build with Jekyll
# Outputs to the './_site' directory by default
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production
- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@v2

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fattt.org.edu.kg
8 changes: 4 additions & 4 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
# You can create any custom variable you would like, and they will be accessible
# in the templates via {{ site.myvariable }}.

title: Your awesome title
email: your-email@domain.com
author: GitHub User
title: My personal blog
email: 1522544392@qq.com
author: FAtGuy101

# Copyright setting
# You can use any html code, currently below placeholders are available:
Expand All @@ -40,7 +40,7 @@ author: GitHub User
# "Copyright (c) 2017-{currentYear} <a href="https://example.com">{author}</a>"
# "Copyright © 2017-2021 Foobar"
#
copyright: "Unpublished Work (cleft) 2017-{currentYear} {author}"
copyright: "Unpublished Work (cleft) 2023-{currentYear} {author}"

description: >- # this means to ignore newlines until "baseurl:"
Write an awesome description for your new site here. You can edit this
Expand Down
105 changes: 105 additions & 0 deletions _posts/2023-09-17-Extended commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
layout: post
title: Extended commands
subtitle: Each post also has a subtitle
categories: markdown
tags: [Linux]
---

## mkpasswd 命令生成随机复杂密码

mkpasswd命令生成随机复杂密码,前提安装expect,然后执行mkpasswd命令即可生成随机的密码。

一、基本的命令安装
安装expect: yum install -y expect


-l # (密码的长度定义, 默认是 9)
-d # (数字个数, 默认是 2)
-c # (小写字符, 默认是 3)
-C # (大写字符, 默认是 2)
-s # (特殊字符, 默认是 1)
-v (详细。。。)
-p prog (程序设置密码, 默认是 passwd)

详细参数,用如下命令查看:

创建了一个长度为20位,包括数字个数5个,包含小写字母个数5个,包含大写字母个数5个,包含特殊符号个数5个。

```
mkpasswd -l 20 -d 5 -c 5 -C 5 -s 5
Z}K7hp0UPJ6v@&,c5{d3
```

随机密码最短只能7位(两个数字,两个小写字母,两个大写字母,一个特殊符号)

```
mkpasswd -l 5
impossible to generate 5-character password with 2 numbers, 2 lowercase letters, 2 uppercase letters and 1 special characters.

```



## bc 计算器

bc 命令是任意精度计算器语言,通常在linux下当计算器用。它类似基本的计算器, 使用这个计算器可以做基本的数学运算。

- -i:强制进入交互式模式;
- -l:定义使用的标准数学库
- ; -w:对POSIX bc的扩展给出警告信息;
- -q:不打印正常的GNU bc环境信息;
- -v:显示指令版本信息;
- -h:显示指令的帮助信息。

+ quit: 退出

**通过管道符**

```
$ echo "15+5" | bc
20
```

scale=2 设小数位,2 代表保留两位:

```
$ echo 'scale=2; (2.777 - 1.4744)/1' | bc
1.30
```

bc 除了 scale 来设定小数位之外,还有 ibase 和 obase 来其它进制的运算:

```
$ echo "ibase=2;111" |bc
7
```

**进制转换**

```
#!/bin/bash

abc=192
echo "obase=2;$abc" | bc
```

执行结果为:11000000,这是用bc将十进制转换成二进制。

```
#!/bin/bash

abc=11000000
echo "obase=10;ibase=2;$abc" | bc
```

执行结果为:192,这是用bc将二进制转换为十进制。

计算平方和平方根:

```
$ echo "10^10" | bc
10000000000
$ echo "sqrt(100)" | bc
10
```
8 changes: 1 addition & 7 deletions about.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
<h2>About</h2>

<p>
:art:&nbsp;Yet another theme for elegant writers with modern flat style
and beautiful night mode.
My personal blog
</p>

<p>
Hey, nice to meet you, you found this Jekyll theme. Here the yet another
theme is a modern theme, and it's quite clear, clean and neat for writers
and posts.
</p>