Golang入门指南


  • 首页

  • todo

  • 思考

  • life

  • food

  • OS

  • lua

  • redis

  • Golang

  • C

  • TCP/IP

  • ebpf

  • p4

  • OpenVPN

  • IPSec

  • L2TP

  • DNS

  • distributed

  • web

  • OpenWRT

  • 运维

  • Git

  • 鸟哥的私房菜

  • IT杂谈

  • 投资

  • About Me

  • 友情链接

  • FTP

  • 搜索
close

OpenWrt 系统UCI详解(Lua、C语言调用uci接口实例)

时间: 2022-10-24   |   分类: OpenWrt     |   阅读: 3840 字 ~8分钟

UCI简介

“uci"是"Unified Configuration Interface”(统一配置界面)的缩写,用于OpenWrt整个系统的配置集中化。

阅读全文 »

Git 清除历史记录

时间: 2022-10-24   |   分类: git     |   阅读: 166 字 ~1分钟

Git 清除所有历史记录

1. 进入仓库,拉一个分支比如名为 latest_branch
git checkout --orphan latest_branch
  • –orphan 创建一个无任何历史记录的孤儿分支
2. 添加所有文件到上述分支并提交一次
git add -A
git commit -am 'initial commit'
3. 删除 master 分支

登录后复制

阅读全文 »

How to fix ‘fatal: refusing to merge unrelated histories’ Git error

时间: 2022-10-24   |   分类: git     |   阅读: 967 字 ~2分钟

What is the ‘fatal: refusing to merge unrelated histories’ error?

The fatal: refusing to merge histories error is a fairly common Git error. It appears when a developer tries to merge two unrelated projects into a single branch.

This error appears when the branch has its commit histories and tags incompatible with the pull request or clone.

阅读全文 »

OpenWrt Luci流程分析

时间: 2022-10-21   |   分类: OpenWrt     |   阅读: 2545 字 ~6分钟

页面请求:

代码结构

在openwrt文件系统中,lua语言的代码不要编译,类似一种脚本语言被执行,还有一些uhttpd服务器的主目录,它们是:

/www/index.html
cgi-bin/luci
luci-static/xxx/xx.css、js、gif

/usr/lib/lua/nixio.so、uci.so
luci/http.lua、dispatcher.lua、core…
controller/xxx.lua
model/xxx.lua
view/xxx.lua

界面显示

网页请求格式基本都如下所示:,说明处理都在服务器的默认网站下的/cgi-bin/luci文件进行处理。

阅读全文 »

Openwrt 编译x86镜像

时间: 2022-10-21   |   分类: OpenWrt     |   阅读: 444 字 ~1分钟

有些同学可能想学习openwrt系统,但手头又没有嵌入式板子,是编译和运行系统,然后再增加自己的功能。下面介绍如何编译openwrt系统后再虚拟机下运行。


  1. 下载openwrt最新代码 在github上搜索openwrt,找到下载地址https://github.com/openwrt/openwrt.git
  2. 在ubuntu下执行命令克隆openwrt源码 git clone https://github.com/openwrt/openwrt.git 3. 执行以下命令更新包 ./scripts/feeds update -a ./scripts/feeds install -a 更新package,否则luci等package通过make menuconfig 不能显示 4.配置目标系统 make menuconfig 选择平台为X86 这里写图片描述

选择vmdk目标文件格式

阅读全文 »

Openwrt LuCI UCI(三)

时间: 2022-10-21   |   分类: OpenWrt     |   阅读: 4277 字 ~9分钟

UCI简介

  • UCI是Unified Configuration Interface的缩写,翻译成中文就是统一配置接口,用途就是为OpenWrt提供一个集中控制的接口。
  • 配置接口启动流程:
  • ① 启动脚本 /etc/init.d/xxx;
  • ② 启动脚本通过UCI分析库从 /etc/config/xxx 获得启动参数;
  • ③ 启动脚本完成正常启动。

在这里插入图片描述

阅读全文 »

Openwrt LuCI CBI(二)

时间: 2022-10-21   |   分类: OpenWrt     |   阅读: 4392 字 ~9分钟

一、CBI控件类型汇总

  • CBI模型是描述UCI配置文件结构的Lua文件,并且CBI解析器将lua文件转为HTML呈现给用户 。
  • 所有 CBI 模型文件必须返回类型为 luci.cbi.Map 的对象。
  • CBI 模型文件的范围由 luci.cbi 模块的内容和 luci.i18n 的转换函数自动扩展。
名称 描述 继承自 模板
NamedSection A fixed configuration section defined by its name NamedSection = class(AbstractSection) cbi/nsection
TypedSection A (set of) configuration section(s) defined by the type TypedSection = class(AbstractSection) cbi/tsection
Node Node pseudo abstract class Node = class() cbi/node
Template A simple template element Template = class(Node)
Map A map describing a configuration file Map = class(Node) cbi/map
Compound Container Compound = class(Node) cbi/compound
Delegator Node controller Delegator = class(Node) cbi/delegator
SimpleForm A Simple non-UCI form SimpleForm = class(Node) cbi/simpleform
Form Form = class(SimpleForm)
AbstractSection AbstractSection = class(Node)
SimpleSection SimpleSection = class(AbstractSection) cbi/nullsection
Table Table = class(AbstractSection) cbi/tblsection
AbstractValue An abstract Value Type AbstractValue = class(Node)
Value A one-line value Value = class(AbstractValue) cbi/value
DummyValue This does nothing except being there DummyValue = class(AbstractValue) cbi/dvalue
Flag A flag being enabled or disabled Flag = class(AbstractValue) cbi/fvalue
ListValue A one-line value predefined in a list ListValue = class(AbstractValue) cbi/lvalue
MultiValue Multiple delimited values MultiValue = class(AbstractValue) cbi/mvalue
StaticList StaticList = class(MultiValue)
DynamicList DynamicList = class(AbstractValue) cbi/dynlist
TextValue A multi-line value TextValue = class(AbstractValue) cbi/tvalue
Button Button = class(AbstractValue) cbi/button
FileUpload FileUpload = class(AbstractValue) cbi/upload
FileBrowser FileBrowser = class(AbstractValue) cbi/browser
Page A simple node Page = class(Node)

二、CBI常用控件用法详解

2.1 class Map (config, title, description)

  • This is the root object of the model.。
  • 模型的根对象

参数说明:

阅读全文 »

Pushing a branch to Bitbucket fails with the error, "refspec matches more than one".

时间: 2022-10-21   |   分类: git     |   阅读: 414 字 ~2分钟

Summary

The error “refspec matches more than one” is shown while pushing a branch to Bitbucket.

This occurs because there is more than one Git ref that matches the ref name specified in the push command.

Example

Suppose a repo has a branch and a tag with the same name, “dev”.

When an attempt is made to push the “dev” branch to the remote, the error “refspec matches more than one” will be shown and the push fails.

阅读全文 »
24 25 26 27 28 29 30 31 32

日志
分类
标签
RSS 订阅
GitHub
© 2009 - 2025
粤ICP备2021068940号-1 粤公网安备44011302003059
0%