AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-284198

lazarus's questions

Martin Hope
lazarus
Asked: 2019-10-17 00:36:57 +0800 CST

ffmpeg 构建在 ubuntu 18.04.2 和 macOS 上的工作方式不同

  • 3

我测试了一个 ffmpeg 命令以在 macOS 上生成缩略图ffmpeg -y -ss 0 -to 10 -i acb.mp4 -qscale:v 2 -frames:v 1 abc.jpeg,它工作正常,而它在 ubuntu 18.04.2(AWS EC2) 上为 ffmpeg 提供了相同的命令错误。

错误 :

Option to (record or transcode stop time) cannot be applied to input url abc.mp4 -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
Error parsing options for input file abc.mp4.
Error opening input files: Invalid argument

我正在使用 AWS EC2 (ubuntu 18.04.2) ,使用 sudo apt install ffmpeg。如果我必须以不同的方式安装它,或者如果我在这里遗漏了什么,有人可以帮我解决这个问题。提前致谢。

video ffmpeg
  • 1 个回答
  • 1105 Views
Martin Hope
lazarus
Asked: 2018-10-18 00:04:38 +0800 CST

shell变量没有从子shell导出?

  • 0

在艰难地学习 bash 时,我发现它subshells从父级继承变量,并且可以在自己的范围内覆盖它。除非我们使用,否则它不会反映到父 shell 中export,

我尝试了下面的示例来导出 VAR1 ,但我没有将 VAR1 值反映到我的父 shell 中。有人可以解释一下如果我在这里遗漏了什么,在此先感谢。

anupam:~$ VAR1="variable under shell $$.pid and $BASHPID.bashid"
anupam:~$ set -o posix; set | grep -i VAR1
VAR1='variable under shell 6137.pid and 6137.bashid'
anupam:~$ (
> echo Inside the subshell
> echo ${VAR1}
> VAR1="variable under subshell with $$.pid and $BASHPID.bashid"
> echo ${VAR1}
> )
Inside the subshell
variable under shell 6137.pid and 6137.bashid
variable under subshell with 6137.pid and 6193.bashid
anupam:~$ set -o posix; set | grep -i VAR1
VAR1='variable under shell 6137.pid and 6137.bashid'
anupam:~$ (
> echo Inside another subshell
> echo ${VAR1}
> VAR1="variable under another subshell with $$.pid and $BASHPID.bashid"
> echo ${VAR1}
> export VAR1="exported variable under another subshell with $$.pid and $BASHPID.bashid"
> )
Inside another subshell
variable under shell 6137.pid and 6137.bashid
variable under another subshell with 6137.pid and 6208.bashid
anupam:~$ set -o posix; set | grep -i VAR1
VAR1='variable under shell 6137.pid and 6137.bashid'
anupam:~$ 
command-line bash gnome-shell
  • 1 个回答
  • 924 Views
Martin Hope
lazarus
Asked: 2018-10-15 23:27:13 +0800 CST

内置 [ , -bash: [: 缺少 `]'

  • 7

在艰难地学习 bash 的过程中,我发现[andtest既是命令又是同义词,而且都是内置的。
由于它是内置的,它不应该给出任何错误 builtin [,但我得到了-bash: [: missing `]',有人可以在这里解释一下内置的行为吗?提前致谢。

anupam:Markdown$ which [
/usr/bin/[
anupam:Markdown$ echo $?
0
anupam:Markdown$ which test
/usr/bin/test
anupam:Markdown$ echo $?
0
anupam:Markdown$ builtin test
anupam:Markdown$ echo $?
1
anupam:Markdown$ builtin [
-bash: [: missing `]'
anupam:Markdown$ echo $?
2
anupam:Markdown$ 
command-line bash
  • 1 个回答
  • 2582 Views
Martin Hope
lazarus
Asked: 2015-08-06 23:40:55 +0800 CST

错误“文件是指向不存在的目标的符号链接”

  • 3

在Emacssum.cpp和中处理两个活动缓冲区时,template.cpp我不小心关闭了我的笔记本电脑 ( Ubuntu 15.04 (Vivid Vervet)),但没有关闭 Emacs,也没有保存这两个文件。

当我重新启动笔记本电脑并通过 列出 Emacs 中的目录内容时C - x C - f /C++/,我得到以下信息。

Ubuntu 上 Emacs 的屏幕截图

.#sum.cpp 之后的行是什么意思?

lrwxrwxrwx  1 anupam anupam   41 Aug  6 00:53 .#sum.cpp -> [email protected]:1438790786

我知道 Emacs 通过 # by 保存未保存的缓冲区autosave,但是访问时#sum.cpp为什么显示以下内容?

文件是指向不存在目标的符号链接?

symbolic-link
  • 3 个回答
  • 3197 Views
Martin Hope
lazarus
Asked: 2015-04-17 19:29:50 +0800 CST

无法在 ubuntu 14.04 LTS 上安装 r-base

  • 0

在通过删除以前版本的 r(3.0.2) 安装更新的最新版本的 r 时,我遇到了以下问题。

anupam :~$ sudo apt-get install r-base
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 r-base : Depends: r-base-core (>= 3.1.3.20150410-1trusty) but it is not going to be installed
          Depends: r-recommended (= 3.1.3.20150410-1trusty) but it is not going to be installed
          Recommends: r-base-html but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我已经完成了在 ubuntu 上安装最新版本的 R的投票最多的答案,,

我也尝试过安装它aptitude..但它没有用我也尝试sudo apt-get autoclean过..我怎么能解决这个问题??

apt
  • 1 个回答
  • 2929 Views
Martin Hope
lazarus
Asked: 2014-12-06 23:04:45 +0800 CST

`curl ifconfig.me` 在 shell 脚本中表现不同

  • 1

我只是尝试了一个简单的基于菜单的 shell 脚本来获取我系统的公共 ip。使用 ( curl ifconfig.me ) .. 但我发现它的行为有所不同。

在这里我试过:

anupam@JAZZ:~/Desktop$ cat menuui
#
# Script to create simple menus and take action according to that selection
# menu item
#
while :
do
    clear
    echo "___________________________________"
    echo "Main Menu"
    echo "___________________________________"
    echo "[1] Show Today's date/time"
    echo "[2] Show files in current directory"
    echo "[3] Show calendar"
    echo "[4] Start a calculator"
    echo "[5] Start editor to write letters"
    echo "[6] Show your public ip"
    echo "[7] Exit/Stop"
    echo "===================================="
    echo -n "Enter your menu choice[1-5]:"
    read yourch
    case $yourch in
    1) echo "Today is `date` ,press a key..." ; read ;;
    2) echo "Files in `pwd` "; ls -l;echo "Press a key..."; read;;
    3) cal; echo "Press a key..." ; read ;;
    4) bc;;
        5) vi;;
        6) echo "Your public ip is `curl ifconfig.me`";;
    7) exit 0 ;;
    *) echo "Opps!!! Please select choices 1,2,3,4 or 5";
    echo "Press a key...";read;;
    esac
done

然后我执行了它... 在此处输入图像描述

这不是我期望的..我怎么能解决这个问题?

networking
  • 1 个回答
  • 1905 Views
Martin Hope
lazarus
Asked: 2014-12-06 08:39:43 +0800 CST

加载第二个 shell /bin/bash 后无法执行?

  • 0

我浏览了解释全局变量 ( export) 的 shell 脚本教程。我遇到了一个自己动手的例子来说明 shell 脚本中全局变量的概念,我试了一下:

$ cat trial

vech=Bus
echo $vech
/bin/bash
echo "before empty line"
echo $vech
echo "after empty line"
vech=Car
echo $vech
exit
echo $vech

该程序的预期输出是:

Bus
before empty line 
after empty line
Car
Bus

但我得到了:

$ chmod 777 trial
$ ./trial
Bus
$ 

我哪里错了?,我是新手,请帮助我。

bash
  • 1 个回答
  • 269 Views
Martin Hope
lazarus
Asked: 2014-11-26 22:18:32 +0800 CST

如何为在同一 wifi 网络上运行的 https 服务器配置 Web 浏览器?

  • 1

我在我的 Android 设备上安装了一个应用程序,它通过修复for和in case of使其成为一个ftp或https服务器。port numberlisteningusernamepasswordftp server

我已经成功地尝试了ftpfrom android deviceas aserver和 my ubuntu 14.10 desktopas a client(by filezilla),两者都local ip's在相同的Wifi连接下。

https server但是当我尝试android device通过让它listen继续port no.50345并local ip address拥有192.168.1.7. 并启动了服务器。

我在同一家庭网络中切换到我的 ubuntu 桌面,并将proxy settingip 192.168.1.7(android 设备)和端口号更改为。到50345(https 服务器正在侦听的端口号),并在我输入的地址栏上

https://192.168.1.7:50345

但它不工作并在我的 android 应用程序日志文件中显示错误:

[jazz]-Listening for connections
[jazz]-192.168.1.10-Error 43:CONNECT method not supported

好吧192.168.1.10,我的 ubuntu 系统的 ip 谁能告诉我为什么会这样??它适用于 ftp,但不适用于 https?

wireless
  • 1 个回答
  • 2020 Views
Martin Hope
lazarus
Asked: 2014-11-20 01:29:44 +0800 CST

无法在 ubuntu 14.10 中安装 twilio python 模块,

  • 0

当我尝试通过...在我的系统上安装 twilio 模块时

anupam@JAZZ:~$ sudo pip install twilio
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2876, in <module>
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 451, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 464, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 639, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==1.5.4

我没有收到错误,我该如何解决??

14.10
  • 1 个回答
  • 1532 Views
Martin Hope
lazarus
Asked: 2014-10-15 09:18:30 +0800 CST

<<(附加模式下的输入重定向)是否仅适用于换行符?

  • 2

在阅读有关在 linux 中创建文件的信息时,我得到了:

在终端创建文件的另一种方法是cat > <filename> << EOF. 将创建一个新文件,您可以键入所需的输入。要退出,请在行首输入 EOF。

所以我在 shell 提示符下尝试了这个

$ cat > test1.txt <<ABC
> This is just a test file.
> ABC
$ cat test1.txt
This is just a test file.

在这里当我输入时ABC(它可以是任何东西 - 只是为了匹配模式)。在换行符它工作(接受就像在ctrl+的情况下会做的那样C),但是当我尝试

$ cat >> test1.txt <<ABC
> just for a trial
> though ABC
> it didnt worked.
> ABC
$ cat test1.txt
This is just a test file.
just for a trial
though ABC
it didnt worked.
$ 

这样做,它只适用于换行符。这是否意味着<<适用于换行符,

里面cat> test1.txt <<ABC到底发生了什么?

command-line
  • 1 个回答
  • 962 Views
Martin Hope
lazarus
Asked: 2014-10-14 08:11:07 +0800 CST

我可以在同一网络(wifi)中使用scp发送文件吗

  • 1

在阅读file transter时linux我得到:我们还可以使用安全复制 (scp) 在两个联网主机之间安全地移动文件。scp 使用 SSH 协议传输数据。

要将本地文件复制到远程系统,请在命令提示符下键入 scp :/home/user/ 并按 Enter 键。

我在我的一个同伴身上试过这个(在同一个 wifi 连接中),我得到了:

anupam@JAZZ:~$ scp data.txt [email protected]:Desktop/
ssh: connect to host 192.168.1.2 port 22: Connection refused
lost connection
anupam@JAZZ:~$ ssh -p 10022 [email protected]
ssh: connect to host 192.168.1.2 port 10022: Connection refused
anupam@JAZZ:~$ ssh -p 10022 [email protected]
ssh: connect to host 192.168.1.2 port 10022: Connection refused
anupam@JAZZ:~$ 

我该如何解决这个问题??

wireless
  • 1 个回答
  • 4711 Views
Martin Hope
lazarus
Asked: 2014-10-13 11:53:41 +0800 CST

如何将任何 ip(在多个 ip 的情况下)分配给任何进程?

  • 0

我很好奇,有没有办法将任何 IP(多个 IP 中的 IP)分配给任何应用程序?这里我有两个 IP,一个来自wireless网络接口,另一个来自wired网络接口。

 $ ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:26:55:b6:36:b3  
              inet addr:192.168.1.15  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::226:55ff:feb6:36b3/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:4680 errors:0 dropped:0 overruns:0 frame:0
              TX packets:4685 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:1940449 (1.9 MB)  TX bytes:840513 (840.5 KB)
              Interrupt:17 

    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:3367 errors:0 dropped:0 overruns:0 frame:0
              TX packets:3367 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:295745 (295.7 KB)  TX bytes:295745 (295.7 KB)

    wlan0     Link encap:Ethernet  HWaddr 00:1e:65:4f:c4:ca  
              inet addr:192.168.1.8  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::21e:65ff:fe4f:c4ca/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:59170 errors:0 dropped:0 overruns:0 frame:0
              TX packets:52111 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:64119125 (64.1 MB)  TX bytes:7433147 (7.4 MB)

有什么办法可以在各个进程之间分配这两个 IP,我该怎么做??另一个问题,普通用户笔记本电脑最多可以拥有多少个 IP?

wireless
  • 2 个回答
  • 112 Views
Martin Hope
lazarus
Asked: 2014-10-13 06:57:30 +0800 CST

关于 /etc/hosts 和我的 DHCP 分配地址的问题

  • 0

在阅读有关 Linux 的文章时,我得到:

您只需键入不带参数的主机名即可查看系统的主机名。

anupam@JAZZ:~$ hostname
JAZZ

然后我发现了这个:

specialhostname localhost与 IP 地址相关联127.0.0.1,并描述了您当前所在的机器(通常具有额外的与网络相关的 IP 地址)。

我试过了:

anupam@JAZZ:~$ cat /etc/hosts
127.0.0.1   localhost
127.0.1.1   JAZZ

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

我在这里感到困惑,但与之关联的 IP不是。 hostname 这不是按照描述的第二部分。JAZZJAZZ127.0.1.1127.0.0.1

另一个问题:我可以使用我的动态 IP(由 DHCP 在我的 wifi 连接中配置)作为本地主机来托管我的 html 或 php 文件吗?

我猜localhost和在这里hostname表示相同localhost。并且也称为loopback address,对应于 127.0.0.1 不是吗?

networking
  • 1 个回答
  • 3429 Views
Martin Hope
lazarus
Asked: 2014-10-10 22:01:54 +0800 CST

/var/log/secure 在 14.04 中不存在,还有其他选择吗?

  • 6

在阅读有关 Linux 的信息时,尤其是有关 Linux 的信息sudo时,我得到:

/var/log/secure当尝试在sudo bash未成功验证用户身份的情况下执行时,系统日志文件中会出现如下消息(通常是):

authentication failure; logname=op uid=0 euid=0 tty=/dev/pts/6 ruser=op rhost= user=op
conversation failed
auth could not identify password for [op]
op : 1 incorrect password attempt ;
TTY=pts/6 ; PWD=/var/log ; USER=root ; COMMAND=/bin/bash

然后我在我的 shell 提示符下尝试了它:

anupam@JAZZ:~$ sudo bash
[sudo] password for anupam: 
root@JAZZ:~# 

然后当我寻找时/var/log/secure,它不在那里

anupam@JAZZ:~$ more /var/log/secure
/var/log/secure: No such file or directory
anupam@JAZZ:~$ ls /var/log
alternatives.log       auth.log         dmesg           gpu-manager.log  mysql.log              pm-suspend.log.2.gz  upstart
alternatives.log.1     auth.log.1       dmesg.0         hp               mysql.log.1.gz         samba                wtmp
alternatives.log.2.gz  auth.log.2.gz    dmesg.1.gz      installer        mysql.log.2.gz         speech-dispatcher    wtmp.1
apache2                auth.log.3.gz    dmesg.2.gz      jetty            mysql.log.3.gz         syslog               Xorg.0.log
apport.log             auth.log.4.gz    dmesg.3.gz      kern.log         mysql.log.4.gz         syslog.1             Xorg.0.log.old
apport.log.1           boot.log         dmesg.4.gz      kern.log.1       mysql.log.5.gz         syslog.2.gz          Xorg.1.log
apport.log.2.gz        bootstrap.log    dpkg.log        kern.log.2.gz    mysql.log.6.gz         syslog.3.gz          Xorg.1.log.old
apport.log.3.gz        btmp             dpkg.log.1      kern.log.3.gz    mysql.log.7.gz         syslog.4.gz
apport.log.4.gz        btmp.1           dpkg.log.2.gz   kern.log.4.gz    pm-powersave.log       syslog.5.gz
apport.log.5.gz        ConsoleKit       faillog         lastlog          pm-powersave.log.1     syslog.6.gz
apport.log.6.gz        cups             fontconfig.log  lightdm          pm-powersave.log.2.gz  syslog.7.gz
apport.log.7.gz        dbconfig-common  fsck            mysql            pm-suspend.log         udev
apt                    dist-upgrade     gdm             mysql.err        pm-suspend.log.1       unattended-upgrades

/var/log/secure我的系统中有其他选择吗?

14.04
  • 1 个回答
  • 16752 Views
Martin Hope
lazarus
Asked: 2014-10-10 20:36:30 +0800 CST

如何知道我是哪种类型的用户?

  • 1

在阅读有关 linux 的文章时,我得到了 :: 默认情况下,Linux 区分几种帐户类型以隔离processes和workloads。Linux 有四种类型的帐户:

  • 根

  • 系统

  • 普通的

  • 网络

现在,当我在 shell 上尝试 $last 时,我得到了:

anupam@JAZZ:~$ last
anupam   pts/0        :0               Fri Oct 10 09:38   still logged in   
anupam   tty1                          Fri Oct 10 09:35   still logged in   
anupam   :0           :0               Fri Oct 10 09:27   still logged in   
reboot   system boot  3.13.0-36-generi Fri Oct 10 09:26 - 09:39  (00:12)    
anupam   pts/24       :0               Thu Oct  9 23:57 - 23:58  (00:00)    
anupam   pts/23       :0               Thu Oct  9 23:26 - 23:58  (00:31)    
anupam   pts/9        :0               Thu Oct  9 23:07 - 23:58  (00:50)    
anupam   pts/0        :0               Thu Oct  9 23:05 - down   (01:23)    
anupam   :0           :0               Thu Oct  9 22:50 - down   (01:37)    
reboot   system boot  3.13.0-36-generi Thu Oct  9 22:50 - 00:28  (01:38)    
anupam   pts/0        :0               Thu Oct  9 21:44 - down   (01:05)    
anupam   :0           :0               Thu Oct  9 18:57 - down   (03:52)    
reboot   system boot  3.13.0-36-generi Thu Oct  9 18:56 - 22:49  (03:52)    
anupam   pts/0        :0               Thu Oct  9 11:07 - crash  (07:49)    
anupam   :0           :0               Thu Oct  9 10:58 - crash  (07:58)    
reboot   system boot  3.13.0-36-generi Thu Oct  9 10:58 - 22:49  (11:51)    
anupam   pts/10       :0               Thu Oct  9 01:30 - 02:21  (00:51)    
anupam   pts/0        :0               Wed Oct  8 22:56 - 02:34  (03:38)    
anupam   pts/0        :0               Wed Oct  8 18:50 - 21:19  (02:29)    
anupam   pts/0        :0               Wed Oct  8 18:09 - 18:50  (00:40)    
anupam   :0           :0               Wed Oct  8 17:50 - down   (08:44)    
reboot   system boot  3.13.0-36-generi Wed Oct  8 17:50 - 02:34  (08:44)    
anupam   pts/0        :0               Wed Oct  8 12:33 - 12:33  (00:00)    
anupam   :0           :0               Wed Oct  8 10:35 - down   (07:14)    
reboot   system boot  3.13.0-36-generi Wed Oct  8 10:34 - 17:49  (07:14)    
anupam   :0           :0               Tue Oct  7 20:13 - down   (13:41)    
reboot   system boot  3.13.0-36-generi Tue Oct  7 20:13 - 09:55  (13:41)    
anupam   tty1                          Tue Oct  7 20:09 - down   (00:02)    
anupam   pts/23       :0               Tue Oct  7 20:00 - down   (00:11)    
anupam   pts/16       :0               Tue Oct  7 19:54 - down   (00:17)    
anupam   pts/0        :0               Tue Oct  7 16:45 - down   (03:26)    
anupam   :0           :0               Tue Oct  7 16:32 - down   (03:39)    
reboot   system boot  3.13.0-36-generi Tue Oct  7 16:32 - 20:11  (03:39)    
anupam   pts/0        :0               Tue Oct  7 10:48 - 16:31  (05:42)    
anupam   :0           :0               Tue Oct  7 10:09 - down   (06:21)    
reboot   system boot  3.13.0-36-generi Tue Oct  7 10:08 - 16:31  (06:22)    
anupam   :0           :0               Mon Oct  6 23:35 - down   (02:15)    
reboot   system boot  3.13.0-36-generi Mon Oct  6 23:35 - 01:50  (02:15)    
anupam   pts/3        :0               Mon Oct  6 22:53 - down   (00:11)    
anupam   pts/0        :0               Mon Oct  6 22:40 - 23:04  (00:24)    
anupam   pts/0        :0               Mon Oct  6 11:26 - 19:07  (07:40)    
anupam   tty1                          Mon Oct  6 10:48 - down   (12:16)    
anupam   pts/0        :0               Mon Oct  6 10:47 - 11:26  (00:39)    
anupam   :0           :0               Mon Oct  6 10:09 - down   (12:55)    
reboot   system boot  3.13.0-36-generi Mon Oct  6 10:08 - 23:05  (12:56)    
anupam   :0           :0               Sun Oct  5 13:21 - down   (19:59)    
reboot   system boot  3.13.0-36-generi Sun Oct  5 13:21 - 09:21  (19:59)    
anupam   :0           :0               Sun Oct  5 08:37 - down   (04:43)    
reboot   system boot  3.13.0-36-generi Sun Oct  5 08:36 - 13:20  (04:43)    
anupam   tty1                          Sat Oct  4 18:29 - down   (07:23)    
anupam   :0           :0               Sat Oct  4 16:22 - down   (09:30)    
reboot   system boot  3.13.0-36-generi Sat Oct  4 16:21 - 01:52  (09:30)    
anupam   pts/9        :0               Sat Oct  4 12:37 - down   (03:43)    
anupam   pts/0        :0               Sat Oct  4 10:49 - down   (05:31)    
anupam   :0           :0               Sat Oct  4 09:00 - down   (07:19)    
reboot   system boot  3.13.0-36-generi Sat Oct  4 09:00 - 16:20  (07:20)    
anupam   :0           :0               Fri Oct  3 20:49 - down   (12:09)    
anupam   tty1                          Fri Oct  3 20:48 - down   (12:10)    
anupam   :0           :0               Fri Oct  3 12:39 - 20:49  (08:09)    
reboot   system boot  3.13.0-36-generi Fri Oct  3 12:39 - 08:59  (20:19)    
anupam   pts/13       :0               Fri Oct  3 00:50 - down   (01:38)    
anupam   pts/7        :0               Thu Oct  2 23:33 - down   (02:54)    
anupam   tty1                          Thu Oct  2 23:27 - down   (03:01)    
anupam   tty2                          Thu Oct  2 22:27 - 23:06  (00:38)    
anupam   pts/7        :0               Thu Oct  2 19:42 - 23:04  (03:21)    
anupam   pts/7        :0               Thu Oct  2 19:34 - 19:42  (00:08)    
anupam   pts/7        :0               Thu Oct  2 19:24 - 19:24  (00:00)    
anupam   pts/0        :0               Thu Oct  2 19:24 - down   (07:03)    
anupam   tty1                          Thu Oct  2 18:24 - 23:06  (04:42)    
anupam   :0           :0               Thu Oct  2 15:48 - down   (10:39)    
reboot   system boot  3.13.0-36-generi Thu Oct  2 15:48 - 02:28  (10:40)    
anupam   pts/0        :0               Thu Oct  2 11:18 - 15:45  (04:26)    
anupam   :0           :0               Thu Oct  2 10:11 - down   (05:34)    
reboot   system boot  3.13.0-36-generi Thu Oct  2 09:33 - 15:45  (06:12)    
anupam   pts/0        :0               Wed Oct  1 19:08 - 01:40  (06:31)    
anupam   :0           :0               Wed Oct  1 18:28 - down   (07:14)    
reboot   system boot  3.13.0-36-generi Wed Oct  1 18:28 - 01:43  (07:14)    

wtmp begins Wed Oct  1 15:18:10 2014

在这里,我只是在第二个属性中得到System Account type对应的system boot,我可以得到一些其他命令,我可以在其中与其他帐户类型进行交互,即Network,Normal(我想我正在运行它,不是吗?),Root(通过使用 sudo ,不是吗?),, 最后一行wtmp begins Wed Oct 1 15:18:10 2014是什么意思?

14.04
  • 1 个回答
  • 226 Views
Martin Hope
lazarus
Asked: 2014-10-03 06:30:50 +0800 CST

无法在 ubuntu 14.04 的铬浏览器中呈现 java 脚本

  • 0

在尝试呈现一个简单的 java 脚本文件来打印斐波那契表时,我在铬中什么也没有(空白页)......如下所示

<!DOCTYPE html>
<html>
<head>
<title> The Fibonacci Numbers </title>
</head>
<body>
<script>
    document.write("<h2>Table of Fibonacci Numbers</h2>");
    for(i=0;j=1;k=0;f=0;i<50;i++;f=j+k;j=k;k=f) {
        document.write("Fibonacci("+i+") = "+f);
        document.write("<br>");
        }
</script>
</body>
</html>      

我想这可能是因为 javascript 在铬中未启用,所以我搜索并运行......

$ sudo apt-get update && sudo apt-get install icedtea-plugin

但是,它没有用??问题是什么??

command-line
  • 2 个回答
  • 96 Views
Martin Hope
lazarus
Asked: 2014-09-27 10:42:07 +0800 CST

如何查看当前运行命令的 PID?

  • 2

在阅读有关 linux 的文章时,我得到了:

默认情况下,在脚本中创建的变量仅对当前 shell 可用;子进程(子 shell)将无法访问已设置或修改的值。允许子进程查看这些值需要使用导出命令。

我试图找到有关子外壳的信息,然后遇到了是否有任何命令可以查看进程的工作方式?,我发现 ltrace 可以用于此,当我搜索如何使用ltraceorstrace时,我发现这PID是必需的属性。

现在,如果我想知道的 PID $ cp file1 file2,我该怎么做??这样我就可以使用ltrace它了??

command-line
  • 2 个回答
  • 2710 Views
Martin Hope
lazarus
Asked: 2014-09-23 03:29:08 +0800 CST

如何列出与某个应用程序关联的所有 PID?

  • -1

在阅读unix socket programming时,我得到了一份声明,A socket is one end of an inter-process communication channel现在我只是想知道 - 有没有办法列出所有PID's或threads更具体地说,与某些应用程序相关联。例如。让我们说。chromium所以通过查看port numbers与之关联的PID's,我可以验证 Socket 确实是一个inter - process communication通道或inter-application level通道。

我查看了threads associated with processes,但我认为它与我的想法不同。

还有一件事,我们如何列出PID's与任何关联的所有内容port number?

sockets
  • 1 个回答
  • 242 Views
Martin Hope
lazarus
Asked: 2014-09-22 22:34:40 +0800 CST

如何查找系统中的 NIC 数量?

  • 1

在尝试查找我的笔记本电脑中的 NIC 数量时,我发现了这个超级用户问题 on finding the total number of NIC's and ports attached on physical device。

我有一些命令可以在系统上尝试:$/sbin/ifconfig -a,当我尝试这个时:

$ /sbin/ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:26:55:b6:36:b3  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:17 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:843 errors:0 dropped:0 overruns:0 frame:0
          TX packets:843 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:70365 (70.3 KB)  TX bytes:70365 (70.3 KB)

wlan0     Link encap:Ethernet  HWaddr 00:1e:65:4f:c4:ca  
          inet addr:192.168.1.8  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::21e:65ff:fe4f:c4ca/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9693 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6750 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4421067 (4.4 MB)  TX bytes:1042929 (1.0 MB)

这是否意味着我有两个以太网卡或 NIC(这两者之间有什么区别?),分别具有物理地址00:26:55:b6:36:b3和00:1e:65:4f:c4:ca?

当我尝试时sudo dmidecode | grep -i "NIC",我一无所获:

$ sudo dmidecode | grep -i "NIC"
$ 

这是什么意思?

当我尝试时,sudo dmidecode | egrep -i "PCI|Available|in use"我得到了:

$ sudo dmidecode | egrep -i "PCI|Available|in use"
        PCI is supported
    Designation: PCI SLOT1
    Type: 32-bit PCI
    Current Usage: Available

我搜索了一下,发现那PCI (Peripheral Component Interconnect)是一个32 bit bus. 它显示我有一个插槽吗?

wireless
  • 3 个回答
  • 2991 Views
Martin Hope
lazarus
Asked: 2014-09-22 06:17:59 +0800 CST

致命错误:“python.h”没有文件或目录?

  • 13

在寻找匈牙利问题的解决方案时,我找到了这个 GitHub 链接。

我浏览了readme.md文件并执行了那里描述的所有内容。复制hungarian.so到我的工作目录后,当我尝试使用编译时hungarian.cpp,make hungarian我得到了这个输出:

anupam@JAZZ:~/Python/hungarian-master$ make hungarian
g++     hungarian.cpp   -o hungarian
hungarian.cpp:7:20: fatal error: Python.h: No such file or directory
 #include "Python.h"
                    ^
compilation terminated.
make: *** [hungarian] Error 1

我在 Stack Overflow 上发现了这个相关问题,但答案对我不起作用。

我是 GitHub 的新手,我不知道如何在g++. 有人可以帮我解决这个问题,下一步该怎么做?

python
  • 3 个回答
  • 103893 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve