User:Der harm
Gnome3 Desktop System
This article describes the process to setup a complete gnome 3 desktop system on my notebook Benq S73u. Hardware details are listed at the bottom of this page.
Base installation
Follow these instructions to set up your system: Beginners'_Guide
You can skip the last chapter 5 Extras: Beginners'_Guide#Extras
What I did in short:
# reboot
after base installation
# pacman -Syy # pacman-db-upgrade
# cd /etc/pacman.d/ # cp mirrorlist mirrorlist.backup
Edit mirrorlist.backup and uncomment all mirrors on the same continent or within geographical proximity to test with rankmirrors.
# nano mirrorlist.backup # rankmirror -n 6 mirrorlist.backup > mirrorlist # pacman -Syy # pacman -Syu
Add a user for your system
# useradd -m -g users -G audio,lp,optical,storage,video,wheel,games,power,scanner -s /bin/bash archie # passwd archie
Install desktop
Sound
I did NOT intall ALSA, as it is included with the kernel and it is recommended to try it first.
Xorg
# pacman -S xorg-server xorg-xinit xorg-utils xorg-server-utils
I think we don't need it for gnome-shell, but for completeness....
# pacman -S mesa
for 3D support and
# pacman -S mesa-demos
the 3D utilities glxgears and glxinfo which are included in the mesa-demos package.
If you have an intel graphics chip do
# pacman -S xf86-video-intel
otherwise follow these instructions
Install keybord and mouse driver and the synaptics driver, if you do have a touchpad
# pacman -S xf86-input-keyboard xf86-input-mouse # pacman -S xf86-input-synaptics
Message bus system that provides an easy way for inter-process communication:
# pacman -S dbus
To start automatically on boot, you should add dbus to your DAEMONS array in /etc/rc.conf:
DAEMONS=(syslog-ng dbus network crond)
dbus should be started as soon as possible.
Gnome3
Installation
Recommended to be installed previously:
# pacman -S ttf-dejavu
As gnome3 is still in testing (or already:-p), the repository has to be activated:
# nano /etc/pacman.conf
and change
#[testing] #Include = /etc/pacman.d/mirrorlist
to
[testing] Include = /etc/pacman.d/mirrorlist
# pacman -Syy
do NOT do an upgrade (-u) to prevent an (maybe) unstable system.
# pacman -S testing/gnome # pacman -S testing/gnome-extra
for further applications and configuration tools. Don't miss the leading testing/!! Actualy I don't know the reason, but thats what the gnome3-Wiki page says.
# pacman -S gdm # pacman -S gnome-tweak-tool # pacman -S telepathy
For these I did not add a leading testing/, but I have no problems. Can anyone explaine this?
To start gnome3 automatically on boot, you should add gdm to your DAEMONS array in /etc/rc.conf:
DAEMONS=(syslog-ng dbus network crond gdm)
Also put the fuse kernel module to the MODULES array in /etc/rc.conf so they will load at boot up, e.g.:
MODULES=(fuse)
The Gnome3 installation is finished and we don't need the testing repository anymore.
# nano /etc/pacman.conf
and change
[testing] Include = /etc/pacman.d/mirrorlist
to
# [testing] # Include = /etc/pacman.d/mirrorlist
Gnome 3 tweaks
gnome-session-properties gnome-tweak-tool dconf-editor
WLAN
For WLAN support from within Gnome 3 install (NetworkManager):
# pacman -S network-manager-applet
Now add the networkmanager daemon in your /etc/rc.conf AND deactivate the network daemon
DAEMONS=(syslog-ng dbus !network crond gdm networkmanager)
If you had hal daemon installed, hal had to be started before networkmanager. The german wiki site says hal needs to be installed. I can't confirm that... To expand user rights do
# gpasswd -a USERNAME network
to grant a user the privilege to use the networkmanager.
Restart (reboot!! :-p) your system
# reboot
If everything went fine you shoult now see a login screen.
Further apps
HAL
In many instructions you see the installation of hal. But for me everything works just fine without it, as it is deprecated in favour of udev.
AUR with yaourt
To have nice access to the Arch User Repository (AUR) install yaourt (Yaourt)
# pacman -S base-devel
for yaourt add
[archlinuxfr] Server = http://repo.archlinux.fr/$arch
to your /etc/pacman.conf do a
# pacman -Sy yaourt
or
# pacman -Sy and # pacman -S yaourt
to sync the AUR repository do
# yaourt -Sya
NTFS support
To support Microsoft NTFS partitions do
# pacman -S ntfs-3g
Compression
# pacman -S zip unzip unrar
The complete rar for compression is in aur, but I don't use it
Internet & multimedia & codecs
# pacman -S firefox thunderbird libreoffice gimp shotwell flashplugin totem-plugin # pacman -S banshee vlc mplayer
Codecs
# pacman -S gstreamer0.10-{base,good,bad,ugly}-plugins # pacman -S gstreamer0.10-ffmpeg
I think the last one is the important one for ac3!? But anyway installing all gstreamer packages shouldn't be a bad idea... For futher details see this page.
DVDs
To play DVDs you need
# pacman -S libdvdread libdvdnav libdvdcss
The first two libraries should be installed by now. The important one is libdvdcss to be able to read encrypted DVDs.
Also make sure to be in the optical group to be allowed to to use the dvd device. Otherwise do
# gpasswd -a USERNAME optical
For ac3/DTS output see User:Der_harm#Sound_.2F_Audio.
Mounten einer ISO
modprobe loop mount -o loop name.iso /media/iso/
Gnome Zeitgeist
Gnome Zeitgeist tracs your activities to help finding documents etc. based on time and other factors that might help you remembering like music you listened to or your location while working on a document. The functionality can be expand through extensions.
Zeitgeist base
# pacman -S zeitgeist # yaourt zeitgeist-datahub # yaourt zeitgeist-datasources
Zeitgeist GUI
# yaourt -S gnome-activity-journal (a GUI for Zeitgeist called Tagebuch (maybe "diary" on english desktops??)
Stuff
Mircosoft fonts might be needed for some apps:
# yaourt -S ttf-ms-fonts
Sound / Audio
Getting dolby digital pass-trough running was not an easy task. I started installing different codecs and finally found out that it was more an ALSA or pulseaudio problem, than anything else. Actually I don't no for sure what your are supposed to do, but this is what I did...:
Sound server
As we have installed Gnome 3, the pulseaudio sound server should be properly set up. The follwing packages are already installed:
pulseaudio, libpulse, pulseaudio-alsa, alsa-plugins, alsa-lib
Pulseaudio needs the dbus daemon to be started, so make sure it is in the /etc/rc.conf.
Background: Pulseaudio and ALSA both are sound server. Gnome decided to use pulseaudio, but as some applications do not support it, alsa is installed as fallback as well.
ac3 / DTS / Pass-Through
To play dolby digital movies (ac3) without encoding, as the encoded ac3 stream is already included in the movie, you have to acivate pass-through. Also you have to use alsa as soud server.
The purpose of the pulseaudio sound server is to be a abstraction layer for different applications and to mix their audio output.
Here a link for hdmi output (haven't tried yet, but might be usefull): http://www.loggn.de/arch-linux-sound-uber-hdmi-alsa-utils-alsa-oss-aplay-alsa-conf/
MPlayer
A good and basic media player is mplayer
# pacman -S mplayer
https://wiki.archlinux.org/index.php/DVD_Playing
To play a movie do
# mplayer -fs -ao alsa -ac hwac3 a_nice_movie.XviD.CD1.avi # mplayer -fs -ao alsa -ac hwac3 dvd:// # mplayer -fs -ao alsa -ac hwac3 /dev/sr0 # mplayer -fs -ao alsa -ac hwac3 -mouse-movements -nocache dvdnav://
DVB-T
# mplayer /dev/dvb/adapter0/dvr0
-fs for fullscreen -ao to specifie the audio output device/server? -ac audio coding/channel?? -dvd://N play a selected chapter on the dvd -dvdnav:// makes the DVD menu usable (with keyboard) -mouse-movements to navigate through the dvd menu with mouse -dvd-device to use /dev/sr0 instead of /dev/dvd, which is the default device
VLC
Also a very good media player is VLC
# pacman -S vlc
For ac3 pass-through and usage of alsa go to
Extras -> Preferences -> Audio -> Output module: ALSA-Audio output -> and check S/PDIF usage if available
Problems
Eventually DTS output does not work. In this case pulseaudio probably occupies the sound device. One trick could be
System preferences -> Sound -> Hardware -> Profile: off or analog output
But this has to be verified...
harm@ArchLinux ~/Movies % mplayer -ao alsa -ac hwac3 a_nice_movie.XviD.CD1.avi MPlayer SVN-r33159-4.5.2 (C) 2000-2011 MPlayer Team 162 audio & 359 video codecs mplayer: could not connect to socket mplayer: No such file or directory Failed to open LIRC support. You will not be able to use your remote control. Playing a_nice_movie.XviD.CD1.avi. AVI file format detected. [aviheader] Video stream found, -vid 0 [aviheader] Audio stream found, -aid 1 VIDEO: [XVID] 656x272 12bpp 25.000 fps 921.3 kbps (112.5 kbyte/s) Clip info: Software: VirtualDubMod 1.5.10.2 (build 2540/release) Load subtitles in ./ Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory [vdpau] Error when calling vdp_device_create_x11: 1 ========================================================================== Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family Unsupported PixelFormat 61 Unsupported PixelFormat 53 Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4) ========================================================================== ========================================================================== Forced audio codec: hwac3 Opening audio decoder: [hwac3] AC3/DTS pass-through S/PDIF hwac3: switched to AC3, 384000 bps, 48000 Hz AUDIO: 48000 Hz, 2 ch, ac3be, 384.0 kbit/25.00% (ratio: 48000->192000) Selected audio codec: [hwac3] afm: hwac3 (AC3 through S/PDIF) ========================================================================== [AO_ALSA] Format ac3be is not supported by hardware, trying default. AO: [alsa] 48000Hz 2ch ac3le (2 bytes per sample) Starting playback... Movie-Aspect is 2.41:1 - prescaling to correct movie aspect. VO: [xv] 656x272 => 656x272 Planar YV12 A: 3.4 V: 3.4 A-V: 0.000 ct: -0.024 85/ 85 7% 0% 0.1% 0 0 Exiting... (Quit) harm@ArchLinux ~/Movies %
Power management
CPU Frequency Scaling
To safe battery life you can activate CPU Frequency Scaling. With
# watch grep \"cpu MHz\" /proc/cpuinfo
you can watch the current behave of your CPU.
# cat /proc/cpuinfo
or
# cpufreq-info
show further details.
For CPU frequency scaling install
# pacman -S cpufrequtils
and on startup load CPU frequency driver from /etc/rc.conf
MODULES=( acpi-cpufreq )
Most modern notebooks and desktops can simply use the acpi-cpufreq driver. However, other options include the p4-clockmod, powernow-k8, and speedstep-centrino drivers.
After a reboot or manually loading the driver with
# modprobe acpi_cpufreq
your can do
# cpufreq-info
for detailed information about the CPU(s).
To simply see which governors are available:
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
Performance should be available by default, so add ondemand and powersave
MODULES=( acpi-cpufreq cpufreq_ondemand cpufreq_powersave )
To see a full list of available drivers, run the following:
# ls /lib/modules/2.6.??-ARCH/kernel/drivers/cpufreq
Use
# cpufreq-set -g ondemand
to choose a govenor, which is set to default after a restart. Add -c 0 or -c 1 to specifie the CPU Number. To change the default settings go to /etc/conf.d/cpufreq and change
# governor="ondemand"
to
governor="ondemand"
Finally start CPUfreq as daemon (in background):
DAEMONS=( @cpufreq )
Laptop Mode Tools
If you are already using or plan to use Laptop Mode Tools for other power saving solutions, you may want to let it manage also CPU frequency scaling. Therefore remove the govenors again to have only:
MODULES=( acpi-cpufreq )
To install do
# pacman -S laptop-mode-tools
and put the daemon in the /etc/rc.conf:
DAEMONS=( laptop-mode )
The big part is to work yourself through the configuration. I might do that later...
Laptop-init-script
# pacman -S laptop-init-script
do I need this??
Suspend & Hibernate
See Acpid and Pm-utils for details.
Install Pm-utils
# pacman -S pm-utils
for hibernate & suspend. acpid does provide basic capability for this, but pm-utils provides a more robust system and a very flexible framework by its scripts pm-suspend and pm-hibernate.
But you might need acpid anyway to change button settings in conjunction with Pm-utils. For me hibernate & suspend works without the need to install acpid (and to start its daemon), but you might need it to get your keybourd buttons working, which trigger acpi events.
In that case do
# pacman -S acpid
and add the daemon acpid to your /etc/rc.conf:
DAEMONS=( @acpid )
To support hibernate the RAM has to be written into the swap-file, which has to be big enough. See Pm-utils#Basic_Configuration
As root type
# blkid
to get the uuid of your swap partition (you can also use something like /dev/sda2). To your /boot/grub/menu.lst add resume=/path/to/swap/drive:
# (0) Arch Linux title Arch Linux root (hd0,0) kernel /vmlinuz26 root=/dev/disk/by-uuid/818dc030-8108-4428-8859-b73a58d0b0f3 resume=/dev/disk/by-uuid/1d893194-b151-43cd-a89e-6f89bd8b9f99 ro initrd /kernel26.img
I also had to add a hook to the /etc/mkinitcpio.conf
HOOKS="base udev autodetect ide scsi sata lvm2 resume filesystems "
resume must be placed after 'ide', 'scsi', 'sata' and/or 'lvm2', but before 'filesystems'.
Finally do
# mkinitcpio -p kernel26
Make sure you are member of the power group:
# id
If not, type
# gpasswd -a USERNAME power
Magic SysRQ Key
In /etc/sysctl.conf change 0 to 1
# Enable the magic-sysrq key kernel.sysrq = 1
"raising skinny elephants is utterly boring"
Auto-reboot after kernel panic
In /etc/sysctl.conf add
# reboot on kernel panic kernel.panic = 20
For logging use netcat:
nc -u -l -p 6969 modprobe netconsole netconsole=@/,@/ modprobe netconsole netconsole=6969@192.168.0.2/eth0,6969@192.168.0.3/00:01:02:03:04:05
Also google "watchdog"...
HDD Speed
Hdparm is a performance tool for your hard disk. It can be used to spin down the speed and safe power as well as reduce noice The laptop mode tool uses it and does its configuration. But if you don't use lmt you can use it manually.
# pacman -S hdparm
Do
# hdparm -I /dev/sda
for disk details and
# hdparm -B 128 /dev/sda
to set the level for power management. You can set any value between 1 (high power management, but very many spin ups/downs) and 254 (low power management)
# hdparm -S xxx /dev/sda
Questions
Q: What would I need acpi for? See Gnome3_Desktop_System#Suspend_.26_Hibernate
Q: Difference between hdparm -S and -B?
Q: How to enable ac3 through spdif?
Q: How to start Zeitgeist? It needs to be started with user rights, to trac user specific activities.
Q: Why do I need to specify [testing] for Gnome3 installation?
A: Because (as of 12 April 2011) Gnome in extra is version 2.3 and Gnome3 is in [testing]. Pacman picks the package from the first available repo and [testing] is the first one by default in pacman.conf. You can use 'testing/gnome' just in case you have put another repo before [testing].
If you want to install package foo specifically from [bar] repo, use 'pacman -S bar/foo'.
Hardware of the Benq S73u
lspci
harm@ArchLinux ~ % lspci 00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express Memory Controller Hub (rev 03) 00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03) 00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03) 00:1b.0 Audio device: Intel Corporation N10/ICH 7 Family High Definition Audio Controller (rev 02) 00:1c.0 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 1 (rev 02) 00:1c.1 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 2 (rev 02) 00:1c.2 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 3 (rev 02) 00:1c.3 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 4 (rev 02) 00:1d.0 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #1 (rev 02) 00:1d.1 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #2 (rev 02) 00:1d.2 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #3 (rev 02) 00:1d.3 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #4 (rev 02) 00:1d.7 USB Controller: Intel Corporation N10/ICH 7 Family USB2 EHCI Controller (rev 02) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2) 00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02) 00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Controller (rev 02) 00:1f.3 SMBus: Intel Corporation N10/ICH 7 Family SMBus Controller (rev 02) 02:00.0 Ethernet controller: Atheros Communications Inc. AR5001 Wireless Network Adapter (rev 01) 04:00.0 Ethernet controller: Broadcom Corporation NetLink BCM5789 Gigabit Ethernet PCI Express (rev 21) 05:05.0 CardBus bridge: Texas Instruments PCIxx12 Cardbus Controller 05:05.1 FireWire (IEEE 1394): Texas Instruments PCIxx12 OHCI Compliant IEEE 1394 Host Controller 05:05.2 Mass storage controller: Texas Instruments 5-in-1 Multimedia Card Reader (SD/MMC/MS/MS PRO/xD) 05:05.3 SD Host controller: Texas Instruments PCIxx12 SDA Standard Compliant SD Host Controller harm@ArchLinux ~ %
OpenCV
Install webcam
My Hercules Dualpix HD works out of the box.
# lsusb
prints
harm@ArchLinux ~ % lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 002 Device 002: ID 045e:071d Microsoft Corp. Bus 001 Device 003: ID 06f8:3003 Guillemot Corp. harm@ArchLinux ~ %
and
# dmesg | tails
prints
[61978.400709] usb 1-3: new high speed USB device using ehci_hcd and address 4 [61978.526712] gspca: probing 06f8:3003 [61978.644583] ov534_9: Sensor ID: 9657 [61978.813257] gspca: video0 created [61978.815228] 4:2:1: cannot get freq at ep 0x84 [61978.925705] 4:2:1: cannot get freq at ep 0x84 [61978.930453] 4:2:1: cannot get freq at ep 0x84 harm@ArchLinux ~ %
# lsmod | grep gspca
prints
gspca_ov534_9 8216 0 gspca_main 20886 1 gspca_ov534_9 videodev 56207 1 gspca_main usbcore 113751 8 snd_usb_audio,snd_usbmidi_lib,usbhid,gspca_ov534_9,gspca_main,uhci_hcd,ehci_hcd
My webcam uses the gspca_main driver, which is included in the kernel. It loads the gspca_ov534_9 subdriver module and recognizes the sensor id 9657. Its id is 06f8:3003 Guillemot Corp.
Problems
Using gnome Cheese to use the webcam I get a black and white video, so I do further research:
# lsusb -d 06f8:3003 -v
Output:
Bus 001 Device 003: ID 06f8:3003 Guillemot Corp. libusb couldn't open USB device /dev/bus/usb/001/003: Permission denied. libusb requires write access to USB device nodes. Couldn't open device, some information will be missing
OK, as super user it seems to work...
# lsusb -d 06f8:3003 -v
Bus 001 Device 003: ID 06f8:3003 Guillemot Corp. Device Descriptor: bLength 18 . . .
Setup OpenCV
# pacman -S opencv
Optionale Abhängigkeiten für opencv
eigen python2-numpy
Setup OpenTLD
Octave
Requirements to build octave-hg
# yaourt -S gnuplot epstool pstoedit # yaourt -S tansfig as fig2dev is required an included in transfig
Then
# yaourt -S octave-hg for version >3.4 # yaourt -S octave-miscellaneous octave-image octave-statistics
Then download openTLD from https://github.com/bilderbuchi/OpenTLD
Matlab
Initially openTLD is built for matlab using this source: https://github.com/zk00006/OpenTLD To install Matlab
# modprobe loop # mount -o loop ml2011a.iso /media/iso/ # /media/iso/install
Also install
# yaourt -S gcc43
which installs gcc-4.3 and g++-4.3.
To configure matlab using gcc-4.3 instead of the latest one I found two solutions:
http://whowhywhathow.blogspot.com/2011_01_01_archive.html https://bbs.archlinux.org/viewtopic.php?id=86809
I have tryed the first solution first as it seemed to be the easiest solution.
Run
#./usr/local/MATLAB/R2011a/bin/mex -setup press 2)
and as su change all occurences of
CC='gcc' to CC='gcc-4.3' CXX='g++' to CXX='g++-4.3'
in
# gedit ~/.matlab/R2011a/mexopts.sh
But I did end up with errors when running run_TLD.m (had no problems wiht compile.m) so I tried the second solution too - successfully:
# mv /usr/local/MATLAB/R2011a/sys/os/glnx86/libgcc_s.so.1 /usr/local/MATLAB/R2011a/sys/os/glnx86/libgcc_s.so.1_bak
# mv /usr/local/MATLAB/R2011a/sys/os/glnx86/libstdc++.so.6 /usr/local/MATLAB/R2011a/sys/os/glnx86/libstdc++.so.6_bak # mv /usr/local/MATLAB/R2011a/sys/os/glnx86/libstdc++.so.6.0.10 /usr/local/MATLAB/R2011a/sys/os/glnx86/libstdc++.so.6.0.10_bak
To prevent following warning (don't know wether it is a problem)
??? Invalid MEX-file 'xxx.mexa64': libraw1394.so.8: cannot open shared object file: No such file or directory.
do
# mv glnx86/libdc1394.so.22 glnx86/libdc1394.so.22_bak # mv glnx86/libdc1394.so.22.1.0 glnx86/libdc1394.so.22.1.0_bak
Matlab with video input
Matlab can't use my webcam out of the box.
Start matlab
# /usr/local/MATLAB/R2011a/bin/matlab
and run inside matlab:
>> imaqhwinfo
I get following output:
ans = InstalledAdaptors: {'dcam' 'linuxvideo'} MATLABVersion: '7.12 (R2011a)' ToolboxName: 'Image Acquisition Toolbox' ToolboxVersion: '4.1 (R2011a)'
Specifieing the adoptors I get
>> imaqhwinfo('linuxvideo') ans = AdaptorDllName: '/usr/local/MATLAB/R2011a/toolbox/imaq/imaqadaptors/glnx86/mwlinuxvideoimaq.so' AdaptorDllVersion: '4.1 (R2011a)' AdaptorName: 'linuxvideo' DeviceIDs: {1x0 cell} DeviceInfo: [1x0 struct]
and
>> imaqhwinfo('dcam') ans = AdaptorDllName: '/usr/local/MATLAB/R2011a/toolbox/imaq/imaqadaptors/glnx86/mwdcamimaq.so' AdaptorDllVersion: '4.1 (R2011a)' AdaptorName: 'dcam' DeviceIDs: {1x0 cell} DeviceInfo: [1x0 struct]
Trying to use one of the adoptors I get following error:
>> vid = videoinput('linuxvideo', 1); ??? Error using ==> videoinput.videoinput at 238 There are no devices installed for the specified ADAPTORNAME. See IMAQHWINFO.
Matlab webcam solution
The trick is to start matlab by preloading v4l2convert.so.
# LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so /usr/local/MATLAB/R2011a/bin/matlab
or do
# export LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so # /usr/local/MATLAB/R2011a/bin/matlab
Once you have closed the terminal you have to run the export command again or you put it in your /etc/profile to make it permanent.
Now try
>> vid = videoinput('linuxvideo', 1);
again. Also try
>> imaqtool
On the left the webcam shows up now.
Config
Extract the openTLD source file and
# cd openTLD
into it.
As on ArchLinux openTLD not got installed in /usr/local/lib/ but in /usr/lib/ respectively not in /usr/local/include/ but in /usr/include/, the file compile.m has to be changed in the last section isunix three times (include & libpath).
Then run
# octave compile.m
to check for any errors. Now run
# octave run_TLD.m
to watch an example tracking a motorbike.
further libraries for openCV
http://pyopencv.googlecode.com/
http://code.google.com/p/ehci/wiki/HandTracking
http://www.movesinstitute.org/~kolsch/HandVu/HandVu.html
And a nice tutorial:
http://www.linuxconfig.org/introduction-to-computer-vision-with-opencv-on-linux
Eclipse & Android & couchdb
# pacman -S eclipse eclipse-emf eclipse-gef
And some trouble shooting
since gnome3 the webkit library name changed from libwebkit-1.0.so to libwebkitgtk-1.0.so, so I did # cd /usr/lib # ln -s libwebkitgtk-1.0.so libwebkit-1.0.so.2 and -Dorg.eclipse.swt.browser.UseWebKitGTK=true works again
Android:
# yaourt -S android-sdk
which also pulls
eclipse-wtp-wst and eclipse-android
# yaourt -S android-sdk-platform-tools
Eclipse -> Windows -> Preferences -> Android
/opt/android-sdk
Now use the Android SDK and AVD Manager to download further available packages. As su (to have write previleges for /opt/android-sdk) type
android
Then in eclipse create a virtual device.
To connect the Samsung Galaxy S 9000 create the following udev rules:
SUBSYSTEM=="usb", SYSFS{idVendor}=="[VENDOR ID]", MODE="0666" SUBSYSTEM=="usb",ATTR{idVendor}=="[VENDOR ID]",ATTR{idProduct}=="[PRODUCT ID]",SYMLINK+="android_adb" SUBSYSTEM=="usb",ATTR{idVendor}=="[VENDOR ID]",ATTR{idProduct}=="[PRODUCT ID]",SYMLINK+="android_fastboot"
# lsusb Bus 001 Device 002: ID 04e8:681c Samsung Electronics Co., Ltd Galaxy Portal/Spica/S
So put in /etc/udev/rules.d/90-android.rules
VENDOR ID : 04e8 PRODUCT ID : 681c
SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666" SUBSYSTEM=="usb",ATTR{idVendor}=="04e8",ATTR{idProduct}=="681c",SYMLINK+="android_adb" SUBSYSTEM=="usb",ATTR{idVendor}=="04e8",ATTR{idProduct}=="681c",SYMLINK+="android_fastboot"
Now reboot or
# udevadm control --reload-rules
Then unplug and replug the phone
# adb devices List of devices attached 10006d2ae909 device
Here is a very nice turorial for android-couchdb development:
http://arandomurl.com/2011/02/13/developing-with-couchdb-on-android.html
Diaspora
# pacman -S nginx # pacman -S mysql this one not, as it can be installed with gem # yaourt -S ruby-thin # yaourt -S diaspora # gem update --system # gem update # gem install rails (to install the ruby on the rails framework) # gem install thin (the application server)
gem is a new command included in ruby 1.9, which is required by diaspora. Use gem in favour of the aur package.
now do
# cp /usr/share/webapps/diaspora/config/app.yml.example /usr/share/webapps/diaspora/config/app.yml # cp /usr/share/webapps/diaspora/config/database.yml.example /usr/share/webapps/diaspora/config/database.yml
# cd /usr/share/webapps/diaspora/config # bundle exec rake db:create # bundle exec rake db:migrate
then change nginx configuration
# nano /etc/nginx/conf/nginx.conf
and change port and root to
listen 3000 root /usr/share/webapps/diaspora/public
Finally do
# /etc/rc.d/nginx start # /etc/rc.d/diaspora start
Commands
# file /usr/local/MATLAB/* # lsof | grep video -> list open files # killall -TERM mplayer # lslk -> list local locks # which BINARY -> print the path of a binary # df -> disk free # du -hs /path/to/folder -> disk usage # top -> running processes # iotop -> input/output per process # w # who
Time synchronization
# ntpdate zeit.fu-berlin.de # ntpd -q # hwclock --systohc
Time conversion
# date --> (CEST; system setting) prints the current date # date --utc --> (UTC)
# date +%s --> (UTC) current time as timestamp in seconds since 1970 # date --utc +%s --> (UTC) the same
# date -d @timestapInSeconds --> (CEST; system setting) converts the time in seconds into the human readable time # date --utc -d @timestapInSeconds --> (UTC) two h earlyer in Germany, from 9 to 7 (summer)
PC auto start by bios
rtcwake http://www.pro-linux.de/kurztipps/2/1488/pc-zeitgesteuert-starten.html
Video DVD
https://wiki.archlinux.org/index.php/FFmpeg
# ffmpeg -i input.AVI -acodec copy -vcodec libx264 -b:v 1200k output.avi
http://en.gentoo-wiki.com/wiki/Mencoder#lavc_Two-Pass_Encoding
# mencoder dvd:// -ovc lavc -lavcopts vpass=1 -oac copy -o movie.avi # mencoder dvd:// -ovc lavc -lavcopts vpass=2 -oac copy -o movie.avi
https://wiki.archlinux.org/index.php/MEncoder http://wiki.ubuntuusers.de/MEncoder#Benutzung
others
# screen -r ... -X quit # in screen: strg+a then shift+S to split screen
# pdfimages book.pdf . -> to extract images from a pdf document in ppm format.
# Potrace - to convert png etc. to eps or svg
ImageMagick to convert pictures to one pdf-File: http://wiki.ubuntuusers.de/ImageMagick#PDF-Bearbeitung
# convert *.jpg ziel.pdf
Processes
# ps aux --sort +rss -> list processes sorted by memory usage (RSS: resident set size, in KB) # ps aux --sort +pcpu -> list processes sorted by cpu usage
# kill -SIGINT PID - does a 'soft' kill
Should be used prior to the next command, as this way the code can still execute its try()-finally() clause...;)
# pstree -sp 1 # kill -9 PID
Pacman
# pacman -Qdt -> to list orphaned packages # pacman -Rs $(pacman -Qtdq) # pacman -Qi PACKAGE | grep Stellt\ bereit -> to verify none package depends on PACKAGE # yaourt -Q --date
# pacman -Qqe > package.list -> Backup the current list of packages on the source machine # pacman -S $(cat package.list) -> Install the packages using the following command
GnuPG
verschlüsseln
# gpg --output doc.gpg --encrypt --recipient blake@cyb.org doc # gpg --compress-algo BZIP2 --bzip2-compress-level 9 --encrypt -a -o text_crypt_wallet.txt wallet.dat -> a für axcii damit es ausgedruckt werden kann;)
löschen
# shred file & rm file -> to safely delete a file
entschlüsseln
# gpg --output doc --decrypt doc.gpg # gpg --decrypt -o wallet.dat scanned_text_file.txt
auch symmetrisch möglich
# gpg --output doc.gpg --symmetric doc # gpg --compress-algo BZIP2 --bzip2-compress-level 9 --symmetric -a -o text_crypt_wallet.txt wallet.dat
Resize partitions
1. Extend the partition 2. Extend the filesystem
# (g)parted or fdisk # fdisk /dev/sdx without 1 or 2 ... # delete the partition and create it again with the desired size # resize2fs /dev/sdxY
Without giving any size, resize2fs extends the filesystem to the partition's size. http://en.positon.org/post/Resize-an-ext3-ext4-partition http://www.howtoforge.com/linux_resizing_ext3_partitions
PCI rescan
# lspci -v | grep VGA
[root@ArchMiner harm]# lspci -v | grep VGA Flags: bus master, VGA palette snoop, 66MHz, medium devsel, latency 64 01:00.0 VGA compatible controller: ATI Technologies Inc Cypress [Radeon HD 5800 Series] (rev ff) (prog-if ff) 02:00.0 VGA compatible controller: ATI Technologies Inc Cypress [Radeon HD 5800 Series] (prog-if 00 [VGA controller]) 05:00.0 VGA compatible controller: ATI Technologies Inc Cypress [Radeon HD 5800 Series] (prog-if 00 [VGA controller]) 06:00.0 VGA compatible controller: ATI Technologies Inc Cypress [Radeon HD 5800 Series] (prog-if 00 [VGA controller]) [root@ArchMiner harm]#
# lspci -tv | grep Radeon
[harm@ArchMiner ~]$ lspci -tv | grep Radeon +-02.0-[01]--+-00.0 ATI Technologies Inc Cypress [Radeon HD 5800 Series] | \-00.1 ATI Technologies Inc Cypress HDMI Audio [Radeon HD 5800 Series] +-04.0-[02]--+-00.0 ATI Technologies Inc Cypress [Radeon HD 5800 Series] | \-00.1 ATI Technologies Inc Cypress HDMI Audio [Radeon HD 5800 Series] +-0b.0-[05]--+-00.0 ATI Technologies Inc Cypress [Radeon HD 5800 Series] | \-00.1 ATI Technologies Inc Cypress HDMI Audio [Radeon HD 5800 Series] +-0d.0-[06]--+-00.0 ATI Technologies Inc Cypress [Radeon HD 5800 Series] | \-00.1 ATI Technologies Inc Cypress HDMI Audio [Radeon HD 5800 Series] [harm@ArchMiner ~]$
# echo 1 > /sys/devices/pci0000\:00/0000\:00\:02.0/0000\:01\:00.0/remove # echo 1 > /sys/devices/pci0000\:00/0000\:00\:04.0/0000\:02\:00.0/remove # echo 1 > /sys/devices/pci0000\:00/0000\:00\:0b.0/0000\:05\:00.0/remove # echo 1 > /sys/devices/pci0000\:00/0000\:00\:0d.0/0000\:06\:00.0/remove
# echo 1 > /sys/bus/pci/rescan # echo 1 > /sys/bus/pci/devices/0000\:02\:00.0/rescan
Bitcoins
# export DISPLAY=:0 # export LD_LIBRARY_PATH=/opt/AMD-APP-SDK-v2.4-lnx64/lib/x86_64/:$LD_LIBRARY_PATH # cd /opt/AMD-APP-SDK-v2.4-lnx64/bin/x86_64 # ./clinfo | grep CL_DEVICE_TYPE_GPU
After updating of amdstream I hat to set a symbolic link:
# ln -s /opt/amdstream/lib/libOpenCL.so.1 /usr/lib/libOpenCL.so.1
/opt/amdstream/lib/libOpenCL.so --> /opt/amdstream/lib/libOpenCL.so.1 /usr/lib/libOpenCL.so --> /opt/amdstream/lib/libOpenCL.so /usr/lib/libOpenCL.so.1 --> /opt/amdstream/lib/libOpenCL.so.1
# cd /opt/miners/phoenix/ # sudo python phoenix.py -u http://login.worker:PWD@api.bitcoin.cz:8332 -k poclbm DEVICE=0 VECTORS BFI_INT AGGRESSION=13 FASTLOOP=false # sudo python phoenix.py -u http://login.worker:PWD@api.bitcoin.cz:8332 -k phatk DEVICE=0 VECTORS BFI_INT AGGRESSION=13 FASTLOOP=false
# sudo python /opt/miners/poclbm/poclbm.py --user=login.worker --pass=PWD --device=0 -o api.bitcoin.cz -p 8332 -v -w128
To display the temperature of your cores:
# aticonfig --odgt --adapter=all
To display the clock speeds of your cores:
# aticonfig --odgc --adapter=all
To show or set your fan speed:
Shows fan speed
# aticonfig --pplib-cmd "get fanspeed 0"
Sets fan speed to 100%
# aticonfig --pplib-cmd "set fanspeed 0 100"
If you have multiple cores, you'll need to export a different display variable to access the different cores, like this:
Show fan speed on 2nd card:
# export DISPLAY=:0.1; aticonfig --pplib-cmd "get fanspeed 0"
You can change the .1 to .2, .3 etc... for how many cards you have in the system.
To change your clock rates:
Set your core clock to 900MHz and your memory clock to 1000MHz on all cards. Change according to your desire.
# aticonfig --od-setclocks=900,1000 --adapter=all
To set for a particular card, change --adapter=all to the adapter number you want to change.