海运的博客

OpenWRT交叉编译非官方软件sshpass

发布时间:October 30, 2013 // 分类:OpenWrt // No Comments

安装编译环境:

apt-get install build-essential libncurses5-dev zlib1g-dev

下载交叉编译环境及sshpass源码:

wget http://downloads.openwrt.org/backfire/10.03.1/brcm63xx/OpenWrt-SDK-brcm63xx-for-Linux-i686-gcc-4.3.3%2bcs_uClibc-0.9.30.1.tar.bz2
tar jxvf OpenWrt-SDK-brcm63xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1.tar.bz2 
mkdir -p OpenWrt-SDK-brcm63xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/package/sshpass
cd OpenWrt-SDK-brcm63xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/package/sshpass
wget http://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpass-1.05.tar.gz
tar zxvf sshpass-1.05.tar.gz
mv sshpass-1.05 src

sshpass目录新建Makefile文件:

include $(TOPDIR)/rules.mk

# Name and release number of this package
PKG_NAME:=sshpass
PKG_RELEASE:=1.05

PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk

define Package/sshpass
    SECTION:=utils
    CATEGORY:=Utilities
    TITLE:=sshpass
endef

define Package/sshpass/description
    Sshpass is a tool for non-interactivly performing password authentication with SSH's
endef

# Specify what needs to be done to prepare for building the package.
define Build/Prepare
    mkdir -p $(PKG_BUILD_DIR)
    $(CP) ./src/* $(PKG_BUILD_DIR)/
endef


# Specify where and how to install the program.
define Package/sshpass/install
    $(INSTALL_DIR) $(1)/bin
    $(INSTALL_BIN) $(PKG_BUILD_DIR)/sshpass $(1)/bin/
endef

# This line executes the necessary commands to compile our program.
$(eval $(call BuildPackage,sshpass))

编译sshpass:

cd ../
make package/sshpass/compile

编译成功的程序文件:

ls bin/brcm63xx/packages/
Packages  Packages.gz  sshpass_1.05_brcm63xx.ipk

编译过程中如遇到以下错误:

staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/lib/libc.so: undefined reference to `_dl_app_init_array’

需修改:

TARGET_LDFLAGS:=-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib

为:

TARGET_LDFLAGS+= -L$(TOOLCHAIN_DIR)/usr/lib -L$(TOOLCHAIN_DIR)/lib -Wl,-rpath=$(TOOLCHAIN_DIR)/lib

sshpass使用:

sshpass -p pass ssh -p 22 -o StrictHostKeyChecking=no root@haiyun.me 'uptime'

此内容被密码保护

发布时间:October 28, 2013 // 分类:OpenWrt // No Comments

请输入密码访问

此内容被密码保护

发布时间:October 27, 2013 // 分类:网络工具 // No Comments

请输入密码访问

Windows7通过任务计划启动程序绕过UAC

发布时间:October 22, 2013 // 分类:Windows // No Comments

新建计划任务以最高权限运行,设置操作为启动相应程序
image75.png
通过快捷方式使用计划任务启动程序,启动时会有显示cmd窗口:

C:\Windows\System32\schtasks.exe /run /tn runregedit

使用VBS脚本隐藏CMD窗口:

set ws=createobject("wscript.shell")
ws.run """C:\Windows\System32\schtasks.exe"" /run /tn runregedit",vbHide
wscript.quit

Total commander和Everything整合

发布时间:October 21, 2013 // 分类:Total Commander // No Comments

Total commander中调用Everything搜索文件:
首先定义调用Everything.exe 命令及参数,编辑配置文件usercmd.ini添加以下:

[em_Everything]   
cmd=D:/Program Files/Everything/Everything.exe   
param="-search "%P ""  
#%P为在当前目录下,P后面空格包含子目录

设置相应快捷键调用上面定义的命令,编辑wincmd.ini在[Shortcuts]下添加:

A+F=em_Everything

Everything搜索结果中调用Total commander打开目录,编辑Everything.ini添加:

open_folder_path_command=$exec("D:/Program Files/totalcmd/TOTALCMD64.EXE" "/O" "/S" "/T" "$parent(%1)")   
open_folder_command=$exec("D:/Program Files/totalcmd/TOTALCMD64.EXE" "/O" "/S" "/T" "%1")  
#参数O只打开一个实例,N相反,参数T在新标签中打开,S在焦点窗口打开标签
分类
最新文章
最近回复
  • koldjf: 不能过滤
  • 杰迪武士: 此文甚好甚强巨,依照此文在树莓派2 + Rasbian上部署成功 感谢博主美文共赏
  • 海运: ups不知有没选项可设置此参数,不过你可以在另外一台电脑上安装nut客户端自动关机。
  • kgami: 想请教一下,设置了的电脑自动关机之后,几秒后UPS怎么也跟着关机了,导致另外一台电脑没关机就断...
  • 海运: 写的很详细了啊,/etc/nut/hosts.conf用以nut-cgi连接nut服务器参数,...
  • ryan: 请问下nginx配置好了,怎么和这个nut链接呢?最后可视化管理这块能给个详细一点的教程么?谢谢。
  • 1: /etc/config/fstab配置文件 https://openwrt.org/zh/do...
  • 听雨看雪: 找了好久,终于找到UP主,给出的正确解决方案,太感谢了,困扰大半年的问题,重装了N道PVE系统...
  • zr: 大佬,这个bash-completion是从哪个源搞到的
  • 姚生: 要要下载