Last change: Dec 16, 2005 AD
command
- directly may be typed
filename
- replace by your own value
[] - text in the brackets is optional
See also "Interesting Applications under Windows & Linux".
$ httrack
www.example.com -v -P my.proxy.server.com:3128
ESC | Puts you in command mode |
h, j, k, l | Left, down, up, right (or use the arrow keys) |
w, W, b, B | Forward, backward by word |
0, $ | First, last position of current line |
/pattern | Search forward for pattern |
?pattern | Search backward for pattern |
n,N | Repeat last search in same, opposite direction |
x | Delete character |
dd | Delete current line |
D | Delete to end of line |
dw | Delete word |
p, P | Put deleted text before, after cursor |
u | Undo last command |
. | Repeat the last command |
i, a | Insert text before, after cursor [Puts you into INPUT MODE] |
o, O | Open new line for text below, above cursor [Puts you into INPUT MODE] |
ZZ | Save file and quit |
:w | Save file |
:q! | Quit, without saving changes |
$> nedit
GNU Project - development of free software for unix-like systems (see www.gnu.org)
Some GNU supported programs: gimp (like photoshop), gpaint (like Paint), gzip
& tar - compression , Midnight Commander - file manager and much more
(libraries, languages ...)
Front-ends: UnignuPlot, xgfe.
To plot the graph, type command plot in gnuplot, followed by the name of
the input files in single quotes, separated by commas.
Ex1:
gnuplot> plot 'input-file1', input-file2'
Input: a text file containing input values (one value per line). This will be
on the y axis, on the x axis will be number of the line in which the value
appears (0 for the 1st line etc.)
Ex2: file 'input'
10
20
15
30
In the graph, there will be points (x , y): (0,10), (1,20), (2, 15), (3, 30)
To have all files in one graph, just type 'w l' behind the file name:
Ex3:
gnuplot> plot 'file1' w l, 'file2 w lIf you want to print the graph, you can store it as a postcript file, if you write following commands before ploting the graph:
Where myfile is any name you wish. When you finish, just type commandgnuplot> set data style lines gnuplot> set terminal postscript gnuplot> set outpout 'myfile.eps'
If I want only to compile the library, I must use flag '-c' (which tells
gcc that it should stop after creating object file without linking it;
otherwise you get a strange error, st. like "fatal ... symbol missing ...
main ").
2. $> gcc -Wall -c library.c
Output: object file 'library.o'
If you want to make the executable file, type
3. $> gcc -Wall -o myprogram main.c
library.o
(Note the suffix '.o')
Final notes: the flags '-Wall' and '-o' followed by 'myprogram' may be omitted. The former tells gcc to print all warnings (-Wall), the latter specifies the name of the output executable file (otherwise it would be a.out)
Explicit language:
If you don't want gcc (g++) to compile a source code according to its suffix
(.c for c, cc or cpp for c++ ....) you can use flag -x followed by the
language option (c++, c ...). To compile myfile.c as c++:
$> g++ -Wall library.c -x c++ myfile.c
Note: library.c is compiled as c file, because it's before the -x flag.
Notes:
- if you want to use C and C++ files together, compile them both using g++,
otherwise you'll have problems
- Third party libraries: if using such libs, it's not enough to have
"include" in the source; you have to tell to the compiler to use the library
(-l flag). For example for compiling a program that uses X Window System
library Xlib (assuming it's in the path; X11 indicates Xlib. Confusing, I
know ;-):
$> gcc -o xmyprogram xmyprogram.c
-lX11
RELATED TOOLS
gprof - GNU tool for profiling
Links:
man ld reads:
The linker will search an archive only once, at the
location where it is specified on the command line. If the archive defines a
symbol which was undefined in some object which appeared before the archive
on the command line,the linker will include the appropriate file(s) from the
archive. However, an undefined symbol in an object appearing later on the
command line will not cause the linker to search the archive again.
See the -( option for a way to force the linker to search archives multiple
times. You may list the same archive multiple times on the command
line.
myprogram: main.c library.o
gcc -Wall main.c
library.o
library.o: library.c
gcc -Wall -c library.c
When you run 'make' from the directory that contains Makefile, library.c
and main.c (and also library.h), it does exactly the same as the sequence of
commands 2. and 3. from the prevoius section (gcc or g++). One of the
advantages is, that it first checks whether the file was changed since make
was called the las time, and only if it was changed, the actions is executed
(in other words, it doesn't recompile files which haven't changed, but only
the changed ones => saves time).
Important note: before a command (e.g. "
gcc -Wall main.c library.o" in this case), there
must be TAB and nothing more/less (press the key 'tab' before
writting the command.). Before anything else there can be nothing(?)
Notes:
- make has very strange requirements on the input files (if you use TABulator
at the wrong place ....) and hence gives sometimes indeed strange errors. In
such case, try to use gmake.
See also
-Imakefile and xmkmf (generates Makefile from Imakefile). Some info should be
at GNU homepage.
Targets
Make starts processing a file at the target specified as a command line
option ($>make mytarget) or at the
first target (reading the file from the top).
Target may include wildcards, for example "%.class: mydirectory/%.java"
states that any .class file is dependent on a .java file of the same name (if
there is "%" more times in the same dependency, it always means the same
string), which is located in the directory mydirectory/ (with respect to the
directory including the Makefile).
List of dependencies
consists of filenames and names of other targets separted by a space. May
contain wildcards as well as variables. May be empty.
Ex: all: maintarget main.c main.h
${OBJECTS}
Commands
A command must be preceded by TAB (if it is the 1st one, see above).
Command is any shell command and may include any Makefile stuff like
variables, wildcards etc. (Command may be ommited.)
Some wildcards
% - matches any string, if it is more times in the same dependency, it always
have the same value
$< - refers to the dependency list that was matched by the rule
Ex1:
CFLAGS = -g -o
%.class: mydir/%.java
javac $(CFLAGS) $<
Assume you have the files "main.java" and "test.java" in the directory "mydir/". This dependency than will be the same as the following :
Ex2:
main.class: mydir/main.java
javac -g -o mydir/main.java
test.class: mydir/test.java
javac -g -o mydir/test.java
Variables (also known as macros)
Before make starts "executing" the makefile, it first preprocess it and
replaces all occurences of a variable by its content (if the variable is
defined as above, the replacement is recursive, i.e. you can use other
variables on the left side of the assignment).
Referencing a variable: a variable VAR is referenced by the string ${VAR}
(see Ex1). If you want to prevent the variable from being substituted by its
value (e.g. if you want the resulting command executed by the shell to be "$
echo $MYVAR"), put another '$' in front of it: $$MYVAR.
Conditionals
- influence what part of the file make "sees"
- conditionals have the form cond-directive
text-if-true [else text-if-false] endif
Cond-directive is one of the following: ifeq(arg1,arg2),
ifneq(arg1,arg2); ifdef variable-name, ifndef
var-name.
- "ifdef VAR" is false only if there exists "VAR = "
- "ifeq (VAR,) is true if the right-hand side of "VAR = ..." is evaluated to
be the empty string (notice there is nothing to the right of the comma)
Keywords
inlude filename - inserts the file filename into the
makefile
Other links:
See:
Notes
Some commands
finish | run till the end of a function | ||
kill | finish debugging (do not quit gdb) | ||
set args arglist | set arguments for the program before starting it | ||
run | (re)start | ||
break where | set breakpoint; where = line number | function namethe | ||
info break | display current breakpoints | ||
delete [n] | delete all breakpoints / b. number n | ||
p myarray@count | print array with count elements | ||
tbreak where | set temporary breakpoint | ||
ignore bp# count | ignore breakpoint number bp# count times |
Other links:
See:
See homepage (manual, quick reference). A very good brief tutorial.
If you mean it seriously with programming, you must use it. CVS helps you to keep all versions of your source codes, thus enabling you to track a bug, return to the last working source, compare the sources and more. Its basic purpose is to enable more developers to work on the same project in parallel.
Using CVS in few steps:
------------- Set up CVS & create a project
Create a CVS repository, e.g. in /usr/local/cvsroot:
$ cvs -d /usr/local/cvsroot init
For comfort, set the variable CVSROOT:
$ setenv CVSROOT /usr/local/cvsroot
or (bash, sh)
$ CVSROOT=/usr/local/cvsroot
Create you project (to group sources that belong together):
Create somewhere a directory [tree] and enter it
(its name doesn't matter since the main project directory will be
called according to the projectName set below), e.g.
$ mkdir ~/mytmp; cd
~/
mytmp
Import it into the CVS repository (import
projectName vendor_tag release_tag):
$ cvs import MyProjectName MyName
start
Delete the directory (it's stored in the
repository):
$ cd ~/; rm mytmp
------------- Working on your project:
Check out the project (copy it from the repository into
your working directory):
$ cvs -d /usr/local/cvsroot checkout
MyProjectName
or, if you have set CVSROOT:
$ cvs checkout MyProjectName
$ cvs -m "Edited by Viking." commit
$ cvs release -d MyProjectName
More commands
Command | Description |
---|---|
cvs status | prints status of files in the current directory (whether it's up-to-date or modified etc.) |
Add a directory into CVS without checkout:
If you want to add a directory into CVS and use it immediately without the
need for checking it out, it may work to check out only the "CVS"
subdirectory created by cvs into the dir. in question.
What | The command |
---|---|
Checkout a particular revision (e.g.
1.1) (into directory ~/mytempdir) |
$ cvs co -r 1.1 -d ~/mytempdir project-name/file.name |
Create a new module and start using it (TortoiseCVS does this; perhaps it also cd into the project dir. and out as appropriate) |
$ cvs import -m "msg"
ProjectDir tag-vendor tag-release $ cvs checkout -d ProjectDir |
Tagging: assign the same tag to all files so that they can be checked out as a unit later on | $ cvs tag unique_tag_name |
See what file tags are there | $ cvs log a_filename See the section "symbolic names" $ cvs status -v [a_filename] |
Checkout a particular tagged version | $ cvs co -r a_tag project_name |
***************
*** 61,70 **** // the numbers mark the range of
lines in the first file, which we talk about
//3 (or number) lines common to both files
// lines from the first file, marked by '-' (they are not in the second file,
they were 'deleted') or ' ' (lines which are same in both) or '!' (the line
is in both files, but differs)
//3 (or number) lines common to both files
--- 71,96 ---- // the numbers mark the range of
lines in the second file, which we talk about
//3 (or number) lines common to both files
// lines from the first file, marked by '+' (they are only in the second
file, they were 'added') or ' ' (space; lines which are same in both) or '!'
(the line is in both files, but differs)
//3 (or number) lines common to both files
//END of the example
To get such output, having 2 files 'original' and 'changed' (suppose that
'changed' was created by making some changes in 'original', write command
$> diff -B -b -i -c original changed
Flags: -B: ignore blank lines (empty lines added to or deleted from the 2nd
file), -b:ignore different number of blank characters - tabs and spaces, -i:
be case insensitive, -c: output in the context format
Note: GNU also developed wdiff - front-end for diff.
root# groupadd pureftpgroup
root# useradd -g pureftpgroup -d /dev/null -s /etc pureftpuser #
-d home_directory, -s shell
/etc/pure-ftpd# ln -s conf/PureDB 60puredb #now
pure-ftpd-wrapper will enable virtual users
I only want virtual users (PureDB authentification) => I delete all except 60puredb from /etc/pure-ftpd/auth/ and PAMAuth... form conf/
/etc/pure-ftpd/conf# echo '5005' > Bind
# the server
will listen at port 5005 instead of the default 21
Note: Never forget '-m' at the end of any command regarding users otherwise the user database won't be updated
Syntax: pure-pw useradd <virtual user name> -u <system user name> -d <home directory of the user (to which s/he connects via ftp)> -r <allowed IPs> -m (Of course there're more options).
Ex: root# pure-pw useradd my_user_name -u pureftpuser -d /mnt/data/media/music
-m
root# /etc/init.d/pure-ftpd start
# pure-ftpd created
by installation of PureFTPd *.deb package.
Logs:
/etc/pure-ftpd/conf# echo 'yes' > VerboseLog
# Allow
verbose log into /var/log/messages (via syslogd)Webfsd is a good alternative to a [anonymous] ftp server, if you want only to export files.
It can be chrooted (the option -R, requires to be run by root) or you can set the document root directory (-r <dirr>), limit it to a certain ip [net interface] (-i <ip>), listen on a given port (-p 7777), run in the foreground (-F), print debug info (-d), use ssl and more.
example$ webfsd -r `pwd` -i 192.168.1.1 -p 7777 -F -d -b aUserName:aPassword
SSH is a secure way how to connect to and work on another computer. The machine must be running a ssh server (e.g. sshd - ssh deamon).
ssh [-X] username@server
Used for remote connection, promts for the password. -X enables it to use
graphical user interface (X is a win. system).: ssh
jakho926@astmatix.ida.liu.se
How to set up sshd on you machine
$ ssh -keygen -t type
# where 'type' is one of
these: rsa1, rsa, dsa; execute for all of themDo you want to create LaTeX documents and don't like the plain text view? Would you prefer a graphical representation of the LaTeX file? Then LyX is here for you.
This text applies to LyX version 1.3.4.
Nromally, when checking an iso8859-2 (latin2) file, the spellchecker (ispell/aspell) doesn't check correctly words with accented letters - it thinks the accented letter is a word separator and splits the word in two instead of checking it. To correct it, add all the accented characters - ì̹©èÈøؾ®ýÝáÁíÍéÉúÚùU»«ïÏòÒ - to: of checking it. To correct it, add all accented characters to
Edit > Preferences > Language settings > Spellchecker > Escape characters
[CZ] Pro správnou kontrolu pravopisu v Lyxu pøidáme písmena s diakritikou (viz vý¹e) na vý¹e uvedené místo v preferencích aplikace.
See LyX Quickstarter - the article "Making Your Own Layout". Let's see an example how to add a new environment. Assume we want the standard book class with an additional environment called indentedpar that creates a paragraph separated from others by vertical spaces. We want it to look as the Standard "environment" except for the vertical spaces.
Create a new style based on the class book in $HOME/.lyx/layouts/mybook.layout and define there the environment indenterpar:
$HOME/.lyx/layouts/mybook.layout:
--------------------------------------------- #% Comment: Book style with a new environment # \DeclareLaTeXClass[book]{mybook} Input stdclass.inc Style IndentedPar LatexType Environment LatexName indentedpar BottomSep0.5 TopSep0.5 Margin Static NextNoIndent1 Preamble \newenvironment{indentedpar} { % start code: \list{}% will be based on the env. 'list' { \setlength{\leftmargin}{0pt} \setlength{\rightmargin}{\leftmargin} % rightm. == leftm. \setlength{\parsep}{\parskip}% distance of 2 paragraphs \setlength{\listparindent}{\parindent}% indentation of 2+ par. %\setlength{\itemindent}{\parindent}% indentation of 1st par. } \item\relax } { % end code: \endlist } EndPreamble End ---------------------------------------------
Then Edit->Reconfigure; quit and restart LyX.
Now you can select the environment IndetedPar providing you've set the style mybook for you document (Layout->Document->Layout tab->Document class). It shall be mentioned that this layout differs a bit from the Book layout regarding the Lyx display of the Bibliography env., see book.layout under the LyX installation directory.
Some explications:
See notes on LaTeX (hyphenation, vlnka).
To disable the automaticaly inserted '\usepackage{babel}' delete it from: Edit > Preferences > Language settings > Language > Language package: . You may want to replace it by '\usepackage{czech}'.
Some useful hot keys (see ~/.fluxbox/keys):
fbsetbg [options] image
- set background image.Click the image for a detailed view & description.
My Fluxbox, May 28, 2005 |
When the screen is locked by xscreensaver it doesn't prevent another user from logging in - you can either log back in or click "New login" to run - after a delay - a new instance of gdm (gnome display manager) that presents you with the login window. Perhaps it also works with kdm/xdm.
The program xscreensaver itself is a daemon that shall be run at the beginning of user's session. It can be controlled by xscreensaver-command, e.g. 'xscreensaver-command -lock' locks the screen. You can set the screensaver via its GUI settings panel - run xscreensaver-demo.
It's very good in conjunction with hibernation by suspend2 (software suspend 2) - if you set suspend2 to lock the user's session automatically upon hibernation ('LockXScreenSaver yes' in hibernate.conf) it tries to use xscreensaver - which won't prevent another user to use the computer when switched on. Note: It only works it the user already runs xscreensaver (the daemon), otherwise it's supposed it is not available and xlock is used instead.
created by Jakub Holy 2003AD