小编slm*_*slm的帖子

尝试使用pip在ubuntu 12.04上安装pymssql

我正在尝试使用pip在ubuntu 12.04上安装pymssql.这是我得到的错误.任何帮助都会非常感激,因为我完全失去了!

尝试使用Google搜索,但遗憾的是无济于事......

  Downloading pymssql-2.0.0b1-dev-20130403.tar.gz (2.8Mb): 2.8Mb downloaded
  Running setup.py egg_info for package pymssql
    warning: no files found matching '*.pyx' under directory 'Cython/Debugger/Tests'
    warning: no files found matching '*.pxd' under directory 'Cython/Debugger/Tests'
    warning: no files found matching '*.h' under directory 'Cython/Debugger/Tests'
    warning: no files found matching '*.pxd' under directory 'Cython/Utility'
    Compiling module Cython.Plex.Scanners ...
    Compiling module Cython.Plex.Actions ...
    Compiling module Cython.Compiler.Lexicon ...
    Compiling module Cython.Compiler.Scanning ...
    Compiling module Cython.Compiler.Parsing ...
    Compiling module Cython.Compiler.Visitor ...
    Compiling module Cython.Compiler.FlowControl ...
    Compiling module …
Run Code Online (Sandbox Code Playgroud)

python ubuntu pip pymssql ubuntu-12.04

54
推荐指数
2
解决办法
3万
查看次数

如何在AWS s3和AWS ec2之间传输文件

我正在使用AWS ec2实例.在这个例子中,我得到了一些文件.这些操作由用户数据完成.

现在我想通过在用户数据本身中编写代码来将这些文件存储在s3上.

  • 那么如何在s3上存储这些文件呢?
  • 有任何教程吗?

amazon-s3 amazon-ec2 amazon-web-services

53
推荐指数
5
解决办法
7万
查看次数

如何在ansible中的tasks文件中编写变量

我有这个 play.yml

---
- hosts: 127.0.0.1
  connection: local
  sudo: false

  tasks:
     - include: apache.yml
Run Code Online (Sandbox Code Playgroud)

我的Apache看起来像这样:

vars:
    url: czxcxz

- name: Download apache
  shell: wget {{url}} 
Run Code Online (Sandbox Code Playgroud)

这给了我错误.

如果我删除vars然后它的工作原理.但是我希望将变量包含在任务中,以便我可以将不同的变量分别保存在不同的任务中.

ansible ansible-playbook

46
推荐指数
4
解决办法
10万
查看次数

一个进程如何拦截Linux上另一个进程的stdout和stderr?

我有一些应该停止运行的脚本,但永远都是这样.

有什么办法可以用可读的方式弄清楚他们写的是什么?stdout和stderr?

例如,我试过这样做

$ tail -f /proc/(pid)/fd/1
Run Code Online (Sandbox Code Playgroud)

但这并没有真正起作用.无论如何,这是一个长镜头.

还有其他想法吗?因为看到这一点,它本身就是非常冗长和难以理解的.

注意:我对他们的输出感兴趣,而不是其他任何东西.我有能力自己搞清楚其他事情; 这个问题只关注在启动它之后访问正在运行的进程的stdout和stderr .

linux stdout

43
推荐指数
5
解决办法
4万
查看次数

如何知道linux调度程序的时间片?

我正在寻找Linux内核的时间片(或量子)的值.

有没有/proc公开此类信息的文件?

(或)它在我的发行版的Linux头文件中是否定义良好?

(或者)是否有Linux API(可能是sysinfo)的C函数公开此值?

提前致谢.

c linux linux-kernel embedded-linux procfs

39
推荐指数
5
解决办法
5万
查看次数

ssh:检查隧道是否存活

我编写了一个小的bash脚本,它需要一个ssh隧道来从远程服务器中绘制数据,因此它会提示用户:

echo "Please open an ssh tunnel using 'ssh -L 6000:localhost:5432 example.com'"
Run Code Online (Sandbox Code Playgroud)

我想检查用户是否已打开此隧道,如果没有隧道,则退出并显示错误消息.有没有办法查询ssh隧道,即检查本地端口6000是否真的通过隧道连接到该服务器?

ssh tunneling ssh-tunnel

36
推荐指数
5
解决办法
9万
查看次数

如何使用GCC的多个版本

我们有一个新的应用程序需要glibc 2.4(来自gcc 4.1).我们运行的机器有gcc 3.4.6.我们无法升级,应用程序必须在此计算机上运行.

我们安装了gcc 4.1,但是,在编译时,它使用的是3.4.6中的所有包含等.

我们如何解决这个问题?

有关将4.1用于此应用程序的任何建议吗?

c++ linux gcc g++

35
推荐指数
1
解决办法
6万
查看次数

错误:在mac mountian lion os上安装rails时无法构建gem native扩展

我最近更新到Mountain Lion并重新安装了Ruby,但是当我尝试运行测试Rails应用程序时,我收到一条错误消息,指出我的系统上"当前未安装Rails".我按照它说的做,输入sudo gem install rails并获得:

cleared faster_require caches due to new gem install...
Successfully installed rails-3.2.7
1 gem installed
Installing ri documentation for rails-3.2.7...
Installing RDoc documentation for rails-3.2.7...
Run Code Online (Sandbox Code Playgroud)

但是当我检查安装哪个rails版本时,我得到的是:

Rails is not currently installed on this system. To get the latest version, simply type:

    $ sudo gem install rails

You can then rerun your "rails" command.
Run Code Online (Sandbox Code Playgroud)

我也尝试过gem install rails:

Building native extensions.  This could take a while...
ERROR:  Error installing rails:
    ERROR: Failed to build …
Run Code Online (Sandbox Code Playgroud)

ruby ruby-on-rails ruby-c-extension

31
推荐指数
3
解决办法
4万
查看次数

是否有条件地提示变量?

如果它不在环境变量中,我希望能够提示我的超级安全密码变量.(我想我可能不想把这个定义放到.bash_profile或其他一个地方.)

这不起作用.它总是提示我.

vars:
  THISUSER: "{{ lookup('env','LOGNAME') }}"
  SSHPWD:   "{{ lookup('env','MY_PWD') }}"

vars_prompt:
  - name: "release_version"
    prompt: "Product release version"
    default: "1.0"
    when: SSHPWD == null
Run Code Online (Sandbox Code Playgroud)

注意:我在Mac上,但我希望任何解决方案都与平台无关.

variables ansible

31
推荐指数
3
解决办法
3万
查看次数

VirtualBox for Apache中的共享文件夹

我的主机是ArchLinux,我在CentOS客户端运行Apache.我有共享文件夹中的vhost配置和所有站点代码.为了能够将vhost配置放在共享文件夹中,我将共享文件夹挂载为apache:apache.

shared    /mnt/shared    vboxsf    defaults,uid=48,gid=48  0 0
Run Code Online (Sandbox Code Playgroud)

当我在主机中编辑文件时,Apache将始终开始发送带有尾随字符的旧版本文件.在vim中,它们显示为^ @,所以我猜它们是空字符.即使我编辑第一行,空字符的数量也与我所做的更改数量有关,最后显示空字符.如果我推测,它看起来像一个糟糕的差异.

如果我停止httpd,umount重新安装,并启动httpd该文件看起来很好.只是重新启动httpd没有帮助.

我该如何调试mount?什么都没有跳出来对我说/var/log.

apache mount virtualbox shared-directory

30
推荐指数
1
解决办法
9288
查看次数