debian

How to get total size of folders with find and du?

社会主义新天地 提交于 2019-12-29 05:03:07
问题 I'm trying to get the size of the directories named "bak" with find and du. I do that : find -name bak -type d -exec du -ch '{}' \; But it returns the size for each folder named "bak" not the total. Anyway to get them ? Thanks :) 回答1: Use xargs(1) instead of -exec : find . -name bak -type d | xargs du -ch -exec executes the command for each file found (check the find(1) documentation). Piping to xargs lets you aggregate those filenames and only run du once. You could also do: find -name bak

Executing a script on startup using BeagleBone Black

拜拜、爱过 提交于 2019-12-29 04:24:45
问题 I have an a.out which I want to run when my BeagleBone boots up. It is actually a socket server which I want to start as soon as the BeagleBone powers up. I tried to put this in /etc/init.d , but it didn't help. I wrote a shell script to run this executable but even that did not help. What can I do to make a script run as soon as it boots up? 回答1: It took me quite some time to figure this out, but with lots of research, I finally found what I was looking for. Compile the required code. Create

debian常用指令

别来无恙 提交于 2019-12-29 00:30:53
查看软件xxx安装内容 dpkg -L xxx 查找软件 apt-cache search 正则表达式 查找文件属于哪个包 dpkg -S filename apt-file search filename 查询软件xxx依赖哪些包 apt-cache depends xxx 查询软件xxx被哪些包依赖 apt-cache rdepends xxx 增加一个光盘源 apt-cdrom add 系统升级 apt-get update apt-get upgrade apt-get dist-upgrade 清除所有删除包的残余配置文件 dpkg -l |grep ^rc|awk ''{print $2}'' |tr ["\n"] [" "]|sudo xargs dpkg -P - 编译时缺少h文件的自动处理 auto-apt run ./configure 查看安装软件时下载包的临时存放目录 ls /var/cache/apt/archives 备份当前系统安装的所有包的列表 dpkg --get-selections | grep -v deinstall > ~/somefile 从上面备份的安装包的列表文件恢复所有包 dpkg --set-selections < ~/somefile dselect 清理旧版本的软件缓存 apt-get autoclean 清理所有软件缓存

Kerberos+LDAP+NFSv4 实现单点登录(中)

隐身守侯 提交于 2019-12-26 15:48:20
Kerberos+LDAP+NFSv4 实现单点登录(中) 五.nfs服务器的安装 1.安装nfs-kernel-server root@debian:~# apt-get install nfs-kernel-server nfs-common 修改/etc/default/nfs-kernel-server文件 将 NEED_SVCGSSD="" 改为 NEED_SVCGSSD="yes" 重启nfs-kernel-server root@debian:~# /etc/init.d/nfs-kernel-server stop root@debian:~# /etc/init.d/nfs-kernel-server start root@debian:~# ps -e |grep gss 10275 ? 00:00:00 rpc.svcgssd 2.安装libnss-ldapd、nslcd 为了获取ldap用户信息,要安装libnss-ldapd、nslcd 在新立得选上libnss-ldapd、nslcd会自动将libpam-ldapd、nscd、nslcd-utils三个包打上安装标记,可手工将该三个包去掉安装标记,不需此三个包 root@debian:~# apt-get install libnss-ldapd nslcd 注意安装nslcd配置过程中

Kerberos+LDAP+NFSv4 实现单点登录(下)

耗尽温柔 提交于 2019-12-26 15:10:37
Kerberos+LDAP+NFSv4 实现单点登录(下) 六.nfs客户机的安装 nfs客户机也即SSSD客户机,需安装sssd和nfs-common 1.安装sssd 会自动安装libsasl2-modules-gssapi-mit(非依赖) libsasl2-modules-gssapi-mit和libsasl2-modules-gssapi-heimdal两者冲突,安装libsasl2-modules-gssapi-heimdal也可以 root@debian:~# apt-get install sssd sssd-krb5 sssd-ldap libsasl2-modules-gssapi-heimdal 安装后的sssd.conf是空白文件,nsswitch.conf没改变 root@debian:~# ls -l /etc/sssd/sssd.conf -rw------- 1 root root 1938 Jun 10 11:18 /etc/sssd/sssd.conf 仅拥有者可读(SSSD文档要求sssd.conf仅root根用户可读写,否则无法启动sssd) 修改配置文件sssd.conf、nsswitch.conf 1)查看sssd.conf root@debian:~# cat /etc/sssd/sssd.conf [sssd] config_file

Kerberos+LDAP+NFSv4 实现单点登录(上)

不打扰是莪最后的温柔 提交于 2019-12-26 15:10:30
Kerberos+LDAP+NFSv4 实现单点登录(上) Kerberos : 身份认证 LDAP : 目录信息服务 NFSv4 : 网络共享 实验环境 : debian 9 三台主机: nfs服务器 : 192.168.1.103 nfs客户机 : 192.168.1.102 即SSSD客户端+NFS客户端 kdc服务器 : 192.168.1.101 即Kerberos+LDAP 以下 root@debian:~# 表示以root根用户运行命令 一.安装NTP时间同步 要使用Kerberos提供身份认证,各主机需时间同步 在一台主机上安装时间同步服务器 root@debian:~# apt-get install ntp 在其它主机上安装时间同步客户端 root@debian:~# apt-get install ntpdate 二.配置本地域 假定域是ctp.net 安装Kerberos、LDAP过程都会用到域,NFSv4认证需要到域 以上三台主机的/etc/hosts文件内容都配置如下: 127.0.0.1 localhost 127.0.1.1 debian.ctp.net debian 192.168.1.103 srvnf.ctp.net srvnf 192.168.1.102 clnf.ctp.net clnf 注意:127.0.1.1一定要xxx.ctp

LXC容器运行X Server(续1)

跟風遠走 提交于 2019-12-26 14:44:16
容器要运行X桌面环境可通过ssh,xdmcp远程方式,此时容器是X Client,容器是无需安装X Server. 上篇( https://blog.51cto.com/13752418/2440496 )容器中以本地方式运行X是在宿主的虚拟终端(如vt09)上运行容器X. 本文是续篇,同样容器中以本地方式运行X Server,介绍的内容是容器运行X在宿主的桌面窗口之上,容器以本地方式登录桌面环境,即界面上类似VirtualBox的方式. 实验环境 : debian 11 主机名 shell提示符 ----------------------------------------------- 宿主 : debian root@debian:/# 容器 : vm1 root@vm1:/# 一.简单步骤 1.宿主 1)安装Xephyr root@debian:/# apt-get install xserver-xephyr 2)安装容器工具LXC root@debian:/# apt-get install lxc 3)创建容器 root@debian:/# lxc-create -t debian -n vm1 创建了以debian为模版的容器,其根目录是/var/lib/lxc/vm1/rootfs/ 这一制作容器的根的过程耗费较长时间,如果已有了容器,此步骤可省略. 4

how to make emacs open all buffers in one window (debian/linux/gnome)

余生长醉 提交于 2019-12-25 16:42:40
问题 In osx I make all new emacs buffers open in the same window/frame by putting this in .emacs. (setq ns-pop-up-frames nil) Alias to make emacs open a file in a new buffer (NOT frame) and be activated/come to front? I want to be able to do the same in debian (gnome). Is it possible? A solution that will also work for xmonad (and similar wms) would be very much appreciated. 回答1: pop-up-frames is a standard emacs variable: pop-up-frames is a variable defined in `window.el'. Its value is nil

Travis Can't Find Debian Package in Custom Source Repo, Why?

隐身守侯 提交于 2019-12-25 09:33:36
问题 The instructions here appear to be logical, i've tried both with, and without docker enabled: https://docs.travis-ci.com/user/installing-dependencies/ Here is the log: Adding APT Sources (BETA) $ export DEBIAN_FRONTEND=noninteractive 0.01s$ echo "deb https://dl.bintray.com/solvingj/public-deb unstable main" | sudo tee -a /etc/apt/sources.list > /dev/null Installing APT Packages (BETA) $ export DEBIAN_FRONTEND=noninteractive 3.03s$ sudo -E apt-get -yq update &>> ~/apt-get-update.log 0.30s$

Changing the static IP of Beagle Bone Black USB0 [closed]

两盒软妹~` 提交于 2019-12-25 07:42:29
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . My goal is to change the IP address of USB0 . The Beagle Bone Black run Debian. I tryed to change /etc/network/interfaces such that default address is 192.168.7.3 instead of 192.168.7.2 as this: iface usb0 inet static address 192.168.7.3 netmask 255.255.255.0 network 192.168.7.0 gateway 192.168.7.1 After running