Ubuntu

Change libpcap Version on macOS (Apple removed a feature)

主宰稳场 提交于 2021-01-29 09:24:25
问题 I just want to use tcpdump with the same -Qout functionality that is available on Ubuntu. On macOS tcpdump and libpcap have been stripped off the functionality to filter with -Qout. tcpdump -Qout -nnSX -c 10 -w packet.pcap port XXXX tcpdump: cannot parse term at: tcpdump: invalid expression "out" I have build tcpdump (./configure, make, make install) and PATH=/usr/local/sbin:$PATH . When I check with tcpdump --version tcpdump version 4.9.3 libpcap version 1.8.1 -- Apple version 79.250.1 Now

ubuntu 开机启动shell脚本

被刻印的时光 ゝ 提交于 2021-01-29 09:24:15
1.创建shell启动脚本test 2.将启动脚本复制到 /etc/init.d 目录下 3.设置脚本文件权限 sudo chmod 755 /etc/init.d/test 4.设置脚本启动 sudo update-rc.d test defaults 95 //95 为启动优先级,越小优先级越高 // 执行后输出信息 update-rc.d: warning: /etc/init.d/test missing LSB information update-rc.d: see <http://wiki.debian.org/LSBInitScripts> Adding system startup for /etc/init.d/test ... /etc/rc0.d/K95test -> ../init.d/test /etc/rc1.d/K95test -> ../init.d/test /etc/rc6.d/K95test -> ../init.d/test /etc/rc2.d/S95test -> ../init.d/test /etc/rc3.d/S95test -> ../init.d/test /etc/rc4.d/S95test -> ../init.d/test /etc/rc5.d/S95test -> ../init.d/test 4.卸载启动脚本

Accessing the files out of docker container

只愿长相守 提交于 2021-01-29 09:15:39
问题 I have created a docker container image, and working inside the container (setting up filesystem, creating code files, installing dependencies etc). On my Ubuntu machine, I keep a huge file under a directory so called /dataset/my_data/ . When I work in the container, it is not straightforward to access the above directory. Is there any possibility to access it from inside the container image interactively? If yes, how? 回答1: You can mount the directory as a volume: docker ... --mount type=bind

How to create multiple instances of GIT?

纵饮孤独 提交于 2021-01-29 09:11:10
问题 I am working to create a project management system that uses GIT. Right now it is on early stage. The idea is We have departments like "Design","Web","Android" and etc We have many projects under every department. We have GIT repository for each project. For this purpose what i want to do is that create instances of GIT as many as departments. So every instance has its own SSH port number in any order e.g 1234 for "Design GIT Instance" and 1235 for "Web GIT Instance" and so on. So any

Linux系统中,常见的隐形文件有哪些?

我们两清 提交于 2021-01-29 08:35:55
  在Linux系统中,除了我们常见的文件之外,其实还有很多隐形文件的存在,那么你知道常见的隐形文件有哪些?跟着小编来看看吧。   1. shell和命令行程序的配置文件,根据使用的特定shell和类似命令的应用程序,特定的文件名称会变化,.bashrc、.vimrc和.zshrc包含已经更改的有关shell的操作环境的任何设置,或者对vim等命令行使用工具的设置进行的调整,删除这些文件将使关联的应用程序返回到其默认状态。   2. 用户配置文件,通常是.profile或者.bash_profile,保持shell的用户设置,该文件通常包含PATH环境变量和别名,PATH环境变量控制着shell寻找可执行命令的位置,通过添加或修改PATH,可以更改shell的命令查找位置,别名更改了原有命令的名称,如果删除.profile文件,通常可以在/etc/skel目录中找到默认版本。   3. 桌面环境设置,主目录中文件保存着桌面环境的任何定制,其中包括桌面背景、屏幕保护程序、快捷键、菜单栏和任务栏图标以及用户针对其桌面环境设置的其他任何内容。当你删除这个文件时,用户的环境会在下一次登录时恢复到新的用户环境。   4. 应用程序的配置文件可以在Ubuntu的.config中找到,主要是对应用程序首选项菜单中的设置、工作区配置等。   5. Web 浏览器数据文件也可以在Ubuntu的

Ubuntu下yaml-cpp的安装

被刻印的时光 ゝ 提交于 2021-01-29 08:13:58
由于要学习的代码中用到了yaml-cpp,因此在此记录一下安装过程,翻译自: stackoverflow 。 关于yaml-cpp可以看一下 yaml , yaml-cpp 来了解一下。 首先删除本地原有的yaml-cpp库: The installer just copies the header files to the directory $PREFIX/include/yaml-cpp and the library files to $PREFIX/lib/libyaml-cpp.so . ( $PREFIX is probably /usr/local ) Just remove the header directory and the library files and it should be uninstalled. 翻译一下这意思就是安装仅仅是将一些头文件拷贝到 $PREFIX/include/yaml-cpp;将一些库文件拷贝到 $PREFIX/lib,比如libyaml-cpp.so( $PREFIX 在Ubuntu下一般是/usr/local)。 因此将头文件目录和这些库文件删除掉,那么就算完成了卸载。 然后是yam-cpp的安装,这里说的是利用源码进行安装的方式: git clone https: // github.com/jbeder/yaml

MySQL turns itself off after discord bot left on for about 12 hours

一世执手 提交于 2021-01-29 07:26:08
问题 I'm hosting a discord.js bot on an ubuntu VPS, and the bot uses MySQL as its database. I turn on the bot, and leave it, and it works fine, but after about 12 hours (it tends to vary), the bot goes offline, because of an error, saying MySQL server disconnected. But, if I restart the bot, MySQL turns back on, and bits of the bot that require the database use the database perfectly fine. I'm not sure if this is an error with MySQL, Node.JS or Ubuntu, but I don't know how to fix it. Thanks! 回答1:

Edit and compile a kernel module

五迷三道 提交于 2021-01-29 07:17:18
问题 I'm trying to edit one module from kernel source and compile it for kernel: 5.4.0-40-generic #44-Ubuntu . This is how i did it: git clone git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal git checkout -b temp Ubuntu-5.4.0-40.44 nano drivers/media/usb/siano/smsusb.c make oldconfig make prepare make modules_prepare make SUBDIRS=scripts/mod make SUBDIRS=drivers/media/usb/siano modules cd drivers/media/usb/siano/ insmod smsusb.ko I got this error: insmod: ERROR: could not

Can't run php artisan on ubuntu terminal on windows 10 machine

走远了吗. 提交于 2021-01-29 07:12:01
问题 I am trying to run artisan commands on ubuntu terminal from Windows machine, using Windows terminal and Ubuntu app from Microsoft store. Tried and searched many times but still no progress. I tried steps in this question Laravel PHP Command Not Found as when I am running php artisan .. error shows "Command 'php' not found, but can be installed with:sudo apt install php7.4-cli" also I downloaded laravel globally on my windows machine but when I try to run laravel on ubuntu terminal "/usr/bin

Mingw-w64 toolchain for Bazel (Ubuntu 20.04.1 )

不打扰是莪最后的温柔 提交于 2021-01-29 07:00:14
问题 I am trying to create my toolchain for mingw-w64 on Ubuntu with Bazel. I am following this tutorial: https://docs.bazel.build/versions/master/tutorial/cc-toolchain-config.html. However, when I try to adapt the compilers paths to the paths of my mingw64 installation i get the following error: bazel build --config=mingw_config -s //main:hello-world --verbose_failures Starting local Bazel server and connecting to it... INFO: Analyzed target //main:hello-world (16 packages loaded, 46 targets