Sunday, 21 September 2008

This article explains how to install GNU/Debian Sid in a previously installed Ubuntu Hardy System. We will use debootstrap and chroot tools to accomplish that. This how-to is not focused on security, it does not tell how to create a restricted chroot environment to improve security.

Ubuntu is a GNU/Debian based distro. Every six months they take GNU/Debian Unstable packages and make a new Ubuntu distribution.Debian Sid provides more and newer packages. Ubuntu is configured for easiness. Debian has less preconfiguration instead.

chroot runs a command with a special root directory.chroot comes as part of coreutils package. $ sudo aptitude install coreutils

So we have a film split into two files e.g: foo1.avi and foo2.avi, both with the same encoding characteristics (window size, codecs, bitrate...),

We execute this command that produces an output file called foo.avi which is the result of concatenating foo1.avi and foo2.avi files.$mencoder -oac copy -ovc copy -forceidx foo1.avi foo2.avi -o foo.avi

The command options mean:
* -oac output audio codec
* -ovc output video codec
* -o output file name
* -forceidx forces creation of a new index.copy means copying the original stream and do not change the codec it is encoded into (because of that it is very fast).

Now we are going to edit AdminSettings.php file$gksudo gedit /etc/mediawiki1.10/AdminSettings.php

Change these two variables using the parameters you used when creating the wiki database: e.g: wikiuser and its password.$wgDBadminuser = 'DB user name'$wgDBadminpassword = 'DB password'

Now that AdminSettings.php file is properly configured we are gonna back up and restore the wiki.

BACKING UP THE WIKI

dumpBackup.php command will back up our wiki:$cd /var/lib/mediawiki1.10/maintenance
$sudo php dumpBackup.php --current > ~/foo_backup.xmlNOTE:--full option backups history of pages, not only last version as --current does.

Wednesday, 26 March 2008

NOTE: You must have python already installed in your system. I assume 2.5 version.

$mkdir PyNSource$cd PyNSource

Now we download the program and install it:$wget http://www.atug.com/downloads/pynsource1.4c.zip$unzip pynsource1.4c.zip$sudo python setup.py install

We want to run the GUI so we need a graphical library:$sudo aptitude install python2.5-wxgtk2.6

Current code does not work with version wxgtk2.6 so we need to update it:$wget http://www.atug.com/andypatterns/code/pyNsourceGui1.4c-wx26.zip$unzip pyNsourceGui1.4c-wx26.zip$sudo cp pyNsourceGui-wx26.py /usr/lib/python2.5/site-packages/pynsource/

* There are problems when moving shapes on the screen. It does not refresh correctly.* It is difficult to adjust page size when you try to print it.* When you press right click button on the mouse to delete an object, usually it doesn't delete all the arrows that point to it, messing the schema.* Saving and opening diagram feature is not implemented yet, so you cannot save temporary work.

Well, you know, this bugs are annoying, but it you dont like them, it is free software, so hack the code. :-)

Usually "meta" refers to ALT key, but if you have no meta key you can use ESC key instead.

Emacs mode commmands:

Movement

C-b Move back the cursor one character. C-f Move one character forward. DEL or Backspace Delete the character placed left at the cursor.C-d Delete the character underneath the cursor. C-_ or C-x C-u Undo the last editing command.

C-a Move to the beginning of the line. C-e Move to the end of the line. M-f Move forward a word.M-b Move backward a word. C-l Clear the screen, reprinting the current line at the top.

Killing and yanking (cutting and pasting) commands

C-k Kill the text from the current cursor position to the end of the line.M-d Kill from the cursor to the end of the current word.M-DEL Kill from the cursor the start of the current word.C-w Kill from the cursor to the previous whitespace.

After killing(cutting) text, we yank(paste) it back into the line.

C-y Yank the most recently killed text back into the buffer at the cursor.M-y Rotate the kill-ring, and yank the new top. You can only do this if the prior command is C-y or M-y.

Searching commands

C-r Searchs backwards on the previous commands you typed.C-s Perform a forward search from the command line history you are now.

Passing arguments to a command

e.g: M-2 3 C-d means delete next 23 characters on input line.

CONFIGURING THE LIBRARY

GNU Readline keybindings and more can be changed editing ~/.initrc or /etc/initrc files.

Tuesday, 19 February 2008

Sometimes you have to type a command you typed before, but you don't want to write it again, or don't remember exactly what you wrote on your command prompt. Solution is easy, we are gonna use reverse search!

Press the keys: ctrl+r and then type part of the command you want to retype.NOTE:It is not necessary to write the beginning of the command, you can write whatever part you want for reverse search.

If reverse search has found a command but it is not the one you were searching for, type ctrl+r again till you find it, or write a better part of the command at search time.

Now we have found the command, we have two options:- pressing enter, the command will be executed - pressing tab key we will be able to edit this command at the bash prompt prior to its execution.

CHANGING INTO ANOTHER DIRECTORY but memorizing where we are now in order to return later easily

This is useful if you have long weird named paths.

We are now located at foo directory: :/foo$pwd/foo

We want to change into bar directory, instead of using cd command we use pushd:/foo$pushd /bar

Now we are in /bar directory::/bar$pwd/bar

In order to return to prior foo directory we only have to run popd command.:/bar$popd

:foo$pwd /foo

CHECKING FOR BAD BLOCKS IN A PARTITION

Sometimes we want to check the blocks of a hard disk we have just bought, or whatever...

We have two options:

First time, when creating the filesystem with '-c' option

e.g: mkefs.ext3 -c -b 4096 -L foo /dev/sdb2

If the filesystem at this partition has been already created we can use badblocks command.