放置了一些个人的文字和有用的文章。大多数内容游客是看不到的。
Quick guide: set up chroot environment and build Debian packages (sbuild version)
TL;DR: Pbuilder-related tools are ineffective and redundant. By installing sbuild
and schroot
, one can set up clean and reusable chroot environments quickly and use the sole sbuild
command to build Debian source packages (using src tree
or .dsc
files).
Fade away please pbuilder/cowbuilder
; long live sbuild
!
Quick example
Install tools and preparation
sudo apt update; sudo apt install sbuild schroot; sudo mkdir -p /var/lib/sbuild/chroots; # the last component is made by us sudo chown sbuild:sbuild /var/lib/sbuild/chroots;
Initialize a chroot environment using sbuild-createchroot
# Assume host machine is of x86_64 architecture, create an unstable chroot sudo sbuild-createchroot unstable /var/lib/sbuild/chroots/unstable-amd64 \ --alias=sid --alias=UNRELEASED http://deb.debian.org/debian;
Keep (s)chroot environment updated
sudo sbuild-update -ud unstable;
Build a Debian package using sbuild with previously created chroot environment
# If you want to drop superuser privilege, add yourself into sbuild group first. # Other settings might be needed. See sbuild-adduser(1). # ################################# # Option 1: have proper Debian source package sbuild -A -v -d unstable /path/to/package.dsc # # Option 2: chdir into extracted source tree with .orig tarball in parent directory sbuild -A -v -d unstable # Option 3: integrate with git-buildpackage (gbp) gbp buildpackage --git-builder=sbuild -A -v -d unstable # # Notes: # 1. If you need source-only changes (https://wiki.debian.org/SourceOnlyUpload), # append "--source" to sbuild's invocation # 2. If you want to sign your build, append "-kxxxxxxxx" # to your sbuild's invocation, where xxxxxxxx is you gpg keyid
How to destroy schroot environment properly
If you do not wish to use schroot and sbuild anymore, you may use the following tool to properly destroy the schroot environment:
# Destroy the chroot instance named "unstable" sudo sbuild-destroychroot unstable # This script actually does nothing other than providing instructions. # You will need to follow the printed instruction and safely # destroy the schroot instance by yourself.
References
- sbuild(1)
- schroot(1)
- sbuild-createchroot(8)
- sbuild-adduser(8)
- sbuild-update(1)
- sbuild-destroychroot(8)
To be continued…
Updates
- July 19, 2020: Replace httpredir.debian.org with CDN-enabled deb.debian.org.
- July 19, 2020: Add text related to sbuild-destroychroot.
- July 22, 2020: Remove “sudo” from sbuild invocation. No privilege is needed in this case.
配合Git为Debian系发行版打包的正确方式
配合Git为Debian系发行版打包的正确方式
Debian这个发行版历史悠久,其软件包管理工具apt和dpkg更是作为其特色沿用至今,在保留严谨传统的同时得到了长足的发展和演进。然而正是由于其不短的历史(虽然还没到三十年,但是这样的时间跨度对于IT行业的产物已经算惊人的长了),Debian的包管理工具不可避免地存在着稍显沉重的历史包袱。一些过去的真理和守则反而成为了现在的累赘,一代又一代地误导着后来者。为了让后来者少走弯路,我在这里记录一些摸索过程中的体会和技巧,希望能够让更多人体会到Debian的魅力所在。
如果你只想了解最佳的工作流的话,请直接翻到最后面查看。但是具体工具的使用方法需要自行查找资料,或者回到前文寻找相应的内容。
继续阅读
Fast preparation of a source-only upload for Debian
Let’s assume that you find the source code of a software for Debian with a debian/ directory included. How to prepare the .dsc package (Debian source package) used for upload quickly? I will show you here.
- Extract the software into a certain directory, let’s say foobar/.
- Repack original tarball and exclude debian/ dir using
tar
. Rename orig tarball as<PKGNAME>_<PKGVER>.orig.tar.{bz2,gz,lzma,xz}
. Note that if your package is Debian native, you should skip this step. cd foobar/
dpkg-source -b .
(cd ..; debsign ./*.dsc -k<YOUR_GPG_KEY_FINGERPRINT>)
dpkg-genchanges -S > ../<PKGNAME>_<PKGVER>.changes
cd ..; debsign ./*.changes -k<YOUR_GPG_KEY_FINGERPRINT>
All done. You may now upload the source package with dput
tool.
二次规划的MATLAB解法:quadprog函数
声明
转载自新浪博客:漂流瓶jz的博客,版权归原作者。
综述
二次规划为非线性规划的一种,若某非线性规划的目标函数为自变量\(x\)的二次函数,约束条件又全是线性的,就称这种规划为二次规划。
继续阅读
被雪藏的大号瑞士军刀:eric6 IDE
作为一个有跨平台强迫症和被Python惯坏的业余伪程序员,我在挑选开发桌面应用的时候果断地选择了PyQt,因为它结合了Python的强大、快速开发的特点与Qt的跨平台性质。
然而常见的图形应用程序大都需要集成开发环境(IDE)以辅助开发,在挑选IDE时我着实费了一番功夫。让我们简单地列一下现在(2016年初)能够排得上名的IDE:
- PyCharm,常见的选择,据说十分强大,然而它是JetBrains公司的产品(意味着你要结合Java使用),也存在商业版,有一种不爽的感觉。
- Eclipse,没用过不做评价。但是还是Java
- Python IDLE,这东西能用?
今天我要推荐的是一款不是那么出名的软件:eric6 IDE。
OpenStreetMap 项目笔记
本篇笔记既是自己在OSM中参与编辑的一个备忘,也可以作为新手入门编辑工作的一个教程。
法律警示
在中国大陆地区参与OpenStreetMap绘制很可能是非法行为。请参阅法律警示页面:WikiProject_China
您需要对自己的行为负责。
继续阅读
PyQt5 学习笔记
长期更新中,敬请期待……
学习资料整理
PyQt5
- 官方参考文档
- ZetCode 教程
- PyQt5 & Qml 结合教程
- The Hacker University 教程 其一 其二
PyQt4/5
Eric IDE
转载:SQLite 外键
SQLite外键(Foreign Key)支持
声明
本篇文章转载自 ITeye:y150988451 的博文,著作权归原作者所有。
由 hosiet 转载并重新排版。再次转载请保留声明。
外键的定义
从 3.6.19 版开始,SQLite 支持外键约束。(Ubuntu 10.04 的 SQLite 版本是 3.6.22,Debian 6.0 的 SQLite 版本是 3.7.0,Ubuntu 15.04 的 SQLite 版本是 3.8.7.4,供参考)
外键用来强制约束两个表之间“存在”的关系。 继续阅读
VPS搭建记录(一):发行版选择与基础服务搭建
非常幸运地,我曾经抓住机会用正当方式获得了 github education 的100$ DigitalOcean 代金券。在此鄙视一下滥用这个项目进行套利的无良商人。
这学期有机会使用网银+Paypal 激活了DO帐号,开了一个10刀每月的VPS,放在新加坡节点。
VPS 能用来干什么呢?无外乎以下用途:
- 科学上网
- 搭建个人博客
- 挂机运行程序
- 搭建个人邮件服务器
- 运行其它服务
因此,以下一系列文章主要围绕以上内容展开。