November 2008
The Archives
-
11.30.08Enabling promiscuous mode on an interface# ifconfig eth0 promisc Enables promiscuous mode the eth0 interface so that all frames arriving at the interface will be passed on to the Operating System.
-
11.28.08Parallel diff$ diff -W80 -y one two this is it | this si it and this is that and this is that [The relevant option is '-y']. Shows all the lines of both files in parallel (line by line) and places a vertical line '|' between them when the corresponding lines differ. The ...
-
11.26.08Signals supported by processesYou know kill utility sends a signal to the processes specified by their pid. If you want to know all the signals implemented by your Operating System and supported by any process, type: $ kill -l 1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP 6) SIGABRT 7) SIGEMT 8) SIGFPE 9) SIGKILL 10) SIGBUS 11) SIGSEGV ...
-
11.24.08Going to the previous directory$ cd - Go to the previously visited directory.
-
11.22.08man intro$ man intro Introductory stuff on Unix (or BSD/Linux...) commands.
-
11.20.08pf, OpenBSD’s [p]acket [f]ilter (2)We introduced OpenBSD's pf in a previous post. In the present one, we are going to start commenting a full-featured firewall configuration which uses quite a few of pf's functionalities: macros, lists, anchors... As we said then, OpenBSD's FAQ contains the complete and detailed documentation. Here is the complete set [but for those related to authpf] of firewall rules, usually stored at /etc/pf.conf (bear with me for the long quote, but I'd rather comment a complete file than do it in parts). # 0) Start: macros and tables ext_if="rl0" int_if="vr0" ext_services = "{smtp www 222}" in_services = "{ssh smtp domain www}" always_open ...
-
11.18.08iftop$ iftop On BSD systems, displays NIC statistics. Install from /usr/ports/net-mgmt/iftop
-
11.17.08Output last lines of a file$ tail -20 test.txt Outputs the last 20 lines of file test.txt
-
11.15.08Strings in bashStart with a string: $ a="hi, this is my beautifull string" Positional substrings: Substring from the 4th character on: $ echo ${a:3} this is my beautifull string Substring of length 4 from the 10th character: $ echo ${a:9:4} is m Substring modification: Substitute the first instance of a substring: $ echo ${a/full/ful} hi, this is my beautiful string Same example: $ echo ${a/h/H} Hi, this is my beautifull string Substitute all the instances of a substring: $ echo ${a//hi/HI} HI, tHIs is my beautifull string Substring removal: Remove the shortest match of a substring from the start: $ echo ${a#h*i} , this is my beautifull string Same, starting at the end $ echo ${a%i*g} hi, this is my beautifull str Remove the longest match of a ...
-
11.12.08Viewing info about free and used system memory$ free -m total used free shared buffers cached Mem: 1003 253 750 0 41 178 -/+ buffers/cache: ...