-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwiki.txt
2269 lines (1759 loc) · 82.1 KB
/
wiki.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% ODL and general python thingies
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LCR/ODL/odl/examples/convolution_class.py
Difference()._apply:
what does rhs.asarray()? acces to numpy array. Does this also work
for Rn?
what does out[:] do? Access to numpy array? (it is the same type as
rhs?
Copy because direct acces via
out[0][:-1,:] = asarr[1:,:]-asarr[:-1,:] not possible?
why not using slice object as in numpy.gradient or numpy.diff
self.domain in call of adjoint should be self.range?
if l is instance of odl.discr.l2_discr.Vector, what does l[:] return
Why ndarray acces 'directly' via asarray while in
LCR/ODL/odl/examples/tomography_simrec2d.py
access is via data.ntuples.data?
Why is data stored in different attributes?
if v is instance of odl.discr.l2_discr.Vector.data, then v.ntuples.data
if v is instance of odl.Rn, in v.data
Again comparing the above files? Why is the adjoint initialized in
__init__ for the Projector but not in Difference?
What to use for an operator? How to adopt operator for different
spaces?
How to implement operator that are used in optimization regarding the
domain? Use of original or vectorized (ravel) arrays?
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% PyCharm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
----------------------------------------------------------------------
keymaps
Alt + Home: Navigation bar pops up
Following three work in Editor and completion popup list
Ctrl+Q View | Quick Documentation
Alt+Shift+P View | Parameter Info
Ctrl+Alt+G Navigate | Declaration
Ctrl + X, B Pops up switcher dialogue window. Similiar to emacs
behavior.
Alt + Y Choose content to paste (selection windows pops up)
Ctrl + Shift + F7 (Edit | Find | Highlight Usages in File) to quickly
highlight usages of some
F3, Shift+F3 Navigate through highlighted usages
ESCAPE, ESCAPE Remove highlighting
Ctrl + Shift + Backspace (Navigate | Last Edit Location)
Alt + Shift + P when between parentheses of a method call lists valid
parameters
Alt + Shift + Q Indentation of text
Ctrl + Shift + P Pylint
Ctrl + Alt + G Open declaration
Alt + Enter Show intention and quick fixes
Ctrl + Shif + J Smart line join
Alt + / Basic code completion
Alt + Up/Down Move between methods in Editor
----------------------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% GIT
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
----------------------------------------------------------------------
Using GitHub API with personal access token (in the case that the use
of ssh is restricted and standard https authentication with username
and password fails):
Go to github, navigate to Setting -> Applications
Generate Personal access token AND SAVE IT.
Use name of token as user name and the access token as password.
----------------------------------------------------------------------
Save username and password or name token and token, respectively using
credetnial helper
git config credential.helper store and then make a push/pull/etc that
requires a authentication
----------------------------------------------------------------------
show list of tracked files
git ls-tree -r master --name-only
----------------------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% NVIDIA
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
----------------------------------------------------------------------
CUDA version
nvcc --version
gives the CUDA compiler version (which matches the toolkit version).
From application code, you can query the runtime API version with
cudaRuntimeGetVersion()
or the driver API version with
cudaDriverGetVersion()
As Daniel points out, deviceQuery is an SDK sample app that queries
the above, along with device capabilities.
----------------------------------------------------------------------
Ubuntu start screen freezes and/or login screen is looping after
entering password
Probable cause: X-server was not configured probably after CUDA
installation
Solution:
Boot in recovery mode and try to login via terminal
Remove /home/USER/.Xauthority
reboot
ALTERNATIVELY:
instead of remove .Xauthority run
sudo nvidia-xconfig
----------------------------------------------------------------------
Installation of NVIDIA driver with dkms support
The following relates to the installation of the NVIDIA driver only
and not to CUDA. In the case the CUDA toolkit installer is used,
download the (latest) driver seperately or extract it from the bundled
installer
cuda_*_linux.run --extract=<ABSOLUTE_PATH>
For newer driver releases, steps 0-2 are not needed.
0. uninstall current driver, probably X-server needs to be stopped
beforehand:
sudo ./*.run -uninstall
1. Build driver modules for the current kernel
sudo sh ./<DRIVER>.run -K
2. Reboot:
sudo reboot
No need to reboot multiple times and switch adapters.
Reference: Ubuntu Wiki: Nvidia Manual - Kernel and Mesa Updates
Make sure to use the same gcc/g++ version with which the kernel was
build and stop the X-server (see xstop alias in .bashrc for Ubuntu
12.04):
To be complete, For driver release >=304 it is possible to register
its module to DKMS. DKMS will take care of building it for each newly
installed kernel.
3. Install DKMS (For some reasons, it may not be installed already)
sudo apt-get install dkms
4. Reinstall nVidia driver with DKMS option.
sudo sh ./<DRIVER>.run --dkms
5. After this, it should be no need to redo the steps above any
more. A way to verify/check after new kernel install:
dkms status
References:
Registering the NVIDIA Kernel Module with DKMS
sh ./<DRIVER>.run --advanced-options
----------------------------------------------------------------------
to unistall driver run: nvidia-unistall
----------------------------------------------------------------------
to unistall cuda toolkit run uninstall scritp in
/usr/local/cuda.*.*/bin
----------------------------------------------------------------------
Inormation about GPUs nvidia-smi -l
----------------------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% PYTHON
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
----------------------------------------------------------------------
Investigating Inheritance
If you want to find out whether a class is a subclass of another, you
can use the built-in method issubclass:
>>> issubclass(SPAMFilter, Filter)
True
>>> issubclass(Filter, SPAMFilter)
False
If you have a class and want to know its base classes, you can
access its special attribute __bases__:
>>> SPAMFilter.__bases__
(<class __main__.Filter at 0x171e40>,)
>>> Filter.__bases__
()
----------------------------------------------------------------------
Statement after import __metaclass__ = type not needed when inheriting
from object class CLASSNAME(object)
----------------------------------------------------------------------
In-place type conversion of numpy.ndarray
You can make a view with a different dtype (as long as the itemsize
remains the same), and then copy in-place into the view:
import numpy as np
x = np.arange(10, dtype='int32')
y = x.view('float32')
y[:] = x
print(y)
yields
array([ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9.], dtype=float32)
To show the conversion was in-place, note that copying from x to y
altered x:
print(x)
prints
array([ 0, 1065353216, 1073741824, 1077936128, 1082130432,
1084227584, 1086324736, 1088421888, 1090519040, 1091567616])
----------------------------------------------------------------------
PYLINT
reduce output via disabling reports:
pylint -rn
is equal to
pylint –reports=n
Get rid of messages like :
Module MODULE has no MEMBER member (no-member)
pylint --extension-pkg-whitelist=MODUL
Get help on messages, e.g.
C:342, 0: Invalid constant name "sets" (invalid-name)
pylint --help-msg=invalid-name
----------------------------------------------------------------------
ipython notebooks in pychamr IDE, as of 2015-08-24
only works with ipython version 2.4.1 since In Ipython 3.0 the kernel
messaging protocol and notebook format have changed.
sudo -H pip install 'ipython==2.4.1'
----------------------------------------------------------------------
matplotlib: animated plotting within loop
import matplotlib
matplotlib.use("qt4agg")
from matplotlib import pyplot as plt
fig = plt.figure()
axis = fig.add_subplot(111)
for i in range(30000):
axis.plot(i,i,'o')
if i > 5:
plt.pause(1)
plt.close()
----------------------------------------------------------------------
Install python related package using pip
sudo -H pip install PACKAGE
List outdated packages
pip list --outdated
resolve dependencies before installation using:
sudo apt-get build-dep PACKAGE
----------------------------------------------------------------------
pip VS apt
Ubuntu Oneiric (and I expect newer versions too) install pip packages
to /usr/local/lib/python2.7/dist-packages, and apt packages to
/usr/lib/python2.7/dist-packages. So just check the former directory
and sudo pip uninstall every package you find there.
----------------------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% ODL
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
----------------------------------------------------------------------
ODLpp make error
Error message while make:
[ 40%] Building CXX object ODLpp/CMakeFiles/odlpp_cuda.dir/cuda.cpp.o
/home/jmoosmann/git/LCR/ODLpp/ODLpp/cuda.cpp:2:31: fatal error: numpy/numpyconfig.h: No such file or directory
#include <numpy/numpyconfig.h>
^
compilation terminated.
make[2]: *** [ODLpp/CMakeFiles/odlpp_cuda.dir/cuda.cpp.o] Error 1
make[1]: *** [ODLpp/CMakeFiles/odlpp_cuda.dir/all] Error 2
make: *** [all] Error 2
Solution:
Set
PYTHON_NUMPY_INCLUDE_DIR
to
/usr/local/lib/python2.7/dist-packages/numpy/core/include
----------------------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Build python wrapper for C code
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
----------------------------------------------------------------------
copy arbitrary lib*py and modify:
lib*py.cpp
CMakeLists.txt
setup.py
----------------------------------------
Install python wrapper for wavelet library
enter build directory
ccmake ../
or
cmake-gui ../
configure following
Ungrouped Entries
OPTIMIZATION ON
HIGH_PRECISION ON
MEX_ENABLED OFF
PYTHON
PYTHON_ENABLE ON
make
sudo make libwaveletspyInstall
----------------------------------------
Write python wrapper
----------------------------------------------------------------------
Find installation location of module
When you import a module, you usually can check the __file__ attribute
of the module to see where the module is in your filesystem:
module __file__ attribute
import numpy
numpy.__file__
BUT! The file attribute is not present for C modules that are
statically linked into the interpreter; for extension modules loaded
dynamically from a shared library, it is the pathname of the shared
library file
import imp
imp.find_module('NameOfModule')
----------------------------------------------------------------------
Search path
import sys
print '\n'.join(sys.path)
----------------------------------------------------------------------
examine your local namespace:
>>> from pprint import pprint
>>> pprint(locals())
----------------------------------------------------------------------
RL: building
RLcpp: building
cd build
cmake ../
make
sudo make PyInstall
----------------------------------------------------------------------
----------------------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% IPYTHON
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
----------------------------------------------------------------------
Reloading submodules in IPython
IPython comes with some automatic reloading magic:
%load_ext autoreload
%autoreload 2
It will reload all changed modules every time before executing a new
line. The way this works is slightly different than dreload. Some
caveats apply, type %autoreload? to see what can go wrong.
----------------------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
NOTES KTH MEDICAL IMAGING: Software, toolboxes, installation,
reconstruction, bugs,
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
----------------------------------------------------------------------
TESTING NIFTY TOOLBOX
Running tt_demo_mlem_conebeam in Matlab
results in Matlab crash: segemention violation
terminal output:
[NiftyReg CUDA ERROR] file '/home/jmoosmann/Software/NiftyRec/NiftyRec-2.0.1/transmission-lib_gpu/_tt_line_backproject_ray_gpu_kernels.cu' in line 213 : invalid device symbol.
line 213f of _tt_line_backproject_ray_gpu_kernels.cu:
CUDA_SAFE_CALL( cudaMemcpyToSymbol("c_invViewMatrix_bk", invViewMatrix, sizeofMatrix, 0, cudaMemcpyHostToDevice) );
// CUDA_SAFE_CALL(cudaMemcpy(c_invViewMatrix_bk, invViewMatrix, sizeofMatrix, cudaMemcpyHostToDevice));
No error messages occurs when using CPU instead of GPU (GPU=0).
REINSTALLING NIFTYREC
Toggling option NiftyRec_COMPILE_DOC when configruing with cmake-gui, error message occurs:
CMake Warning (dev) in documentation/manual/CMakeLists.txt:
Syntax Warning in cmake code at
/home/jmoosmann/Software/NiftyRec/NiftyRec-2.0.1/documentation/manual/CMakeLists.txt:8:63
Argument not separated from preceding token by whitespace.
This warning is for project developers. Use -Wno-dev to suppress it.
Inserting white space in the above CMakeLists.txt solves the problem.
NIFTYREC PYTHON
to load NiftyRec module within python via
from NiftyRec import NiftyRec
environment variables have to set beforehand
add
export LD_LIBRARY_PATH=/usr/local/lib/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH
to $HOME/.profile
Take care of the exact name of the cuda library: lib or lib64.
NIFTYREC MATLAB
tt_project_ray_mex takes as optional argument #9 USE_GPU=[0,1] which,
however, has no effect. Computation is always executed on GPU. Tested
with tt_demo_project_mod = modified version of tt_demo_project.
WALNUT DATA
for proper ground truth reconstruction from unprocessed sinogram with
1200 projections:
- replicate padding to remove incomplete data ring, symmetric padding
not working for cone-beam setup
- hot pixel filter removes broken pixel line artifacts, use of dark
(not dead) pixel filter smears out some fine structures, do not use
dark pixel filter
--------------
freeglut:
/usr/lib/x86_64-linux-gnu/libglut.so
----------------------------------------------------------------------
Basic VI commands and principles
----------------------------------------------------------------------
vi has two modes: the command mode and the insert mode. In command
mode, letters of the keyboard will be interpreted as commands. When
you are in insert mode the same letters of the keyboard will type or
edit text. vi always starts out in command mode. You can type i to
enter the insert mode. If you wish to leave insert mode and return to
the command mode, hit the ESC key. If you're not sure where you are,
hit ESC a couple of times and that should put you back in command
mode.
Change from the command mode to the insert mode: i
If the Backspace key doesn't work properly on your system, try using
the Ctrl h key combination.
If you've just finished typing text, you're still in insert mode and
will need to press ESC to return to the command mode.
Closing and Saving Files
:w to save your file but not quit vi (this is good to do periodically in
case of machine crash!).
:q to quit if you haven't made any edits.
:wq to quit and save edits (basically the same as ZZ).
----------------------------------------------------------------------
----------------------------------------------------------------------
FIREFOX
----------------------------------------------------------------------
Add-ons:
Adblock Plus
FireGestures
Instant Fox
Location Bar Enhancer
QuickFox Notes
QuickWiki
Xmarks
Colorful Tabs
Youtube High Definition
Turn off the lights
----------------------------------------------------------------------
Firefox: Bookmarking not possible
Close Firefox completely
Open the Firefox profile folder (~/.mozilla/firefox/t*)
Delete or rename all files named "places.sqlite", including
"places.sqlite-journal" and any "places.sqlite.corrupt" files, if
found (but first, see below, if a places.sqlite.corrupt file exists).
----------------------------------------------------------------------
Remove unwanted language packs
They are located in (or similiar)
/usr/lib/firefox-addons/extensions
sudo rm /usr/lib/firefox-addons/extensions/[email protected]
Also check removing packages such as hunspell-en-ca hunspell-de-at etc.
sudo apt-get purge hunspell-en-ca myspell-en-au myspell-en-za
----------------------------------------------------------------------
----------------------------------------------------------------------
THUNDERBIRD
----------------------------------------------------------------------
----------------------------------------------------------------------
Set up POP in mail clients
Standard configuration instructions:
Incoming Mail (POP3) Server - requires SSL: pop.gmail.com
Use SSL: Yes
Port: 995
Outgoing Mail (SMTP) Server - requires TLS or SSL: smtp.gmail.com
Use Authentication: Yes
Port for TLS/STARTTLS: 587
Port for SSL: 465
Server timeouts Greater than 1 minute, we recommend 5
Full Name or Display Name: [your name]
Account Name or User Name: your full email address (including @gmail.com or @your_domain.com)
Email Address: your email address ([email protected] or username@your_domain.com)
Password: your Gmail password
----------------------------------------------------------------------
Thunderbird LDAP search is VERY slow on a large LDAP installation (MS
AD in this case)
Problem: after configuring an LDAP directory in the thunderbird
address book, searching for entriers takes forever but doesn't find
anything.
Started wireshark, found out that a query is sent to the server
alright. After 60 seconds, the server came back with a timeout failure
(which the TB UI doesn't show, but the packet can be seen in
wireshark).
Looking at the LDAP query string shows why: it's a logical "or" of
email, name, first name, last name, all of them using a "contains"
operator: (|(email=*XXX*)(sn=*XXX*)) etc. This means the LDAP server
can't use indexes, so it has to do four full table scans which take
forever.
The LDAP query string can be set in a hidden configuration option
called "mail.addr_book.quicksearchquery.format", which is documented
in https://developer.mozilla.org/en/Thunderbird/Hidden_prefs - it says
the default string is
pref("mail.addr_book.quicksearchquery.format","?(or(PrimaryEmail,c,@V)(DisplayName,c,@V)(FirstName,c,@V)(LastName,c,@V))");
with the c meaning "contains". However, it doesn't list any other
possibilities to use instead of "c", it just refers to the source
code.
That can be viewed at
http://dxr.mozilla.org/comm-central/comm-central/mailnews/addrbook/src/nsAbQueryStringToExpression.cpp.html#l278
where "bw" stands for "begins with".
So, i changed the preference to
"?(or(PrimaryEmail,bw,@V)(DisplayName,bw,@V)(FirstName,bw,@V)(LastName,bw,@V))");
and look what happens - querys are fast again. Of course, you won't
find anything containing your query anymore, just strings that begin
with your query - but that's what you want in most cases anyway, and a
working "starts with" is better than a non-functional "includes" in
any case.
config editor is found under:
Einstellungen... > Erweitert > Allgemein > Konfiguration bearbeiten..
----------------------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LINUX %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
----------------------------------------------------------------------
Update PCI hardware database
update-pciids
----------------------------------------------------------------------
Graphical user interfaces/backends
GTK+
or the GIMP toolkit, multiplattform toolkit for creating GUI, written
in C/C++
python backend: PyGTK: for creating programs with a GUI using python,
multiplattform, free
Qt
independent technology for cross-platform development
----------------------------------------------------------------------
*.desktop files: Use of relative paths for scripts and icons
For scripts use relative paths w.r.t. to HOME directory simply without
leading slash, e.g. to start the script under $HOME/bin/script.sh
simply use Exec=bin/script.sh
For icons its differnt. There use default search paths for icons and
.png files instead of jpg. Default search paths are:
$HOME/.icons, /usr/share/icons or /usr/share/pixmaps
(convention for the freedesktop)
----------------------------------------------------------------------
very fast image viewer from command line
feh
view images in order using feh
feh `ls -v *.png`
----------------------------------------------------------------------
pdf manipulation in linux:
pdftk
pdfmod: edit PDFs by moving pages around and deleting them. It’s in apt.
----------------------------------------------------------------------
Disable ssh root login
sudo emacs /etc/ssh/sshd_config
Change PermitRootLogin without-password -> PermitRootLogin no
Restart ssh daemon
sudo service ssh restart
----------------------------------------------------------------------
Search for package using command line:
apt-cache search *
----------------------------------------------------------------------
(WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
sudo apt-get install xfonts-cyrillic
sudo apt-get install xfonts-100dpi
sudo apt-get install xfonts-75dpi
----------------------------------------------------------------------
Stop X-server
for UBUNTU 14.04 or higher
sudo service lightdm stop
for UBUNTU 14.04 or higher
sudo service gdm stop
----------------------------------------------------------------------
Redirect output in bash
foo > stdout.txt 2> stderr.txt
or
foo 1> stdout.txt 2> stderr.txt
or both in the same file
foo > allout.txt 2>&1
to append output to file use >> instead of >
redirect stderr to stdout, then print combined streams and save them
to out.log
2>&1 | tee out.log
----------------------------------------------------------------------
Grafisches Frontend um .deb Pakte zu installieren: gdebi
(ansonsten mit: sudo dpkg -i Paketnname.deb
----------------------------------------------------------------------
Adobe Reader acroread: Text in inaktiven Tabs nicht
lesbar. Hintergrund hat die gleich Farbe wie der Text
Ambiance theme:
cd /usr/share/themes/Ambiance/gtk-2.0
sudo gedit gtkrc
>>>change fg_color from #4c4c4c to #000000
Radiance theme:
cd /usr/share/themes/Radiance/gtk-2.0
sudo gedit gtkrc
>>>change fg_color from #4c4c4c to #000000
----------------------------------------------------------------------
Konvertieren von Videos/Movies in fuer Microsoft Powerpoint 64-bit
passendes Format mittels Kommando: avconv, Output Dateiname: avi,
Codec: msmpeg4
avconv -c msmpeg
----------------------------------------------------------------------
kill PID = kill-15 PID
more powerful kill signal:
kill -9 PID
or
kill -SIGKILL PID
----------------------------------------------------------------------
Inormation about GPUs
nvidia-smi -l
----------------------------------------------------------------------
Admin / root / sudo Rechte wiederherstellen
Im recovery mode starten, root shell ausfuehren
Schreibschutz entfernen: mount -o remount,rw /
USER der Gruppe sudo hinzufuegen: adduser USER sudo
----------------------------------------------------------------------
Grafikkarte ermitteln
lspci -nnk | grep -i VGA -A2
----------------------------------------------------------------------
Rechnernamen aendern
Diese Änderungen sollte man in einer Rootshell oder im Recovery Modus
vollziehen, da sonst das Risiko besteht, dass man sich aus dem Rechner
aussperrt.
Der Rechnername muss in zwei Dateien geändert werden. Die Änderungen
kann man mit jedem beliebigen Editor ausführen.
Zum einen muss die Datei /etc/hostname angepasst werden:
meinrechnername
Zum anderen muss die Datei /etc/hosts geändert werden:
127.0.0.1 localhost
127.0.1.1 meinrechnername
...
Danach kann der Rechnername mittels des Befehls
sudo hostname -F /etc/hostname
gesetzt werden.
----------------------------------------------------------------------
Rootshell
sudo -i
exit
----------------------------------------------------------------------
NOTE ON RECUSRSIVELY COPYING HIDDEN FILES
Do NOT copy files within a directory using an asterisk:
cp -r DIR1/* DIR2
The asterisk won't match hidden files starting with "."
Instead simply use the command without any asterisk:
cp -r DIR1 DIR2
----------------------------------------------------------------------
SSH port forwarding (ssh tunnel)
moosmann@iss-moosmann:~$ ssh -f -L 12345:anka-nc-gpu1:22 anka8.fzk.de -p24 -N
moosmann@iss-moosmann:~$ ssh -p12345 hp9361@localhost
Eine ssh Verbindung wird mit anka8,port 24 aufgebaut. Der lokale
Laptop port 12345 (-L 12345) wird dann uber anka8,port 24 auf
anka-nc-gpu1,port 22 gemappt. D.h. anka-nc-gpu1 ist über den lokalen
Port 12345 ansprechbar. D.h. weiterhin das man sich auf anka-nc-gpu1
einloggt über den lokalen Port 12345 aber mit entsprechendem
Nutzernamen: ssh -p12345 hp9361@localhost.
-N
Do not execute a remote command. This is useful for just forwarding
ports (protocol version 2 only).
-L [bind_address:]port:host:hostport
Specifies that the given port on the local (client) host is to be
forwarded to the given host and port on the remote side. This works by
allocating a socket to listen to port on the local side, optionally
bound to the specified bind_address. Whenever a connection is made to
this port, the connection is forwarded over the secure channel, and a
connection is made to host port hostport from the remote machine.
----------------------------------------------------------------------
Environment Variable
Display Environment Variable
$ set
$ printenv
$ env
Change or Set Environment Variable
You can use the following command to change the environment variable
for the current session as per your shell.
For Korn shell (KSH)
var=value
export var
To set JAVA_PATH, enter:
JAVA_PATH=/opt/jdk/bin
export JAVA_PATH
For Bourne shell (sh and bash)
export var=value
To set PATH, enter:
export PATH=$PATH:/opt/bin:/usr/local/bin:$HOME/bin
----------------------------------------------------------------------
/dev/shm
Introduction:
/dev/shm is nothing but implementation of traditional shared memory concept. It is an efficient means of passing data between programs. One program will create a memory portion, which other processes (if permitted) can access. This will result into speeding up things on Linux. shm / shmfs is also known as tmpfs, which is a common name for a temporary file storage facility on many Unix-like operating systems. It is intended to appear as a mounted file system, but one which uses virtual memory instead of a persistent storage device. If you type mount command you will see /dev/shm as a tempfs file system. Therefore, it is a file system, which keeps all files in virtual memory. Everything in tmpfs is temporary in the sense that no files will be created on your hard drive. If you unmount a tmpfs instance, everything stored therein is lost. By default almost all Linux distros configured to use /dev/shm.
----------------------------------------------------------------------
Reverting Guake terminal tab names back to 'Terminal #'
easiest way not to use vte prompt as tab names is to use the
`gconf-editor`:
gconftool-2 --set /apps/guake/general/use_vte_titles --type boolean false
----------------------------------------------------------------------
obere Leiste fehlt
unity --reset
unity --replace
----------------------------------------------------------------------
Open images from command line
xdg-open IMAGE
eog -f IMAGE
gnome-open IMAGE
fbi (http://linux.bytesex.org/fbida/)
Open videos form command line (even virtual console)
mplayer
----------------------------------------------------------------------
cal, ncal — displays a calendar and the date of Easter
----------------------------------------------------------------------
find
find Startverzeichnis [Optionen] Test Aktion
Beispiele:
find / -name "[Xx]*"
find / -name "*.txt" -size +12000c
findet also alle Dateien des gesamten Verzeichnisbaums, die auf .txt
enden und größer als 12000 Byte sind
find / -nouser -exec rm {} \;
Nach der Aktion -exec folgt also der normale Programmaufruf für rm.
Statt einer Datei existiert der Platzhalter „{}“ (zwei geschweifte
Klammern). Dieser steht für alle Dateien, die find findet.
Abgeschlossen werden muss der Befehl mit \; (Backslash, Semikolon).
find / -nouser -exec rm {} +
Das find-Kommando sammelt dabei solange Dateinamen bis die
Längenbegrenzung für die Argumentliste erreicht ist. Das Leerzeichen,
das Zeilenende und ähnliche Zeichen in Dateinamen werden dabei korrekt
an das Programm rm übergeben.
----------------------------------------------------------------------
tar: erstellen, entpacken, ansehen
Archive mit Inhalt von /etc und /home erstellen:
tar cvf test.tar /etc/ /home/
tar cvf - /etc /home | gzip > test.tar.gz
tar czvf test.tar.gz /etc/ /home/ # *GNU tar* Kurzform
tar -czvf test.tar.gz /etc/ /home/ # *GNU tar* Alternative
Archive entpacken:
tar xvf test.tar
gunzip < test.tar.gz | tar xvf -
tar xzvf test.tar.gz # *GNU tar* Kurzform
tar -xzvf test.tar.gz # *GNU tar* Alternative
Archivinhalt ansehen:
tar tvf test.tar
gunzip < test.tar.gz | tar tf -
tar tzvf test.tar.gz # *GNU tar* Kurzform
tar -tzvf test.tar.gz # *GNU tar* Alternative
----------------------------------------------------------------------
Find Number of CPU Cores Command
nproc
lscpu
less /proc/cpuinfo
----------------------------------------------------------------------
Paketquellen im Terminal hinzufuegen
sudo add-apt-repository 'deb PFAD/ZUR/QUELLE DISTRIBUTION KOMPONENTEN'
also z.B.:
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu precise main restricted universe multiverse'
Danach müssen die Quellen immer mittels des Befehls apt-get update
aktualisiert werden, erst dann können Pakete aus der neuen Quelle
hinzugefügt werden.
Gegebenenfalls muss noch ein Schlüssel zur Authentifizierung der
Quelle hinzugefügt werden.
----------------------------------------------------------------------
ps
report a snapshot of the current processes. To see every process on
the system using standard syntax:
ps -e
Display user-oriented format:
SHOW ABSOLUTE COMMAND PATHS PLUS PARAMETERS. It also causes the
command arguments to be printed (like -f). ps u
----------------------------------------------------------------------
psgrep
find distinct process in processes list
alias psgrep='ps -eo pid,user,ni,%cpu,%mem,time,etime,start,comm,cmd | grep -e PID -e'
psgrep COMMAND
----------------------------------------------------------------------
cron
crontab - maintain crontab files for individual users
crontab [-u user] [-l | -r | -e] file
The -e option is used to edit the current crontab using the editor
specified by the VISUAL or EDITOR environment variables. After you
exit from the editor, the modified crontab will be installed
automatically.