grep 用不了,总是 no such file or directory

结论:可以检查下 ~/.bashrc 里是不是有什么奇奇怪怪的 alias

我之前是嫌弃 ubuntu 服务器上没有 mac 里这么方便的 git alias(e.g. alias gst=‘git status’), 就从我之前的存档里翻出来了一坨 alias 整体复制到服务器上的 ~/.bashrc 里, 之后grep就挂了

歪…找了半天才发现是 alias 的问题

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
一、 编译安装VLC 使用vlc-1.0.5.tar.bz2 + live555-2010.01.tar.gz export MYDIR=/root/lf 将live555-2010.01.tar.gz和vlc-1.0.5.tar.bz2放置在$MYDIR下 cd $MYDIR (一) 编译liveMedia tar xvfz live555-2010.01.tar.gz cd live ./genMakefiles linux make (二) 安装libdvbpsi rpm -hiv libdvbpsi-0.1.7-1.el4.rf.i386.rpm rpm -hiv libdvbpsi-devel-0.1.7-1.el4.rf.i386.rpm 需要什么rpm可到http://apt.sw.be/redhat/el4/en/i386/rpmforge/RPMS/中下载 (三) 编译VLC 1. configure ./configure --prefix=/usr --enable-debug --disable-avcodec --disable-hal --disable-avformat --disable-swscale --disable-a52 --disable-x11 --disable-sdl --disable-fribidi --disable-dbus --disable-libgcrypt --disable-gnutls --disable-remoteosd --disable-skins2 --disable-qt4 --disable-libxml2 --disable-lua --disable-xcb --disable-alsa --disable-v4l2 --disable-qt --enable-run-as-root --enable-live555 --with-live555-tree=$MYDIR/live --disable-mad --disable-postproc --enable-dvbpsi --enable-x264 2. make 3. 出现错误error: syntax error before "vlc_spinlock_t": ../include/vlc_threads.h:240: error: syntax error before "vlc_spinlock_t" …… make[4]: *** [control/libvlc_la-vlm.lo] Error 1 make[4]: Leaving directory `/root/lf/vlc-1.0.5/src' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/root/lf/vlc-1.0.5/src' make[2]: *** [all] Error 2 make[2]: Leaving directory `/root/lf/vlc-1.0.5/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/root/lf/vlc-1.0.5' make: *** [all] Error 2 通过以下命令解决: sed -e 's/define\s*_POSIX_SPIN_LOCKS\s*/define _POSIX_SPIN_LOCKS -1 \/\/ wrong: /g' -i /usr/include/bits/posix_opt.h 4. 重试make出现error: `AFS_SUPER_MAGIC' undeclared: file.c:52:28: linux/magic.h: No such file or directory file.c: In function `IsRemote': file.c:141: error: `AFS_SUPER_MAGIC' undeclared (first use in this function) file.c:141: error: (Each undeclared identifier is reported only once file.c:141: error: for each function it appears in.) file.c:142: error: `CODA_SUPER_MAGIC' undeclared (first use in this function) file.c:143: error: `NCP_SUPER_MAGIC' undeclared (first use in this function) file.c:144: error: `NFS_SUPER_MAGIC' undeclared (first use in this function) file.c:145: error: `SMB_SUPER_MAGIC' undeclared (first use in this function) make[5]: *** [libaccess_file_plugin_la-file.lo] Error 1 make[5]: Leaving directory `/root/lf/vlc-1.0.5/modules/access' make[4]: *** [all-recursive] Error 1 make[4]: Leaving directory `/root/lf/vlc-1.0.5/modules/access' make[3]: *** [all] Error 2 make[3]: Leaving directory `/root/lf/vlc-1.0.5/modules/access' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/root/lf/vlc-1.0.5/modules' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/root/lf/vlc-1.0.5' make: *** [all] Error 2 将下面的magic.h文件复制到/usr/include/linux/目录下 5. make install 6. 检查 vlc -l | grep access_output access_output_udp UDP stream output access_output_http HTTP stream output access_output_file File stream output access_output_dummy Dummy stream output access_output_rtmp RTMP stream output vlc -l | grep dvbpsi mux_ts TS muxer (libdvbpsi) (四) 进行RTSP To TS转码:  不经视音频重编码的直接转码: vlc rtsp://172.17.0.219:8554/1 --sout '#standard{access=http, mux=ts, dst=172.17.0.100:1234}' 注:黑体部分为本机IP和端口,不能是127.0.0.1 vlc rtsp://172.17.0.219:8554/1 --sout '#duplicate{dst="std{access=udp, mux=ts, dst=172.17.1.116:1234}"}' vlc rtsp://172.17.0.219:8554/1 --sout '#duplicate{dst="std{access=http, mux=ts, dst=172.17.0.100:1234}"}' 二、 视音频重编码的VLC编译安装 (一) 需要编译安装ffmpeg ./configure --prefix=/usr --enable-libfaac --enable-libx264 --enable-pthreads --disable-ffserver --disable-ffplay --enable-gpl --enable-nonfree [root@localhost ffmpeg-0.6.7]# make common.mak:28: *** unterminated call to function `foreach': missing `)'. Stop. 出现上面错误需要更新Make版本,使用make-3.81.tar.gz ./configure --prefix=/usr;make;make install In file included from libavdevice/v4l.c:33: /usr/include/linux/videodev.h:56: error: syntax error before "ulong" /usr/include/linux/videodev.h:72: error: syntax error before '}' token 编辑/usr/include/linux/videodev.h第56行,把ulong改为 unsigned long (二) 编译VLC ./configure --prefix=/usr --enable-debug --enable-avcodec --disable-hal --disable-avformat --disable-swscale --disable-a52 --disable-x11 --disable-sdl --disable-fribidi --disable-dbus --disable-libgcrypt --disable-gnutls --disable-remoteosd --disable-skins2 --disable-qt4 --disable-libxml2 --disable-lua --disable-xcb --disable-alsa --disable-v4l2 --disable-qt --enable-run-as-root --enable-live555 --with-live555-tree=$MYDIR/live --disable-mad --disable-postproc --enable-dvbpsi --enable-x264 没有--enable-avcodec运行VLC转码会出现"cannot find video decoder"的错误。 (三) 进行RTSP To TS转码: vlc tcp://172.17.0.199:7799 --sout '#duplicate{dst="transcode{venc=x264{profile=baseline},vcodec=h264,acodec=mpga,vb=644,ab=56}:std{access=udp,mux=ts,dst=172.17.0.219:1234}"}' 使用VLC转时,不要激活转码 可正常工作的选项: :sout=#http{mux=ts,dst=:8080/1} :sout-keep :sout=#udp{mux=ts,dst=172.17.1.116:1234} :sout-keep http://www.videolan.org/doc/videolan-howto/en/ch09.html ffmpeg -i "rtsp://172.17.0.219:8554/1" -acodec libfaac -vcodec libx264 -vpre default -f mpegts -async 1 udp://127.0.0.1:3344 ./configure --prefix=/usr --enable-libfaac --enable-libx264 --enable-pthreads --disable-ffserver --disable-ffplay --enable-gpl --enable-nonfree 转码 ffmpeg -i "rtsp://172.17.0.219:8080/1" -acodec libfaac -vcodec libx264 -vpre default -f mpegts -async 1 udp://172.17.0.219:3344
Absolute OpenBSD: UNIX for the Practical Paranoid By Michael W. Lucas 2013 | 536 Pages | ISBN: 1593274769 | EPUB + PDF | 4 MB + 11 MB The definitive guide to OpenBSD Foreword by Henning Brauer, OpenBSD PF Developer OpenBSD, the elegant, highly secure Unix-like operating system, is widely used as the basis for critical DNS servers, routers, firewalls, and more. This long-awaited second edition of Absolute OpenBSD maintains author Michael Lucas's trademark straightforward and practical approach that readers have enjoyed for years. You'll learn the intricacies of the platform, the technical details behind certain design decisions, and best practices, with bits of humor sprinkled throughout. This edition has been completely updated for OpenBSD 5.3, including new coverage of OpenBSD's boot system, security features like W^X and ProPolice, and advanced networking techniques. You'll learn how to: Manage network traffic with VLANs, trunks, IPv6, and the PF packet filter Make software management quick and effective using the ports and packages system Give users only the access they need with groups, sudo, and chroots Configure OpenBSD's secure implementations of SNMP, DHCP, NTP, hardware sensors, and more Customize the installation and upgrade processes for your network and hardware, or build a custom OpenBSD release Whether you're a new user looking for a complete introduction to OpenBSD or an experienced sysadmin looking for a refresher, Absolute OpenBSD, 2nd Edition will give you everything you need to master the intricacies of the world's most secure operating system. "The definitive book on OpenBSD gets a long-overdue refresh." -Theo de Raadt, OpenBSD Founder ============================================== Book review: Absolute OpenBSD (Second Edition) Absolute OpenBSD OpenBSD 5.3 came out at the beginning of May, right on schedule. The latest version of the security-oriented operating system brought several improvements to the table, including better driver and processor support, bug fixes and security enhancements. All in all it looked like a positive and conservative step for the OpenBSD project. This is all great news for users of the operating system as the OpenBSD crowd tends to appreciate quiet, evolutionary steps. While great for the users and administrators who run OpenBSD, "driver improvements and security enhancements" doesn't make for exciting reviews as not a whole lot of changes have happened on the surface since we looked at OpenBSD last year. With that in mind, rather than focus on the latest release of OpenBSD, I'd like to share a resource which will help people who have an interest in OpenBSD get better acquainted with the operating system. Specifically, I'd like to share with you a book written by Michael W. Lucas called "Absolute OpenBSD". There are two aspects of Mr Lucas' book which set it apart from most other instructive texts and, for that matter, from the other books I've reviewed here in the past. The first is Lucas has a sense of humour and that makes what would otherwise be a dry look at the nuts and bolts of an open source operating system a surprisingly fun journey. On the topic of system upgrades Lucas writes, "Sever upgrades can make even seasoned sysadmins wish that they had a simpler job, such as performing as a carnival sideshow, stuffing weasels into their trousers." On another page he points out that OpenBSD will allow you to set up any program to act as a window manager, "You can also enter a command that isn't a window manager, such as grep. If you do, OpenBSD will silently log you out. It won't say, `Please step away from the keyboard before I hurt you.' Not threatening you passes for user-friendly in OpenBSD." In both cases his jokes are funny because they come loaded with more than a kernel of truth. The second characteristic of Lucas' book I greatly appreciated was that it doesn't really try to be a how-to text. In the past I've shared books I've enjoyed which talk about how to use the Ubuntu desktop or how to trouble-shoot a server or how to use the command line. Those books tend to take things one step at a time and walk us through processes. "Absolute OpenBSD" doesn't really come across as a how-to-use-this-technology book. While it does include tutorials and plenty of advice on how to administer OpenBSD, I didn't really get the feeling we were being shown how to use the operating system. Rather I believe Lucas was primarily concerned with showing us how OpenBSD works, how the pieces fit together. Last month I reviewed a book called "A Practical Guide to Linux Commands, Editors and Shell Programming" and we might think of that text as an instruction manual which teaches us how to drive a car, how to fill the gas tank and change the tyres. All very useful things to know how to do. "Absolute OpenBSD" does cover filling the gas tank and changing the tyres, but it spends a good deal of time under the hood. The chapters in "Absolute OpenBSD" cover things like how the engine works, what a spark plug is, why a battery goes dead and why we should never lick said battery. (In this example licking a battery is a direct parallel to reconfiguring the OpenBSD kernel.) Lucas is aware OpenBSD is a highly flexible operating system and the tasks we may perform with it are not necessarily the same ones he performs. Therefore he sets about explaining how all the pieces fit together, how the system works, what its key features are and he sprinkles in a good deal of advice about how to avoid common pitfalls. Actually, one of the first things Lucas does is acknowledge his book can't cover everything and we will need to seek outside help eventually. The first chapter is dedicated to introducing OpenBSD resources, documentation, mailing lists and other places where we can seek assistance. After that we get into some more hands-on material such as how to install OpenBSD, how to partition our hard drives and checking to make sure our hardware is supported. There are chapters on securing the operating system, managing the OpenBSD firewall, performing upgrades and adjusting kernel-level settings. These are the more practical aspects of the book. Thrown into the mix are chapters containing more abstract information. For example, one chapter is dedicated to explaining the purpose and contents of every configuration file under the /etc directory. We're told how the system boots itself and which files are checked and in what order. We're told about different styles of attacks (and attackers) and how to protect ourselves. We're told how user accounts and account security features work and how to best handle sudo. There is a chapter on dealing with X and a section dedicated to what OpenSSH does and how we can make the most of secure shell, including a tutorial on locking down users' remote access. We're told about the OpenBSD ports tree, not just how to use it, but how ports work and why the ports tree has certain features. Lucas covers how to perform scheduled tasks and, more importantly, what sort of tasks we might wish to automate. In a lot of ways reading "Absolute OpenBSD" reminds me of conversations I've had while sitting around a table with other IT people, trading little snippets of advice and horror stories. The book focuses less on the steps required to perform tasks and more on why we should (or should not) perform those tasks. It's less about guiding us down a single path and more of a crash course in (digital) jungle survival. "These are the plants you need to be able to recognize -- these ones are poison, those ones you can eat," the book seems to say. "These are the tools you should take with you and here is how to get the most out of your pocket knife." While the material is specifically focused on OpenBSD, a good deal of the concepts and advice are relevant to users of any UNIX or UNIX-like operating system. The instructions on using pkg_add to keep software up to date may be specific to OpenBSD, but scheduling package updates is universal. Using inetd to limit network connections from the outside world may be specific to a subset of UNIX-like systems, but limiting the flow of connections in general is important for any server admin. That's what I like about "Absolute OpenBSD", it covers the why at least as much as the how and that makes it a great instruction manual for any system administrator, not just OpenBSD admins. I certainly recommend the book for administrators, especially people interested in OpenBSD. Even if you don't read the entire text, be sure to check out the author's tips and asides that are featured on almost every page, they are heavy with wisdom from the trenches. Title: Absolute OpenBSD (Second Edition) Author: Michael W. Lucas © 2013 Publisher: No Starch Press ISBN: 1-59327-476-9 Length: 536 pages Available from: No Starch Press and Amazon

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值