This file contains a couple of answers to questions you might have when using a GNU/Linux OS.
Use od -A x -w<length> -t x1 <file> where
-A x says to print the file offset in
hexadecimal, -w<length> says how many bytes per line we
have and -t x1 says that you want the file
interpreted as containing bytes.
cdrecord -scanbus. Choose the three numbers listed along with your CD recorder, for instance for
0,0,0 0) 'HL-DT-ST' 'RW/DVD GCC-4241N' 'A100' Removable CD-ROMthose numbers will be 0,0,0.
cdrecord
-v dev=scsibus,target,lun <file>.
Use rpm2cpio <rpm_file> | cpio -idmv
--no-absolute-filenames.
Use wget -r -p -k -np <URL>, where -r
means to download the pages recursively, -p means to download
all the page prerequisites and -k means to convert links such
that the page can be viewed locally and -np means to not
ascend to the parent directory. You might need to add a
-e robots=off, to ignore sites that don't
like robots.
At this time, 2004-09-07 wget cannot download files larger than 2GB.
The following method works if the remote computer has the same user name and password as the current computer.
Generate a new RSA key using ssh-keygen -t rsa
on the local machine, and then store the content of the
generated file ~/.ssh/id_rsa.pub into
~/.ssh/authorized_keys on the remote machine.
Sometimes, even if you do that, automatic login will still
not work. The reason I have seen is that the file
~/.ssh/authorized_keys has write permissions
for group, and sshd doesn't like this. A
useful method for debugging the the connection is:
service sshd
stopsshd -d at a terminal window. Kill any rpm process that you have running. Go to
/var/lib/rpm and remove the rpm database files
(rm __db.*). Rebuild the rpm database (rpm
-vv --rebuilddb). For more information see Repair a RPM
database.
a2ps by default prints the document generated from your
latex source. To disable that you have to type: a2ps
--delegate=no <latex_file>. However, this didn't
work very well for me as they were symbols that were still
interpreted by a2ps.
Better, use enscript with the following
command that will print the LaTeX file in landscape mode with
every line prefixed by its line number.
enscript -2r --line-numbers=1 <latex_file>
Please check the answer listed here
This question refers to the ability to select in the viewer
the paragraph you are editing in emacs and the ability to
select in emacs the paragraph you clicked on in the viewer. To
do that you have to use AUCTeX package with emacs and and the
xdvi viewer. C-c C-c View command in emacs will
start the viewer with the current emacs paragraph highlighted
in the viewer, and Ctrl + left-click command in
the viewer will move the focus on emacs and select the
paragraph you clicked on.
Use java -agentlib:hprof=cpu=samples,thread=y,depth=12
<class_file> to start your program with
profiling enabled. cpu=samples means that the
current stack frame of the program will be periodically
sampled, thread=y means that the dump will
include thread information, and depth=12 gives
the number of functions that will be printed for a given
execution frame. This will generate a file called
java.hprof.txt. Examine the file with a text
editor and with JPerfAnal by
using the following command: java -jar jperfanal.jar
java.hprof.txt. More informations at HPROf:
A Heap/CPU Profiling Tool in J2SE 5.0 and PerfAnal:
A Performance Analysis Tool. The NetBeans
Profiler looks promising but it is not there yet as of
2005/10/08. Update (2007/10/01): I took another look at the
profiler for NetBeans 5.5.1. While it is improved, it still
seems to give me wrong results. HPROF + JPerfAnal is still
the way to go for now.
Navigate to Start>Control Panel>Fonts.
Write down the file names of the fonts you want to copy.
Copy those files from %SYSTEMROOT%/fonts. See
next question for instructions to install those fonts in
Linux.
cd /usr/share/fonts cp <source_font_dir> <font_dir> cd <font_dir> ttmkfdir mkfontdir chkfontpath -a /usr/share/fonts/<font_dir> fc-cache
A quick and dirty solution is to edit
/usr/share/applications/redhat-* and specify
the path to the new version of the program. See Fedora
Core 4 Desktop Gnome 2.10 and KDE 3.4 for a good
description of the gnome file associations.
Use <openoffice.dir>/program/spadmin to
setup a new software printer that converts openoffice.org
documents printed to it to PDF. Type the following: New
Printer.../Connect a PDF converter/Next/The default
driver/Next/<select the command line
provided>/Next/Finish Now you can print convert
documents to PDF by typing at the command line: soffice
-p 'PDF converter' <file>. The PDF file will be
created in the PDF target directory or in the
home directory if you left that field empty.
It is always a good idea to setup periodic checks on the
file system, especially since ext3 the journaling file system
disabled those checks. I lost a couple of days reinstalling
linux because errors were not caugth in time. Use this command
to set checks every 30 mounts or every 6 months which ever is
sooner on all /dev/hda drives that are not
ntfs.
for i in `mount | grep hda | grep -v ntfs | cut -d ' ' -f 1`; do tune2fs -c30 -i6m $i; doneUse the following command to check the current parameters for all
/dev/hda drives.
for i in `mount | grep hda | grep -v ntfs | cut -d ' ' -f 1`; do tune2fs -l $i; done
Use the templates from Worldlabel.com.
/usr/src:
cd /usr/src;tar xjf
linux-2.6.15.6.tar.bz2. This will create a directory
/usr/src/linux-2.6.15.6kernel-2.6.12-1.1381_FC3.src.rpm from download.fedora.redhat.comrpm -ivh
kernel-2.6.12-1.1381_FC3.src.rpmcd
/usr/src/redhat/SPECS/;rpmbuild -bp --target=noarch
kernel-2.6.spec/usr/src/redhat/BUILD/kernel-2.6.12/linux-2.6.12/configs/
to /usr/src/linux-2.6.15.6/.configmake oldconfigmake xconfig or make
menuconfigmake mrproper all
modules_install installdefault value to 0 into
/etc/grub.confinit 3, recompiling the driver and than
loading X with init 5If you have a graphic card and a driver which supports
OpenGL, MATLAB (version 7.0.1.24704 (R14) Service Pack 1 or
later) should figure this out and enable hardware OpenGL by
default. Check this by typing opengl info at
MATLAB propt. If your driver works corectly but MATLAB still
says that it uses software opengl, you might solve this by
renaming <matlab>/sys/os/glnx86 to
glnx86_old. This directory contains a bunch of
older versions of libraries which are already available on
your system. You will have to reload MATLAB to see any
change. This fix worked with Fedora Core 3. For Fedora Core
5 I had to create a glnx86 directory and inside
it, create a link to libXm.so.2 to
../glnx86_old/libXm.so.2
VNC Server starts a new X Server on the 'remote-host' where you can display the results of your programs, in general tests that run for a long time. The advantage is that those programs don't need to be connected to your 'local-host', but you still can see their output from time to time. Unfortunately, that X Server doesn't know OpenGL.
On the 'remote-host', as 'root' you'll have to set
VNCSERVERS to "1:user" in
/etc/sysconfig/vncservers. As 'user' setup the
VNC password by calling vncpasswd. As 'root'
start the VNC server by typing service vncserver
start.
From the 'local-host' you can connect to the
remote-host's new X server by using vncviewer
remote-host:1 and by typing the password you just
setup. If your gateway allows only ssh trafic, you can use
vncviewer -via remote-host remote-host:1 to
connect to the remote-host.
Install CYGWIN and make sure you select openssh package and install RealVNC
Securely forward port 5911 (you can choose any
port here) on the local-host to port 5901 (the default port for
VNC) on the remote-host:
ssh remote-host -L 5911:127.0.0.1:5901
Modify the shortcut for vncviewer to read vncviewer.exe
127.0.0.1:5911
Usually this is usefull if you want to process that web
page through a script. Install links web browser
and once you loaded the web page you can do ESC to
show the menu and then File>Save formatted document
diff and ignore changes in amount of white space in subversionsvn diff --diff-cmd /usr/bin/diff -x "-b" <file>
.Xresources
Execute xrdb -merge ~/.Xresources
Run texhash as root.
Use gtypist. You can install it
using yum install gtypist
You can use the calendar program in
emacs. M-x calendar. Then you can print a yearly
calendar in various formats. For instance to generate a
calendar in LaTeX you type t y. You have to save
that buffer in a file C-x C-w <file>
You can use sshfs user@system:path mountPath
In /etc/fstab, you have to replace
defaults with user for that file
system.
The following code generates a 1GB file. dd
if=/dev/urandom of=gb_file bs=1MB count=1000 If the
file you want to generate is pretty small use
bs=size and use count=1.
There are two utility programs dos2unix and
unix2dos that can do that.
This is adapted from http://www.math.umd.edu/~jkolesar/latexandXfig.html and http://www.eg.bucknell.edu/physics/ph329/xfig_latex.html
Inside xfig, add the LaTeX expressions to the figure, using
$...$ to switch to math-mode where necessary. Use the normal
method in xfig for adding text, but set the special
text mode using the Text flags menu at
the bottom of the screen.
Add the following entry to your .bashrc file:
xfig2eps ()
{
if [ $# -ne 1 ]; then
echo "${FUNCNAME[0]} <xfig_basename>";
return;
fi
echo \
"\documentclass{article}
\usepackage{amssymb,amsmath,graphics,epsfig,color}
\pagestyle{empty}
\begin{document}
\begin{figure}
\input{temp.pstex_t}
\end{figure}
\end{document}" > $1.tex;
fig2dev -L pstex -F $1.fig > temp.pstex
fig2dev -L pstex_t -p temp.pstex $1.fig > temp.pstex_t
latex $1
dvips -E -o $1.eps $1.dvi
rm $1.tex $1.aux $1.dvi $1.log temp.pstex temp.pstex_t
}
Run the the following command to generate the eps file from the xfig file
xfig2eps fig1.fig
You should now have a file named fig1.eps
which can be included in other LaTeX documents.
Directory index
forbidden by Options directive. How do I fix this?You will have to modify
/etc/httpd/conf/httpd.conf and change:
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
to add Indexes in the list of options like
this: Options Indexes FollowSymLinks