Author
The Archives
-
10.03.09Vim. Copy & PasteCopy & Paste are two of the most important operations when writing a text. It is easy to know why: you save a lot of time. Vim handles copy & paste powerfully and gracefully. In Vim you can yank (copy), cut and paste text objects. There are two basic ways for selecting text: either using the normal vim commands or going into visual mode. Let us see all of this with some examples: This is a sample text (Bold letters indicate the cursor position as in the previous issues.) Now type: yw followed by ESC o As you can expect, you have just yanked a word ...
-
09.28.09Vim. Moving aroundVim is not a mouse driven program. With other editors, you use the mouse to place the cursor at the desired position. This seems to be fine. However, you do not realize how faster you can move using a command approach as in Vim. In Vim, you move around the text using different commands, that is, keystrokes while you are in command mode. At the beginning this may result confusing or even seem a waste of time. However, once you get used to it, you will never leave it and you find it to be faster than any other method. Basic ...
-
09.09.09IM from the command line% cd /usr/ports/net-im/finch; make install clean The above installs finch. It is an ncurses based instant messaging client, part of the pidgin suite. Though it can be a little tough at the beginning, it is a good alternative if you do not have a graphical interface. Below I show two screenshots. Use Alt-w to move between windows. Enjoy!
-
09.01.09Being repetitiveyes confirms forever by showing y continuously. If followed by a parameter, it repeats the parameter. $ yes y y y y y ^C $ It is useful when you are sure what you are doing. For instance, if you want to delete a set of write protected files: $ yes | rm file_proctected*.txt Enjoy!
-
07.04.09Vim. Inserting textProbably, the most important action to do with a text editor is inserting text. Vim makes this task very easy and powerful at the same time. Before we start, let us specify some symbolic conventions: I will use ESC and ENTER to refer to the escape and ENTER keys respectively All the keys you are expected to press without producing any output on the screen will be in boldface. Example: ESC i means you have to press escape and then i, i being a command that does not produce any output Let us start with vim: $ vim test.txt The simplest way of inserting test ...
-
06.29.09Measuring network performanceFreeBSD includes several benchmarking suites in the ports collection. One of these suites is netperf, developed by HP. It allows measuring several network parameters using two programs: the server and the client. First things first: let us install netperf. % cd /usr/ports/benchmarks/netperf && make install clean Once the software has been successfully compiled (it does not take long) we can bring the server up: $ netserver Starting netserver at port 12865 Starting netserver at hostname 0.0.0.0 port 12865 and family AF_UNSPEC Notice that you can launch the server as a regular user. Now, we are ready to run our test: $ netperf -t TCP_STREAM TCP STREAM TEST from ...
-
06.22.09Cleaning port’s garbageportsclean cleans garbage from the directory tree of the ports collection. It is a utility of the base system that should be run from time to time to keep one's ports infrastructure as sane as possible. portsclean wipes old package files, unneeded libraries and such. There are several interesting option flags described in the man page. This is how I run portsclean from time to time: % portsclean -DD The command above cleans all the distfiles that are not referenced by any installed package in the system. I usually run this after rebuilding the complete userland from a new ports fetch. Enjoy!
-
06.08.09Vim, first sessionHere you are: your first vim lesson! First off, start vim with a named empty file: $ vim myfile Once you have done this, you get a screen similar to this one (I've removed some of the blank lines for the sake of clarity): ~ ...
-
06.01.09Adding a new member to the group (FreeBSD)The pw command is used to add and modify system users and groups. The following is an easy way to add a new member to a group: % pw groupmod operator -M n0str0m0 It adds n0str0m0 to the operators group. Bye!
-
05.26.09Auditing ports (FreeBSD)One of the most important aspects of *BSD systems is security. Knowing which installed packages have exploitable vulnerabilities is one of the admin's tasks. Here, the portaudit utility comes in handy. It is not part of the base system, so it must be installed first: % cd /usr/ports/ports-mgmt/portaudit; make install clean To run a simple check: % portaudit Affected package: XXX Type of problem: XXX -- embedded GD library Use-After-Free vulnerability. Reference: <http://www.FreeBSD.org/ports/portaudit/6XXxf31-4254-11de-bXX-0030843d3802.html> Affected package: YYY-0.2.8.4_2 Type of problem: YYY -- integer overflow vulnerability. Reference: <http://www.FreeBSD.org/ports/portaudit/48aab1d0-YYY-YYYYYYY-0030843d3802.html> Affected package: ZZZ-1.10.2_2 Type of problem: ZZZ -- integer overflow. Reference: <http://www.FreeBSD.org/ports/portaudit/4b17ZZZZZZbecb-001cc0377035.html> I have omitted the details of the vulnerable packages of my own machine. I'm sure you ...