摘要: 默认情况下你自已添加的或自动添加到启动菜单的软件会在所有桌面环境下启动。你有没有想过让某个应用在特定桌面环境下自动启动呢?如Mailnag是一个GNOME Shell mail notifier,如果你在Unity使用,提醒会一个很丑的对话框。本文将介绍如何让应用只在特定桌面环境下自动启动,如Gnome,Unity,KDE。通过本文的方法您可又让Mailnag只当你登入Gnome时才自动启动。您需要编译自动启动.desktop文件,一般在~/.config/autostart或/etc/xdg/autostart。添加OnlyShowIn=GNOME;或OnlyShowIn=Unity;如果想 阅读全文
posted @ 2013-05-30 10:29 Bigben 阅读(826) 评论(0) 推荐(0)
摘要: expect 阅读全文
posted @ 2013-05-30 10:21 Bigben 阅读(1123) 评论(0) 推荐(1)
摘要: sudo ./nfc-emulate-forum-tag4 NFC device: pn532_uart:/dev/ttyUSB1 openedEmulating NDEF tag now, please touch it with a second NFC device In: 00 a4 04 00 07 d2 76 00 00 85 01 01 00 Out: 90 00 In: 00 a4 00 0c 02 e1 03 Out: 90 00 In: 00 b0 00 00 0f O... 阅读全文
posted @ 2013-05-27 11:58 Bigben 阅读(488) 评论(0) 推荐(0)
摘要: 1,preinstall $ sudo apt-get install libusb-dev libpcsclite-dev $ sudo apt-get install libusb-0.1-4 libpcsclite1 libccid pcscdlibftdi1https://libnfc.googlecode.com/files/libnfc-1.7.0.tar.bz2bunzip2 libnfc-1.7.0.tar.bz2tar -xvf libnfc-1.7.0.tarcd libnfc-1.7.0./configure --with-drivers=allmake clean .. 阅读全文
posted @ 2013-05-27 10:48 Bigben 阅读(2380) 评论(0) 推荐(0)
摘要: 转自: http://www.backtrack-linux.org/wiki/index.php/RFID_Cooking_with_Mifare_ClassicContents[hide]1RFID Cooking with Mifare Classic20x00 - Preface2.1Dependencies30x01 - Hardware3.1Touchatag - ACR122U40x02 - Software4.1ACR122U driver4.2Open Source Near Field Communication (NFC) Library /LIBNFC/4.3MFOC 阅读全文
posted @ 2013-05-27 10:28 Bigben 阅读(1217) 评论(0) 推荐(0)
摘要: How to communicate with an NFC reader-------------------------------------NOTE: this is low level documentation if you want to understand howto communicate with the PN532 in the ACS ACR122, it is not necessary tounderstand this to use the libraryTo use a device with a PN532 in NFCIP mode (P2P) is ra 阅读全文
posted @ 2013-05-27 10:24 Bigben 阅读(1178) 评论(0) 推荐(0)
摘要: http://wenku.it168.com/d_000659158.shtml 阅读全文
posted @ 2013-05-21 11:06 Bigben 阅读(156) 评论(0) 推荐(0)
摘要: http://blog.sina.com.cn/s/blog_57421ff80100c7nn.html1 linux创建自启动程序自启动的两种方法,都经过自己测试。1.1 自启动程序方法1:在etc/rc.local在里面加入/home/robin/code/autoruntest > /dev/null &(其中autoruntest 测试程序名称,下同)。即可自启动1.2 自启动程序方法2:创建linux服务,步骤如下:1)写服务启动脚本文件(后附例子)2)修改脚本文件chmod 777 autoruntest3)脚本文件拷贝到 /etc/rc.d/init.d/4)chk 阅读全文
posted @ 2013-05-21 11:05 Bigben 阅读(784) 评论(0) 推荐(0)
摘要: 转自:http://www.cppblog.com/sunicdavy/archive/2012/02/28/166680.html1.1 为进程添加守护进程参考链接http://yubosun.akcms.com/tech/linux-daemon-program.htm 1: #include <unistd.h> 2: #include <signal.h> 3: #include <sys/types.h> 4: #include <sys/stat.h> 5: #include <stdio.h> 6: #include & 阅读全文
posted @ 2013-05-21 11:01 Bigben 阅读(925) 评论(0) 推荐(0)
摘要: eclipse 导出 preference 设置 保存 阅读全文
posted @ 2013-05-16 17:06 Bigben 阅读(706) 评论(0) 推荐(0)
摘要: 在mac上装的虚拟机,ctrl+鼠标左键会被映射成鼠标右键。可以点击主菜单的”虚拟机“->”设置“,找到”键盘与鼠标“,在左下角的”+“”-“旁边的设置按钮,点”编辑配置文件...“。找到”鼠标快捷键“,去掉”辅键“的选中状态。 阅读全文
posted @ 2013-05-16 16:04 Bigben 阅读(765) 评论(0) 推荐(1)
摘要: 在window, pereference, c/c++, editor里面,内嵌列表中“ inactive code highlights”。 阅读全文
posted @ 2013-05-15 15:22 Bigben 阅读(876) 评论(0) 推荐(0)
摘要: 下载:http://www.eclipse.org/downloads/?osType=linux直接解压后,移到 /usr/local/,直接运行即可。————————————————————————————————————————————————————————————————————————当下载完eclipse-rcp-juno-SR1-linux-gtk-x86_64.tar.gz这个后,直接右击它点选extract here即可解压。当解压完后如果要把eclipse目录复制到/usr/local/eclipse(路径最好不要有中文)下,只要执行:sudocp -rDownloads 阅读全文
posted @ 2013-05-15 13:59 Bigben 阅读(437) 评论(0) 推荐(0)
摘要: eclipse 换行 排版 自动排版 阅读全文
posted @ 2013-05-08 16:17 Bigben 阅读(443) 评论(0) 推荐(0)
摘要: 让他以其他用户运行,比如用户名为”user"#!/bin/kshsu - user -s /bin/ksh "/home/ssh_monitor.sh $*"ssh_monitor.sh:#!/bin/ksh###### config ########LOGFILE="./ssh_admin.log"KNOWN_HOSTS="/home/user/.ssh/known_hosts"ssh_pid='0'BREAK_OUT='N'STATE_KEY_STRING='ESTABLISHED 阅读全文
posted @ 2013-05-07 15:46 Bigben 阅读(400) 评论(0) 推荐(0)
摘要: 1,用su,当我们需要以其他身份执行 command,或者shell脚本。一般命令如下:a.切换用户只执行一条命令的可以用: su-oracle-c your_commandb.切换用户执行一个shell文件可以用:su-oracle-s/bin/bashyour_shell.sh2,在某些软件安装过程中,要创建独立用户,然后以该用户运行某些安装操作,如gitolite安装过程,创建git用户并执行安装方法1:sudo -u user ...sudo -u git -H <<-Codels ~cat test#other cmdsCode后面的相继命令在Code之前的会是以切换后的 阅读全文
posted @ 2013-05-07 15:22 Bigben 阅读(29180) 评论(0) 推荐(1)
摘要: 1 我想知道我机器安装了哪些shell?两种方法可以查看:第一种:[rocrocket@wupengchong ~]$ chsh -l/bin/sh/bin/bash/sbin/nologin/bin/zsh第二种:[rocrocket@wupengchong ~]$ cat /etc/shells/bin/sh/bin/bash/sbin/nologin/bin/zsh其实chsh -l也是来查看这个文件。2 我想知道我当前正在使用的shell是哪个阿?[rocrocket@wupengchong ~]$ echo $SHELL/bin/bash注意SHELL一定要是大写。可以看到,我目前使 阅读全文
posted @ 2013-05-03 14:31 Bigben 阅读(729) 评论(0) 推荐(0)
摘要: Server authenticationOne of the first things that happens when the SSH connection is being established is that the server sends its public key to the client, and proves (thanks topublic-key cryptography) to the client that it knows the associated private key. This authenticates the server: if this p 阅读全文
posted @ 2013-05-02 15:13 Bigben 阅读(349) 评论(0) 推荐(0)
摘要: mencoder -ss 6:06 -endpos 9:25 -oac pcm -ovc copy 1352796759.mp4 -o wineGarden.avioac:音频ovc copy 视频不想看mencoder/ffmpeg详细技术手册的,可以把它当快速简易参考看,主要的功能有:视频格式转换音频格式转换切割视频及音频连接两段视频视频音频同步将图像系列转换成视频 这里是百鬼丸以前收集的一部分命令行视频音频编辑脚本命令,一直在自己的记事本里随时用,现在觉得新浪编辑器够方便,速度也够快,觉得把它们放在博客上更合适些。这些命令都是基于一些开源免费软件,如mencoder, ffmpeg, l 阅读全文
posted @ 2013-04-26 14:08 Bigben 阅读(733) 评论(0) 推荐(0)
摘要: date +%s 可以得到UNIX的时间戳;用shell将时间字符串与时间戳互转: date -d "2010-10-18 00:00:00" +%s 输出形如:1287331200而时间戳转换为字符串可以这样做: date -d @1287331200 "+%Y-%m-%d" 输出形如:2010-10-18如果需要得到指定日期的前后几天,可以: 1、seconds=`date -d "2010-10-18 00:00:00" +%s` #得到时间戳 2、seconds_new=`expr $seconds + 86400` #加上一 阅读全文
posted @ 2013-04-22 10:36 Bigben 阅读(656) 评论(0) 推荐(0)
摘要: 在ubuntu虚拟机上更改网络由NAT到桥接模式后,mysql突然无法启动。无法更新成功。无法重新安装。折腾一天后,删除mysql目录:/var/lib/mysql后可以修复。但是数据库全部丢失。幸好是测试数据库。sudo apt-get cleansudo apt-get autocleansudo apt-get remove --purge mysql-client-5.5 mysql-client-core-5.5 mysql-common mysql-server mysql-server-5.5 mysql-server-core-5.5sudo apt-get install m 阅读全文
posted @ 2013-04-19 14:05 Bigben 阅读(268) 评论(0) 推荐(0)
摘要: 登陆:ssh [hostname] -u user输入密码:*****登 陆以后就可以像控制自己的机器一样控制它了,不过没有可视化的界面。不过现在我所使用过的两个版本Linux(SUSE和FC5)中有可以使用类似FTP 界面的工具。使用工具连接时,选择SSH,端口是填服务器的SSH端口,默认是22,但是还是要手工填写。连接上以后FTP界面和shell同时使用可以 提高工作效率。简单的传输命令:scpscp /etc/php.ini [email protected]:/home/user会将本地的 /etc/php.ini 这个文件 copy 到 www.linuxidc.com,使用 阅读全文
posted @ 2013-04-19 10:03 Bigben 阅读(335) 评论(0) 推荐(0)
摘要: Fork 进程:1,pstree -p |grep panda2,ps -Tef|grep panda (pid,thread id,ppid)3,ps -H -ef|grep pandalinux上进程有5种状态:1. 运行(正在运行或在运行队列中等待)2. 中断(休眠中, 受阻, 在等待某个条件的形成或接受到信号)3. 不可中断(收到信号不唤醒和不可运行, 进程必须等待直到有中断发生)4. 僵死(进程已终止, 但进程描述符存在, 直到父进程调用wait4()系统调用后释放)5. 停止(进程收到SIGSTOP, SIGSTP, SIGTIN, SIGTOU信号后停止运行运行)1)ps ... 阅读全文
posted @ 2013-04-19 10:01 Bigben 阅读(234) 评论(0) 推荐(0)
摘要: 1,server:(client addr:[email protected]) ssh -R 22005:127.0.0.1:22 -N [email protected],client:ssh -p 22005 [email protected]改变配置后重启:sudo service ssh restart 阅读全文
posted @ 2013-04-16 16:20 Bigben 阅读(265) 评论(0) 推荐(0)
摘要: 前言一般公司的服务器放在外网时,都会设置一个跳板机,访问公司其他服务器都需要从跳板机做一个ssh跳转(防火墙规则会做相应配置),而前文讲过,外网的服务器基本都要通过证书登录的。于是我们面临一个情况,本机ssh->跳板机->目标机器。如果是密码验证,这个问题都不到,但是对于证书登录,就带来一个ssh密钥转发的问题。linux ssh客户端密钥转发如果是linux客户端,从linux客户端的ssh跳转过去时,一般我们会执行命令ssh blue@跳板机ip然后我们在跳本机上跳转到目标机器ssh blue@目标机器ip跳板机ip和目标机器ip,blue账户下已经在相应的.ssh/autho 阅读全文
posted @ 2013-04-16 15:32 Bigben 阅读(362) 评论(0) 推荐(0)
摘要: 基本上,ssh客户端的详细设定都放在/etc/ssh/ssh_config里面!“/etc/ssh/ssh_config” 文件是OpenSSH系统范围的配置文件,允许你通过设置不同的选项来改变客户端程序的运行方式。这个文件的每一行包含“关键词-值”的匹配,其中“关键词”是忽略大小写的。下面列出来的是最重要的关键词,用man命令查看帮助页(ssh (1))可以得到详细的列表。# Site-wide defaults for various optionsHost *ForwardAgent noForwardX11 noRhostsAuthentication noRhostsRSAAuthe 阅读全文
posted @ 2013-04-16 15:29 Bigben 阅读(259) 评论(0) 推荐(0)
摘要: 前言本文基于实际Linux管理工作,实例讲解工作中使用ssh证书登录的实际流程,讲解ssh证书登录的配置原理,基于配置原理,解决实际工作中,windows下使用SecureCRT证书登录的各种问题,以及实现hadoop集群部署要求的无密码跳转问题。ssh有密码登录和证书登录,初学者都喜欢用密码登录,甚至是root账户登录,密码是123456。但是在实际工作中,尤其是互联网公司,基本都是证书登录的。内网的机器有可能是通过密码登录的,但在外网的机器,如果是密码登录,很容易受到攻击,真正的生产环境中,ssh登录都是证书登录。原则:你想不用密码登录某台主机,将你自己的公钥给他,让他添加到~/.ssh/ 阅读全文
posted @ 2013-04-16 15:27 Bigben 阅读(631) 评论(0) 推荐(0)
摘要: Enable your user to run gdb as root without beeing asked for any password:sudo visudoAdd the following line after all other rules:<youruser> ALL=(root) NOPASSWD:/usr/bin/gdbCreate or modify a debug configuration ineclipseto run gdb as roote.g. in Run > Debug Configurations > C/C++ Applic 阅读全文
posted @ 2013-03-26 10:03 Bigben 阅读(546) 评论(0) 推荐(0)
摘要: # Ubuntu 用户安装文件较器meld使用,以及添加进右键菜单一:文件比较器Meld的安装sudo apt-get install meld# 整合到 Gedit :sudo apt-get install zenity然后打开 Gedit ,打开菜单 Edit - Preferences - Plugins ,开启 External Tools 插件,点击下面的 Configure Plugin ,按左下角的 + 号添加一个新的工具,输入以下代码,并设置一个快捷键。保存好后你就可以通过该快捷键来直接打开 Meld 并载入原始文档与当前编辑的文档进行比较了。(有时候是灰色的就没有办法做到下 阅读全文
posted @ 2013-03-08 18:08 Bigben 阅读(632) 评论(0) 推荐(0)
摘要: #include <sys/types.h>#include <dirent.h>#include<unistd.h>#include <stdio.h>#include <string.h>#include <stdlib.h>#include "proc.h"/* * 读proc目录文件,查看所指定进程产生的文件是否存在 */pid_t proc_find(const char* name) { DIR* dir; struct dirent* ent; char buf[512]; long pi 阅读全文
posted @ 2013-03-08 10:36 Bigben 阅读(458) 评论(0) 推荐(0)
摘要: 原文地址:http://blog.chinaunix.net/uid-24622573-id-276141.html对于很多服务来说,在同一个服务器上只能运行一个实例,那么通过什么方法来保证程序同一时刻只有一个实例运行呢?通过编写shell脚本来管理程序的启动、停止是个不错的方法。在启动时,shell脚本会创建进程标识文件(存储正在运行实例的pid)以表明已经有实例在运行,如果文件已存在,则说明已有实例在运行,不需要做任何事;在退出时,shell脚本会删除进程标识文件,表明没有实例运行。shell脚本管理方法在应用程序之上再包了一层,那么能不能直接在程序开始运行时自己判断是否有实例在运行呢,答 阅读全文
posted @ 2013-03-08 10:35 Bigben 阅读(1016) 评论(0) 推荐(0)
摘要: download and install:http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuAclient setup:http://ist.berkeley.edu/as-ag/tools/howto/subclipse-setup.html————————————————————————————————————————————————————————————————————Subclipse Eclipse plugin (v1.8.x) requires SVN/JavaHL 1.7.x 的问题:The mos 阅读全文
posted @ 2013-03-04 17:21 Bigben 阅读(216) 评论(0) 推荐(0)
摘要: 简介:相关的函数如下:1 int pthread_cond_init(pthread_cond_t *cond,pthread_condattr_t *cond_attr); 2 int pthread_cond_wait(pthread_cond_t *cond,pthread_mutex_t *mutex);3 int pthread_cond_timewait(pthread_cond_t *cond,pthread_mutex *mutex,const timespec *abstime);4 int pthread_cond_destroy(pthread_cond_t *c... 阅读全文
posted @ 2013-03-04 17:10 Bigben 阅读(1079) 评论(0) 推荐(0)
摘要: 需要mfoc,libnfc:1, dump 卡片数据:sudo mfoc -P 500 -O mycracked.mfd2,载的empty.mfd3,用二进制文件编辑器(GHex),将mycarcked.mfd的前16个字节,即1block数据,uid …etc。写入到empty.mfd中保存。4,执行:(libnfc的utils中)nfc-mfclassic w b empty.dump mycracked.mfd这时已经将卡片初始化成隐含key。http://www.libnfc.org/community/topic/460/recycling-old-mifarecards-forma 阅读全文
posted @ 2013-03-01 18:13 Bigben 阅读(1966) 评论(0) 推荐(0)
摘要: 需要libnfc库,用nfc-emulate-forum-tag4.c测试。电脑接usb nfc设备。调用main后向usb发送vcard。android手机可以接收到vcard。typedef struct{ char fn[30]; char tel_work[20];} VCard_t;char header[]={ 0xc2, 0x0c, 0x00, 0x00, 0x01, 0x05, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x78, 0x2d, 0x76, 0x43, 0x61, 0x72, 0x64};char begin[]= {"BEGIN:VC 阅读全文
posted @ 2013-03-01 15:38 Bigben 阅读(1669) 评论(0) 推荐(0)
摘要: VCard 数据格式的标识符是VCARD l 预定义的值类型:uri, date, date-time, float l 新增加的值类型:binary, phone-number, utc-offset and vcard value l 预定义的类型:SOURCE, NAME, PROFILE, BEGIN, END. l 新增加的类型:FN, N, NICKNAME, PHOTO, BDAY, ADR, LABEL, TEL, EMAIL, MAILER, TZ, GEO, TITLE, ROLE, LOGO, AGENT, ... 阅读全文
posted @ 2013-03-01 14:16 Bigben 阅读(1669) 评论(0) 推荐(0)
摘要: Vcard 内容:BEGIN:VCARD VERSION:3.0 N:Employee;Joe;Google;; FN:Joe Google Employee TEL;TYPE=WORK;TYPE=PREF:650-253-0000 EMAIL;TYPE=X-INTERNET:[email protected] ADR;TYPE=WORK:;;1600 Amphitheatre Parkway;94043 Mountain View;;; ORG:Google TITLE:Software Engineer URL:http://www.google.com END:VCARD加载成二进制码 阅读全文
posted @ 2013-02-28 17:24 Bigben 阅读(723) 评论(0) 推荐(0)
摘要: adb remountadb pull SharpSecurityAssistant.apkadb pull /system/app/SharpSecurityKeeper.apkadb uninstall cn.sharp.assistantadb uninstall cn.sharp.keeperadb shell/system/app/data/app/data/data 阅读全文
posted @ 2012-10-24 16:08 Bigben 阅读(252) 评论(0) 推荐(0)
摘要: 关于SD卡中各个文件夹的功能,我们可能没有一个概念。包括本人也是需要什么看教程后找一个。这样找起来非常麻烦,今天我就给大家总结一下,希望对大家有所帮助。 下面就是我们文件夹里通常能见到的文件。也不是非常全面,而且SD卡用久了,也会出现许多没用的,大家完全可以对照本文把没用的删除掉。如果有什么没有照顾到的还希望大家一起研究研究。 1、.android_secure 是官方app2sd的产物,删了之后装到sd卡中的软件就无法使用了。 2、.Bluetooth 顾名思义,用蓝牙之后就会有这个。 3、.mobo 顾名思义,Moboplayer的缓存文件。 4、.QQ 顾名思义,QQ的缓存文件... 阅读全文
posted @ 2012-08-07 10:30 Bigben 阅读(913) 评论(0) 推荐(0)
摘要: android NDK自带例子:twolibs,如果只编译 static lib,出现不编译情况。如下注释掉 shared lib。------------------------------------------------------------------------------LOCAL_PATH:= $(call my-dir)# first lib, which will be built statically#include $(CLEAR_VARS)LOCAL_MODULE := libtwolib-firstLOCAL_SRC_FILES := first.cinclud. 阅读全文
posted @ 2012-08-07 10:28 Bigben 阅读(444) 评论(0) 推荐(0)