find . -name regfeat_cbl.dat > list.txt
tar zcvf regfeat_cbl.tar.gz –files-from=list.txt
Tar specific file(s) recursively
Linux Posted on Fri, July 04, 2008 12:27:01- Comments(0) https://notes.samulski.nl/?p=4
- Share
Recursively delete files
Linux Posted on Wed, June 18, 2008 13:19:13Back again with a handy command I forget all the time…
find /from/this/directory -name \*.tmp -exec rm {} \;
this will recursively delete all *.tmp files from /from/this/directory and higher.
To let find ask for a confirmation for each file, do this:
find /from/this/directory -name \*.tmp -ok rm {} \;
- Comments(0) https://notes.samulski.nl/?p=5
- Share
Replace tabs with spaces
Linux Posted on Wed, May 21, 2008 08:01:31 To convert all tabs to 5 spaces you can use the following perl command line:
(replace ___ to spaces)
perl -e ‘($_ = join “”,<>) =~ s/(\t)/_____/g; print;’ < input.txt > output.txt
- Comments(0) https://notes.samulski.nl/?p=6
- Share
Copying symbolic links from remote PC
Linux Posted on Mon, March 31, 2008 12:24:59Normally you would use scp to copy files between PC’s, but it will follow every symbolic link and copy the data instead of the symbolic links themselves. With rsync however you can copy symbolic links.
rsync -azuv -e ssh user@host:/remote/directory /local/directory
- Comments(0) https://notes.samulski.nl/?p=7
- Share
Searching within files
Linux Posted on Tue, March 11, 2008 08:31:16To search for files recursively containing a certain string (not in the filename, but in the file itself):
find . -name ‘filename’ -exec grep -H -i “searchstring” {} \;
- Comments(1) https://notes.samulski.nl/?p=8
- Share
Broken links
Linux Posted on Mon, March 10, 2008 08:20:46To get a list of broken links on your system, do a
( find / -type l | xargs file ) | grep ‘broken symbolic link’ | cut -d”:” -f1
to get a filelist of broken links.
- Comments(1) https://notes.samulski.nl/?p=9
- Share
kNN in Weka
Linux Posted on Wed, January 30, 2008 12:02:52 To use the kNN classifier in Weka (Waikato Environment for Knowledge Analysis) you have to click on the label under
‘Classifier’, and then choose ‘IBk’ from the drop-down menu.
The option ‘KNN’ defines the number of neighbors.
The
‘distanceWeighting’ option allows to adapt the influence of the
neighbours according to their distance, and ‘crossValidate’ searches for the best “k” value using crossvalidation.
- Comments(0) https://notes.samulski.nl/?p=10
- Share
Location floating images
LaTeX Posted on Fri, January 18, 2008 11:20:34To avoid that floating images are located after a certain point, e.g. you don’t want the image between the references, you can use the following statement that places a barrier beyond which floats may not pass.
\FloatBarrier
The following package have to be included:
\usepackage{placeins}
- Comments(0) https://notes.samulski.nl/?p=11
- Share
Two figures side by side
LaTeX Posted on Wed, December 19, 2007 11:43:39To put two figures side by side you can use minipages inside the figure environment.
\begin{figure}[t]
\begin{minipage}[t]{0.48\textwidth}
\begin{center}
\includegraphics[width=0.92\textwidth]{images/picture1}
\caption{\label{fig:pic1}Caption 1}
\end{center}
\end{minipage}
\hfill
\begin{minipage}[t]{0.48\textwidth}
\begin{center}
\includegraphics[width=0.92\textwidth]{images/picture2}
\caption{\label{fig:pic2}Caption 2}
\end{center}
\end{minipage}
\end{figure}
- Comments(0) https://notes.samulski.nl/?p=12
- Share
Exporting Messages from Evolution
Linux Posted on Wed, October 24, 2007 14:26:46There is a File | Import… menu item in Evolution, but no corresponding Export menu item. However, you can export messages from Evolution into the well known mbox format, by doing the following steps:
– Select the folder in Evolution you want to export
– Select Folder | Select All Messages from the menu.
– Select File | Save Message… from the menu.
– Choose location and filename where to save the emails,
preferably with extension .mbx
– Click OK
Disadvantage is that it needs to be repeated for every folder.
- Comments(0) https://notes.samulski.nl/?p=13
- Share
No icons in evolution
Linux Posted on Tue, October 16, 2007 11:11:46If you get the following warnings, and there are no icons in Evolution, you probably have a non-existent theme selected in the gnome theme manager.
Gtk-WARNING **: Unable to locate theme engine in module_path: “qtengine”
One of the probable causes is that some themes get deleted/updated when installing gnome updates.
This can be fixed by running gnome-theme-manager and select a different, existing theme.
- Comments(0) https://notes.samulski.nl/?p=14
- Share
SSH Tunnel
Linux Posted on Thu, September 06, 2007 10:28:26To tunnel IMAP via SSH to localhost if you are using xs4all:
ssh -C <usernaam>@xs3.xs4all.nl -L 11143:imap.xs4all.nl:143
Your mailclient should then be configured to read mail on server localhost:11143
- Comments(0) https://notes.samulski.nl/?p=15
- Share
Layouts Qt3 -> Qt4
Qt Posted on Mon, September 03, 2007 08:22:27Converting layouts in Qt3 to Qt4 involves:
The old-style QLayout(QLayout* parent) needs to be replaced by a new
empty contructor and a subsequent parent->addLayout(child) statement.
Example Qt3:
QVBoxLayout *vbox = new QVBoxLayout ( this );
QHBoxLayout *box3 = new QVBoxLayout ( vbox );
QVBoxLayout *box4 = new QVBoxLayout ( box3 );
QVBoxLayout *box5 = new QVBoxLayout ( box3 );
QHBoxLayout *box6 = new QVBoxLayout ( vbox );
Ported to Qt4:
QVBoxLayout *vbox = new QVBoxLayout( this );
QHBoxLayout *box3 = new QHBoxLayout;
QVBoxLayout *box4 = new QVBoxLayout;
QVBoxLayout *box5 = new QVBoxLayout;
QHBoxLayout *box6 = new QHBoxLayout;
vbox->addLayout(box3);
box3->addLayout(box4);
box3->addLayout(box5);
vbox->addLayout(box6);
- Comments(0) https://notes.samulski.nl/?p=16
- Share
Memory management C/C++
C++ Posted on Thu, August 30, 2007 08:40:25In C++ we have the operator new and operator delete. These are intended to replace malloc() and free() in the C standard library.
Allocating a array of 100 integers is done in C as follows:
int* is;
is = (int*)malloc(sizeof(int) * 100);
…
free((void*)is);
With new/delete in C++, it can be rewritten as:
int* is;
is = new int[100];
…
delete is;
- Comments(1) https://notes.samulski.nl/?p=17
- Share
External library dependency
Qt Posted on Thu, August 30, 2007 08:19:49When you change an external library, your Qt project is not recompiled. By default, qmake does not include external libraries in the dependencies for the final executable, because they are not part of the project itself. This can easily be solved by adding a forced dependency in the .pro file:
POST_TARGETDEPS += /libpath/libCAD.a
- Comments(0) https://notes.samulski.nl/?p=18
- Share
QVTKWidget BadWindow
Qt Posted on Thu, August 30, 2007 08:09:41Using VTK (QVTKWidget) in combination with Qt 4.2.0 or Qt 4.2.1, which is included in the SuSe 10.2 distribution, can cause the following errors:
X Error: BadWindow (invalid Window parameter) 3
Major opcode: 3 (X_GetWindowAttributes)
Resource id: 0x0
X Error: BadValue (integer parameter out of range for operation) 2
Major opcode: 1 (X_CreateWindow)
Resource id: 0x0
X Error: BadWindow (invalid Window parameter) 3
Major opcode: 20 (X_GetProperty)
Resource id: 0x0
X Error: BadWindow (invalid Window parameter) 3
Major opcode: 3 (X_GetWindowAttributes)
Resource id: 0x3c00002
Segmentation fault
This is a bug introduced in Qt 4.2.0 where they delete all descending underlying windows when reparenting a widget. This is fixed in Qt 4.2.2. More information here.
- Comments(0) https://notes.samulski.nl/?p=19
- Share