This page is getting obsolete, look here for new updates: Bengts Fedora Linux server with MythTV and more
Detta är en beskrivning av min installation av MythTV på Linux mha av atrpms (numera rpmfusion) repository. Det hela började egentligen med en installation av Red Hat 9 men har sedan dess uppdaterats för Fedora Core 1 till Fedora 20 Dessutom finns beskrivning hur man använder servern som en fil-server, web-server för myth+foto+wiki, ftp-server, svn-server, sync-server etc.
Jag använder mig framförallt av färdigkompilerade paket från rpmfusion för att uppnå mitt mål. Dessutom finns det beskrivningar hur jag fixade så burken också används som fil-server, web-server (myth+fotoalbum+wiki), ftp-server, svn-server mm.
Observera att vissa delar av guiden säkerligen inte stämmer längre efter alla uppdateringar av OS, hårdvara och MythTV. Rent generellt så har saker och ting blivit enklare med tiden.
Bra webblänkar:
Installationen utförds i följande grova steg:
Kolla upp vad du har för hårdvara, speciellt tv-kort, grafikkort och ljudkort. Det gäller att det finns drivrutiner i linux, att det är tyst och att det inte drar onödigt mycket ström. Burken står ju på 24h om dygnet.
Min hårdvara var 20100605 som följer:
Jag har även haft genom åren haft ett Asus P5B moderkort, ett nexus nätagg, ett analogt tv-kort “Hauppauge PVR350”, en DVB-T tuner “Hauppauge Nova-T DVB-T”, ett grafikkort “NVidia Geforce FX5200”, ett moderkort “ASUS P5P800”, en processor “Intel Celeron D 2.67GHz”. Jag har två hårddiskar i systemet som kontinuerligt har uppgraderats för att få mer plats och för att inte köra dom så länge så dom går sönder. Jag har också uppgraderat moderkort/minne/cpu/grafikkort sedan dess för att kunna spela HDTV ok. Tyvärr ligger systemet fortfarande lite på gränsen för riktigt tunga filmer. Hoppas på stöd för flera kärnor i ffmpeg.
För att lyckas få en tyst hårdvara är det viktigt med:
Ofta behöver fläktarna inte snurra så snabbt som man tror. Ofta kan man få dom att snurra snabbare bara om det behövs genom att ställa in det i bios. Om man ställer ner dom mycket så är det dock bra att ha koll på temperaturen med någon monitoreringsmjukvara.
Jag har nyss gjort ett race för att dra lite mindre ström:
Efter alla dessa ändringar så har jag tjänat in ca 100W, från 200W till 96W i idle. Mätt med en effektmätare från clas ohlson.
Vad vore väl en pc utan hårdvarustrul. Här är lite blandad kompott:
Man kan kolla efter delade IRQ:er med “cat /proc/interrupts” och se vilken LNKx som mappas till vilken IRQ med 'dmesg | grep “*”'. Jag tror dock inte att man kan ändra vilka IRQ som ligger på samma LNKx så det gör ingen större nytta för ett kort som inte kan klara av att dela. Mer info: http://tldp.org/HOWTO/Plug-and-Play-HOWTO-7.html
Tyvärr så täcks den första pci-porten (LNKF) som inte delar IRQ av grafikkortet. Den andra pci-porten (LNKG) delar IRQ med det inbyggda ljudkortet och den sista pci-sloten (LNKH) delar med flera usb-controllers. Så det verkar som jag antingen får jag stänga av ljudet på moderkortet och stoppa i ett ljudkort eller stoppa i ett grafikkort som inte täcker första pci-platsen. Det finns två PCIEx16 kontakter men tyvärr är den andra bara x4 så jag vill sätta graffekortet i första platsen. Informationen om vilka portar som ligger på samma LNKx och delar IRQ finns i moderkortsmanualen.
Efter att ha stoppat i mitt gamla ljudkort Nightingale med CMI8738 så har jag stängt av det inbyggda “HDA Intel”-ljudkortet och Nova-T fick en egen IRQ. Dock hängde datorn igen efter detta men på ett lite annorlunda sätt. Då bytte jag tillbaks till mitt 7600GS grafikkort och saker och funkade som dom skulle igen. Efter mycket pillande med “PEG Link Mode” Slow och annat kom jag fram till att jag var tvungen att köra PEG Link Force X1 för att det skall funka stabilt. Det suger ju eftersom PCIe isf då bara går i 1X i en 16X-port så jag flyttade grafikkortet till min andra 16X-port som iaf går i 4X. Där är vi nu, får se om det är stabilt. Det innebär också att ljudkortet fick en ny slot med en egen IRQ.
Tanka ner DVD-ison, bränn och boota. Se till att boota med “linux xfs” för att kunna partionera med ett filsystem bättre för video. Allt enligt guiden. Jag tror att installationen är smidigare under Fedora 7.
Mina val under installationen:
/dev/hda1 /boot 128MB ext3 /dev/hda2 / 20GB ext3 /dev/hda3 swap 1.5GB (RAMx1.5) swap /dev/hda5 /data Resten xfs
GNOME/KDE/LXDE (Desktop Environments) MySQL/ServerConfigTools/WindowsFileServer/WebServer (Servers) SystemTools (Base System) NetworkServers (Network Servers)
Efter omstart med firstboot:
Efter firstboot:
Kopiera gärna lite schyssta filer från install i mitt mythtv-arkiv till samba-sharen och flytta sedan till “root/install”:
# mv /data/in/install /root/install # cd /usr/local/bin # cp /root/install/usr_local_bin/* . # chmod a+x *
Kom ihåg vilka filer det var, dom kan vara intressanta att använda i efterföljande steg.
Nu kan man om man vågar släppa ut ssh genom routern också så man kan greja med sin video från utsidan vid behov med tex putty. Jag öppnade port 22 i routern mot internätet, men lät den vara 666 på utsidan för att göra attacker lite svårare. Sedan ändrade jag i /etc/ssh/sshd_config så root inte får logga in direkt. Man loggar istället in med en annan användare och kör “su -” för att göra root-grejer, lite säkrare. Starta om sshd med “service sshd restart” för att ändringarna skall ta skruv.
After installing fedora it can be nice to setup a vnc-server so you can run remote with for example TightVNC on Windows. To start an extra separate desktop for another user you can:
# yum install tigervnc-server $ su - <user-with-vncdesktop> $ vncserver Enter password and test TightVNC. $ killall Xvnc $ vi .vnc\xstartup # Uncomment two lines for ordinary desktop # cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:1.service # vi /lib/systemd/system/vncserver@:1.service Replace "<USER>" and maybe add " -geometry 1280x768" to ExecStart. # vi /etc/sysconfig/desktop PREFERRED=$(type -p lxsession) # Will use LXDE as default desktop
Now enable and start the configured service:
# systemctl enable vncserver@:1.service # systemctl --system daemon-reload # systemctl start vncserver@:1.service
Test with TightVNC that things work as the should. The syntax is is “host:[display|:port]”. In my case “vncserver@:1.service” means that port 5900+1 is used. This port can then be tunneled using SSH with for example putty. It is therefore enough to enable ssh access outside firewall.
You may need to start “vncconfig” inside the vnc session to enable the clipboard.
There is a lot of good stuff in the rpmfusion repository, including mythtv: http://rpmfusion.org/
Install on F16, upgrade and check out the repo using yumex:
# su -c 'yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm' # yum upgrade # yum install yumex # yumex
Previously I used the atrpms mythtv repo but in Fedora 16 I switched to rpmfusion instead. At the time it was a newer mythtv available in rpmfusion. There has always been some conflicts between rpmfusion and atrpms and I hope for cleaner Fedora upgrades in the future. MythWeb is now located in /usr/share/mythweb, fix .htaccess and data. Had to reinstall the xmltv stuff after “yum remove atrpms atrpms-repo”. After the switch I also needed to fix some things mentioned here:
http://rpmfusion.org/Package/mythtv
Apart from the permissions mentioned there I did “rm -rf /etc/mythtv” and “ln -s /home/mythtv/.mythtv /etc/mythtv” to get theme donwloading to work.
Generally it works better with nvidia cards with VDPAU and mythtv. I'm using the rpmfusion akmod packages to get my nvidia drivers:
# yum install akmod-nvidia kmod-nvidia-PAE nvidia-settings
To trigger akmods compilation manually run “akmods –force” or “service akmods start” and to enable it at boot “chkconfig akmods on”.
You may need to do this before rebooting to avoid a black screen:
# vi /etc/default/grub GRUB_CMDLINE_LINUX="quiet rhgb rdblacklist=nouveau nouveau.modeset=0" # grub2-mkconfig -o /boot/grub2/grub.cfg
Nowadays you can configure things using “nvidia-settings”.
Generally you should save yourself some trouble and use an nvidia card with your mythtv installation. Especially when using fedora with newer Xorg versions for which the proprietary catalyst drivers lags behind with support. You are supposed to be able to use the open-source drivers, but I have never succeeded in getting low fan speeds with these. (Even though they claim it should be possible the fixes never seems to work for me.) Eventually I gave up and replaced my ati card with an nvidia card in the gaming pc as well.
I'm using the rpmfusion akmod packages to get my proprietary ati drivers for my dual boot gaming pc:
# yum install akmod-catalyst xorg-x11-drv-catalyst xorg-x11-drv-catalyst-libs
You can then use aticonfig to do initial configuration from the prompt and then amdcccle from inside X11:
# aticonfig --initial=dual-head --screen-layout=left # amdcccle
You can also do “rm /etc/X11/xorg.conf”, reboot and do all configuration using amdcccle. Note that things like overscan settings are stored in /etc/ati/amdpcsdb.
You may need to prevent the open source drivers to their setup at boot by editing the grub configuration. A “radeon.modeset=0” should be present when running proprietary drivers but NOT for the open source drivers. If you get memory allocation errors in dmesg you will probably want to add vmalloc=256MB to the grub configuration as well.
# vi /etc/default/grub GRUB_CMDLINE_LINUX="radeon.modeset=0 vmalloc=256m" (Removed "quiet rhgb" options as the graphical mode did not seem to work ok with ATI.) # grub2-mkconfig -o /boot/grub2/grub.cfg
Note that you should avoid rendering the mythtv UI with opengl. To be able to go back I used MythWeb settings editor, settings ThemePainter=qt for that frontend. Also note that it is hard to get rid of tearing. Do not use cloning and use opengl for playback in mythtv. However, using opengl will hang X on playback exit.
Good links: http://www.fedoraforum.org/forum/showthread.php?t=155503
Fedora 16 introduces grub 2 as boot manager. You should not edit /boot/grub2/grub.cfg directly, but instead:
# vi /etc/default/grub # grub2-mkconfig -o /boot/grub2/grub.cfg
To boot a specific OS on a dual boot setup you can:
# grep menuentry /boot/grub2/grub.cfg # grub2-set-default "Windows 7 (loader) (on /dev/sda2)" # grub2-editenv list # grub2-mkconfig -o /boot/grub2/grub.cfg
This should work even after updating with a new kernel. I don't think it works though, you may need to update GRUB_DEFAULT/GRUB_SAVEDEFAULT in /etc/default/grub instead. GRUB_DEFAULT=saved and GRUB_SAVEDEFAULT=true is supposed to save the latest booted OS.
If you want to re-install the boot sector, for example after updating Fedora:
# /sbin/grub2-mkconfig -o /boot/grub2/grub.cfg # /sbin/grub2-install --recheck /dev/sda
MythTV kräver en mysql-server på backenden för att fungera.
Förutsatt att mysql är installerat, starta service och fixa rotlösen:
# /sbin/chkconfig mysqld on # service mysqld start # mysql -u root mysql -p mysql> UPDATE user SET Password=PASSWORD('lösenord') WHERE user='root'; mysql> grant all on mythconverg.* to mythtv@"192.168.0.11" identified by "mythtv"; mysql> flush privileges; mysql> quit
Här ingår också att tillåta access från en frontend på 192.168.0.11. Man kan använda % som wildcard i ip-adressen. Efter uppgradering av mysql kan man behöva köra “mysql_fix_privilege_tables” för att rättigheterna skall funka korrekt.
Se till att lägga till mythtv-databasen enligt guide. Du kanske också skall piffa till /etc/my.cnf enligt beskrivning också.
Nowadays you'll need to configure a more secure mail relay. See https://www.flashback.org/t2557029 for bahnhof and https://www.howtoforge.com/tutorial/configure-postfix-to-use-gmail-as-a-mail-relay for gmail.
Use postfix instead of sendmail:
# chkconfig sendmail off # service sendmail stop # yum install postfix mailx system-switch-mail # system-switch-mail Choose postfix. # vi /etc/postfix/sasl_passwd [mailout.privat.bahnhof.se]:465 mbuser:password [smtp.gmail.com]:587 username@gmail.com:password # chmod 600 /etc/postfix/sasl_passwd # postmap /etc/postfix/sasl_passwd # vi /etc/postfix/main.cf myhostname = video.johannes-son.com mydomain = johannes-son.com myorigin = $mydomain relayhost = [mailout.privat.bahnhof.se]:465 smtp_use_tls = yes smtp_sasl_auth_enable = yes smtp_sasl_security_options = smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt mynetworks_style = subnet smtp_tls_wrappermode = yes smtp_tls_security_level = encrypt smtp_tls_loglevel = 1 (Välj relayhost enligt din ISP.) #inet_interfaces = localhost (Att kommentera bort inet_interfaces=localhost gör att den kopplar sig till alla interface. Betyder kanske att man skall se upp med att ha maskinen för publikt.) # service postfix start # chkconfig postfix on
Fixa så root-mail går någonstans:
# vi /etc/aliases root: bj@somewhere.com # newaliases
Follow the guides (obsolete?) http://wilsonet.com/mythtv/fcmyth.php and http://www.mythtv.org/wiki/Installing_MythTV_on_Fedora. Nowadays I use the rpmfusion stuff instead.
All starts with:
# yum install mythtv-suite
Settings worth noting:
pasuspender -- vlc -f
# chgrp -R mythtv /data/videos /data/music # chmod -R g+w /data/videos /data/music
# cd /etc/X11/xinit/xinitrc.d/ # cp /root/install/etc/X11/xinit/xinitrc.d/startmythfrontend.sh . # chmod a+x startmythfrontend.sh
Using apache as a webserver is quite simple:
# yum install httpd # service start httpd # chkconfig httpd start
Configuration can be found in /etc/httpd and html docs in /var/www/html.
Adding new users can be done this way:
# htpasswd /etc/httpd/htpasswd username # For basic authentication # htdigest /etc/httpd/htdigest "In the club?" username # For digest authentication # service httpd restart
To use authentication in a specific directory you can use a file like this in /etc/httpd/conf.d:
<Directory /var/www/html/folder> AllowOverride All # Allows using .htacess-files in html-folder SSLRequireSSL # Require using https for access AuthUserFile /etc/httpd/htdigest # File containing passwords AuthName "In the club?" # Realm SAME as in digest file and presented in login dialog AuthType Digest # Using Digest (better) or Basic authentication Require user user1 user2 # Only allow access for specific users </Directory>
Numera kan nog https://letsencrypt.org ge dig ett riktigt certifikat istf ett självsignerat.
Först bör du generera ett trevligt certifikat för att få apache att prata https lite bättre:
# genkey --days 1000 localhost Svara på frågorna och använd det externa servernamnet, tex bengt.poweruser.org. Alternativt kan man använda fedoras makefil: # cd /etc/pki/tls/certs # rm localhost.crt # make localhost.crt Svara på frågorna... # openssl rsa -in localhost.key -out localhost.key # Remove passphrase # mv localhost.key ../private/ # service httpd restart
Se också till att port 443 går igenom firewallen och sen skall det gå att köra https mot servern. Om du vill veta vad du kan göra mer, som tex att bli en egen certifikatauktoritet så kolla http://www.opengroup.org/messaging/G260/tech11.htm ohch http://httpd.apache.org/docs/2.0/ssl/ssl_howto.html.
Installera subversion och mod_dav_svn:
# smart install mod_dav_svn subversion
Skapa sedan ett repo under /var/www/svn:
# mkdir /var/www/svn # cd /var/www/svn # svnadmin create reponamn # chown -R apache.apache reponamn # chmod g+s reponamn/db
Konfigurera mod_dav_svn, ändra efter behov:
# vi /etc/httpd/conf.d/subversion.conf <Location /svn> DAV svn SVNParentPath /var/www/svn SSLRequireSSL AuthType Basic AuthName "Med i Bengans schyssta SVN-klubb?" AuthUserFile /var/www/passwd Require user bengt </Location> # service httpd restart
Nu skall det gå att accessa server via https://server/svn/reponamn som användare 'bengt' som måste finnas i /var/www/passwd.
Lägg till nya användare med:
# htpasswd /var/www/passwd username
Glöm inte att lägga till dom i /etc/httpd/conf.d/subversion.conf också. Om du vill ha olika rättigheter för olika repos kan du använda “SVNPath” istället för “SVNParentPath” och ha flera “<Location>” sektioner.
I fc12 fick man också strul med subversion och “SSL negotiation failed” om man inte ser till att servernamnet i https-ssl-certifikatet stämmer med ServerName i /etc/httpd/conf/httpd.conf.
Om du vill uppgradera ett befintligt cvs-repo till svn kan du använda cvs2svn:
# smart install cvs2svn # cvs2svn --encoding ISO-8859-1 -s /mnt/data2/svn/QuadFleaz /cvs/QuadFleaz
Mer info finnes här http://www.subversionary.org/howto/setting-up-a-server-on-fedora-core-4
Först provade jag mediawiki som Wikipedia använder. Men jag tog bort igen för att det var inte direkt gjort för att hantera användare och rättigheter. Istället fick det bli dokuwiki http://www.splitbrain.org/projects/dokuwiki som inte ens använder en db och är lätt att sköta.
Så här drar du in dokuwiki:
# cd /var/www/html # wget http://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz # tar xzf dokuwiki-stable.tgz # rm xzf dokuwiki-2014-05-05a # mv xzf dokuwiki-2014-05-05a dokuwiki # chown -R apache.apache dokuwiki # chmod -R og-rwx dokuwiki # chmod -R u-w dokuwiki # cd dokuwiki # chmod -R u+w data conf # vi .htaccess <Directory /var/www/html/dokuwiki> AllowOverride All </Directory>
Lägg till “SSLRequireSSL” för att kräva https mot wikin och avkommentera rewrite-grejerna.
Nu är det dags att göra initialkonfiguration av wikin på https://bengt.poweruser.org/dokuwiki/install.php
Sedan loggar du på som den nyskapade admin-användaren på https://bengt.poweruser.org/dokuwiki/cube?do=admin och slår på nice urls “.htaccess” för url rewrite skall funka. Samt fixar andra inställningar efter behov.
Mer information om säkerhet och rättighet finns här http://wiki.splitbrain.org/wiki:security och här http://wiki.splitbrain.org/wiki:install:permissions
Om man vill kunna se sina foton på webben så är linpha ett utmärkt val. MEN inte nu längre; inga uppdateringar av programvaran och det klarar inte scanna mina panoramabilder och lägger av.
Se till att du har ImageMagick, php, apache och mysql. Tanka ner senaste linpha från: http://www.linpha.org/
Packa sedan upp till /var/www/html/linpha:
# cd /var/www/html # tar xzf /data/in/linpha-1.1.1.tar.gz # mv linpha-1.1.1 linpha # chown -R root:root linpha # cd linpha # chmod 777 sql # yum install php-gd
Konfigurera via webben på http://video/linpha/install/install.php. Följ instruktionerna och glöm inte att ta bort install-foldern när det funkar.
# rm -rf install # rm -rf albums # ln -s /data/pictures albums # vi lang/lang.X.php # Byt ut X mot lämpligt språk $html_charset="UTF-8"; /* Fixa svenska tecken */
Något som känns ganska osäkert är rättigheterna på sql-foldern. Speciellt med tanke på att det finns en filhanterare inbyggd. Vad göra?
Vid uppgradering har det tyvärr slutat med ominstallation istället. Då får man ta bort linpha-tabellen först för att det skall funka.
After spending 5h trying to get gallery3 working with an existing photo folder structure with pictures using the sync plugin I gave up. I had issues using symlinks and even bind mounts to get my pictures stored on another disk. The I tried Single File PHP Gallery and worked out-of-the-box. Or so I thought.
The pictures that didn't update correctly in linpha did not work here either. Probably the reason why gallery3 symlinks or bind mounts did not work either. After MUCH digging I discovered that newer files/dirs did not list when I used lsattr and this is probably why php/apache does not want to show them. After even more digging this seems to be a bug in xfs and linux extended attributes. If a copy an image folder to a ext4 directory the dir is listed through lsattr and when I copy it back to xfs it is not listed anymore. So now I'm actually needing a new disk to format with ext4 instead…
Install Single File PHP Gallery (http://sye.dk/sfpg/) in 5min:
# cd /var/www/html # mkdir photos # cd photos # wget http://sye.dk/sfpg/Single_File_PHP_Gallery_4.5.6.zip # unzip Single_File_PHP_Gallery_4.5.6.zip # mkdir _sfpg_data # chown apache.apache _sfpg_data # ln -s /data/pictures/* .
And your done, simply surf to http://your-server/photos to check out your photos.
För att kunna adminstrera mysql-databasen via webben kan man använda phpmyadmin.
Hämta senaste från http://www.phpmyadmin.net/ Numera finns den som rpm.
Packa sedan upp till /var/www/html/pma:
# cd /var/www/html # tar xzf /data/in/phpMyAdmin-2.6.1-pl3.tar.gz # mv phpMyAdmin-2.6.1-pl3 pma # chown -R root:root pma
Installationsguide finns nu på: http://video/pma/Documentation.html
# cd pma # vi config.inc.php $cfg['PmaAbsoluteUri'] = 'https://bengt.poweruser.org/pma/'; $cfg['blowfish_secret'] = 'HittaPåNågotBra'; $cfg['Servers'][$i]['auth_type'] = 'cookie'; # vi .htaccess SSLRequireSSL AuthUserFile /var/www/passwd AuthName "Pilla med mysql?" AuthType Basic require user bengt # vi /etc/httpd/conf.d/pma.conf <Directory /var/www/html/pma> AllowOverride All </Directory> # service httpd restart
Nu skall det funka, surfa in på https://video/pma/ och testa.
Webmin är en service som kör som en egen webserver-deamon för att du skall kunna konfigurera en massa grejer på din burk. Kör följande för att installera:
# smart install webmin
Nu skall det funka, surfa in på https://192.168.0.10:10000/ och testa.
Jag fick byta till det detekterade OSet i “Webmin\Webmin Configuration\Operating System and Environment” efter installation. Det kan nog vara lämpligt att också backa upp konfigurationsfiler med. Sökvägar till vissa filer får man editera för att få saker att funka, tex för samba.
Man kan fundera på om man bara skall ha på demonen när man behöver konfigurera nåt för säkerhet:
# chkconfig webmin off # service webmin start # service webmin stop
Download phpsysinfo from github and edit config.php to your wishes. May need some other stuff installed to work as wanted:
# cd /var/www/html # wget https://github.com/rk4an/phpsysinfo/archive/v3.1.5.tar.gz # tar xvf v3.1.5.tar.gz # mv phpsysinfo-3.1.5 phpsysinfo # chmod -R og-w phpsysinfo # cd phpsysinfo # cp phpsysinfo.ini.new phpsysinfo.ini # gedit phpsysinfo.ini # yum install php-mbstring php-xml hddtemp ipmitool lsscsi # chkconfig hddtemp on # service hddtemp # httpd -k restart
To get mount to work permissions of “.gvfs”-folders needs to be updated. Edit “/etc/udev/rules.d/99-fuse.rules” to read MODE=“0755” instead of MODE=“0666”.
My changes to config.php:
PLUGINS="PS" SHOW_PICKLIST_LANG=false SHOW_PICKLIST_TEMPLATE=false LOAD_BAR=true SENSOR_PROGRAM="LMSensors" HDD_TEMP=tcp SHOW_NETWORK_INFOS=true UPS_PROGRAM=Apcupsd
As an alternative to cloud services like dropbox you can install owncloud in your web server. Installation instructions https://doc.owncloud.org/server/latest/admin_manual/installation/index.html
Simply install and configure:
# yum install owncload owncload-httpd owncload-mysql # vi /etc/owncloud/config.php # vi /etc/httpd/conf.d/owncloud.conf # service httpd restart
For initial setup you may want to visit “http://localhost/owncloud” instead of editing the config file.
Then there are file sync clients for windows, linux, android etc: http://owncloud.org/install/
Also be sure to not wait too long with upgrades of the server as you cannot skip “major” releases. Then the upgrade through the web will fail after yum upgrade. Had to manually force installation of 8.1.5 rpms found here: http://koji.fedoraproject.org/koji/buildinfo?buildID=744095
Also fixed an issue where a user did not have write access after upgrade this way: sudo -u apache php /usr/share/owncloud/occ files:scan –all
Check if there is any pure-ftp already available. You will want 1.0.30 or newer for good UTF-8 support and resume support for files >2GB.
Install pure-ftpd:
# yum install pure-ftpd
Create a ftpuser os-user/group and a ftp-folder:
# adduser -d /dev/null -s /sbin/nologin ftpuser # mkdir /ftp
I'm using a “virtual users” mapped to a single ftpuser instead of system users.
Create /ftp and subfolders that will be mounted with “mount bind” in fstab because softlinks won't do:
# chmod a+w /data/in # cd /ftp # mkdir in archive emulators music pictures videos # vi /etc/fstab /data/in /ftp/in none rw,bind 0 0 /data/archive /ftp/archive none ro,bind 0 0 ... # mount -a
Change permissions with “chown/chmod/chgrp” to reflect what you want. The point is to only allow ftpuser write permissions for the in-folder.
Add ftp-users with commands like this:
# pure-pw useradd bengt -m -u ftpuser -d /ftp
Passwords are stored in “/etc/pureftpd.passwd”. Run “pure-pw mkdb” to update “/etc/pureftpd.db” from this file if the file is manually changed.
Setup the pure-ftpd server as wanted:
# vi /etc/pure-ftpd/pure-ftpd.conf NoAnonymous yes PureDB /etc/pureftpd.pdb # PAMAuthentication yes PassivePortRange 65500 65534 ForcePassiveIP johannes-son.com # service pure-ftpd restart # chkconfig pure-ftpd on
Other settings like DontResolve yes and ChrootEveryone yes was already set.
If you wan't to limit the bandwidth for ftp search for “Global bandwidth limitation” on http://download.pureftpd.org/pub/pure-ftpd/doc/FAQ. Alternatively you can try QoS in your router.
To automatically create a readable ftp-index on textfiles you can link the script “buildftpindex” to for example “/etc/cron.weekly”:
# ln -s /usr/local/bin/buildftpindex /etc/cron.weekly/
Previously I compiled manually to get resume over 2GB to work but this probably not needed since 1.0.22:
# cd pure-ftpd-1.0.21 # vim src/ftpd.h
Add “ || defined(SENDFILE64_LINUX)” last in the line “defined(SENDFILE_HPUX) || defined(SENDFILE_LINUX64)”
# ./configure --with-everything --with-largefile --with-rfc2640. # make install-strip
After buying an Acer Liquid Android mobile I stopped using funambol in my server at home. The funambol/syncml support in Android is simply not up to speed yet. Instead I installed some plugins in Thunderbird to get things working again. It is still unknown how this setup will work for outlook/syncml clients though.
Pretty self-explanatory. It assumes a specifik format to be able to sync multiple address fields in Thunderbird to a single field in google.
If you don't like generated “nobodyX@nowhere.invalid” e-mails to avoid the mailing-list bug in Thunderbird:: You can go to Tools → Options in the main Thunderbird window, then click on Advanced. You should see a button labeled Config Editor… on the General tab. Click the button and type dummyEmail. Double-click the row that appears to make the value change to false. This won't completely disable it (it tries to add it always before doing something that would always break the address book), and you may have to reset your address book to remove existing dummy e-mail addresses, or update the contacts in Gmail.
However, if you do this change you will need to add a unique primary mail-address for all contacts that you add to mailing lists or things will get ugly!
To access your calendar data, you need to retrieve your private XML URL from the Google Calendar UI. If you are not sure how, follow these steps:
1. Open your Google Calendar 2. Click on the Settings link located in the box at the left of the page. 3. Click on the calendar you want to use with Thunderbird Lightning or Sunbird. 4. Click on either of the two XML buttons shown at the bottom.
Authentication is always done securely via https. If you would also like to securely transfer your calendar data, then just change the URL to https://.. instead of http://...
Note that the provider does not directly use your private url. The Calendar is still accessible when you reset your private url.
You may now use this url as the Location when clicking File > New > Calendar > On the Network > Google Calendar in Sunbird/Lightning. There is also a graphical tutorial available at bfish.xaedalus.net.
Nowadays it is possible to get google to periodically check for new mail at hotmail. Before I used hotwayd to accomplish this.
Simply configure this in google settings. Use your hotmail e-mail address as user and then use the new hotmail POP server at pop3.live.com port 995.
You can use SyncML or ActiveSync to sync gmail contacts with your phone. As of now ActiveSync supports contacts, calendar and e-mail sync and SyncML only contacts.
ActiveSync SSL server: m.google.com SyncML server: https://m.google.com/syncml SyncML database name: contacts Username: Google mail address Password: Google mail password
More information: http://www.google.com/mobile/sync/
Previously I was syncing bookmarks using the xmarks-plugin against my webserver configured for webdav. However, I switched to google chrome instead of firefox due to the startup speed and more. Now I use the builtin bookmark sync support against google servers.
To install google chrome as a webbrowser download and install the rpm here:
http://www.google.com/chrome/eula.html?platform=linux
To be sure to get the repo installed remove the file /etc/default/google-chrome before installing.
I got bored of not being able to resume mame-torrents properly using mldonkey and looked for something more lightweight. I found Deluge for torrents and aMule for ed2k:
# yum install deluge # wget ftp://ftp.freshrpms.net/pub/freshrpms/fedora/linux/7/amule/amule-2.1.3-3.fc7.i386.rpm # yum install wxGTK # rpm -Uvh amule-2.1.3-3.fc7.i386.rpm
Then I created links to start deluge and amule on my VNC desktop, configured ports etc and everything was good to go. Deluge looks a lot like uTorrent and resuming works as it should.
Direct server downloads for aMule can be found at http://elboiler.p2pforum.it/server.met.gz and http://ed2k.2x4u.de/index.html (fake?), more info http://p2p.technoburger.net/emule-server. Maybe use Kad instead, node-list bootstrap http://download.tuxfamily.org/technosalad/utils/nodes.dat. (It seems like there are fake servers around, blocked by iplist.)
I stopped using the builtin block-functionality in the p2p-apps and installed iplist http://sourceforge.net/projects/iplist/ instead:
# cd /etc/yum.repos.d # wget http://download.opensuse.org/repositories/home:/uljanow/Fedora_10/home:uljanow.repo # yum install iplist # ipblock -g
Do not add sweden.p2p.gz-list, it will block all swedish ip:s. If you keep the edu.gz-list the ntp-server and yum-servers may need to be added to the whitelist by rightclicking in the log. I also added “http https” to Ignored Ports (In) to make my web server accessible from all ip:s.
To be able to do some retro/arcade-gaming the Multiple Arcade Machine Emulator is a given. Nowadays sdlmame is used instead of xmame on linux. You will probably also want a GUI frontend and I think that gmameui (previously gxmame) is a good choice, possible alternatives are qmc2 or kxmame. Fedora rpm packages for sdlmame and gmameui are available from freshrpms.
There is a spotify beta available for Fedora now:
rpm -ivh https://www.spotify.com/wp-content/uploads/previews/spotify-release-1-1.noarch.rpm yum install spotify
So now you won't need to run the windows-client through wine. Still need some support for spotify through mythtv with a remote though.
However the normal spotify isn't easy to use without a keyboard. So I've started to use use ReSpot on my android tablet together with Servify on the HTPC. Installation as follows: (roughly follows instructions from http://h3x.se/install-download/)
# yum install mono-wcf mono-data openal-soft # wget http://h3x.se/servify/servify.linux32.zip # unzip servify.linux32.zip # mv servify /opt/ # cd /opt/servify; # mono Servify.exe user pass 1337 320 >/var/log/servify.log
Then install ReSpot on the android phone and connect to port 1337 on your HTPC. I've scripted it to start together with my mythfrontend as user mythtv. Aport from having to exit ReSpot to reconnect every once in a while things are working very smooth indeed.
Trying the spotify plugin for mythtv, http://code.google.com/p/mythspotify/
Do this:
# cd /usr/lib/mythtv/plugins # svn co http://mythspotify.googlecode.com/svn/trunk/ mythspotify # cd mythspotify # cp ~/147.txt mythspotify/appkey.h # export CPLUS_INCLUDE_PATH=/usr/include/QtCore:/usr/include/QtGui:/usr/include/mythtv:/usr/include/QtSql:/usr/include/mythtv/libmythui:/usr/include/QtXml Comment out "#include <mythlogging.h>" and "LOG" lines using // first on line in mythspotifydlg.cpp mythspotifyui.cpp. # qmake # make # make install
Then I gave upp, did not work. Lacking mythlogging.h header file.
I found out that there is a spotify-plugin for squeezebox and decided to try a Boom in the kitchen. It seems like a squeezebox server running together with the mythbackend is a very nice solution to get access to your music files, spotify, internet radio and more. Instructions for fedora here:
http://wiki.slimdevices.com/index.php
There was a period when the community squeeze project had a fedora repo available. This is no longer the case, but there are still some nice guys updating the server: http://forums.slimdevices.com/forumdisplay.php?27-Logitech-Media-Server
Installation as follows, installing the rpm manually:
# dnf install http://downloads-origin.slimdevices.com/nightly/7.9/sc/b1a775c/logitechmediaserver-7.9.0-0.1.1476850390.noarch.rpm
The web server is then available for configuration:
http://localhost:9000/
You can skip the account on mysqueezebox.com and continue. Configure music folder and start scan. The default spotify plugin won't work with Squeezebox Boom so disable it, apply and let the server restart. Then enable “3rd Party Spotify Plugin (Intel and Arm Processors Only)”, apply and configure your spotify premium account. You may need to to check “Show all 3rd party plugins” for the plugin to show. Also look for the chromecast plugin.
Had a lot of issues with rebuffering on Boom and Classic. Have experimented with max bitrate and lame recoding on the server suspecting my flac files but no real success. Seems to work better when using wired, need to redo network setup to switch. Some special keys to press on remote to factory reset on older SB hardware:
http://wiki.slimdevices.com/index.php/Special_IR_Keys_on_Reboot_for_Factory_Reset_and_Last_FW
A solution to reuse sb playlists with other software is to fix url-encoding for squeezebox playlists using sed and change path respectively:
$ sed -i -e '/^tmp:/ s#%20# #g' -e '/^tmp:/ s#%C3%96#Ö#g' -e '/^tmp:/ s#%C3%B6#ö#g' -e '/^tmp:/ s#%C3%85#Å#g' -e '/^tmp:/ s#%C3%A5#å#g' -e '/^tmp:/ s#%C3%84#Ä#g' -e '/^tmp:/ s#%C3%A4#ä#g' -e "/^tmp:/ s#%27#'#g" -e '/^tmp:/ s#%C3%A9#é#g' -e '/^tmp:/ s#%C3%A0#à#g' -e '/^tmp:/ s#%C3%A7#ç#g' -e 's#^tmp://##g' -e 's#tmp://#file://#g' Bengts.m3u $ sed 's#/data/music/#Y:/music/#g' Bengts.m3u > BengtsWin.m3u
When upgrading fedora to a new version the rpm may lack canned cpan stuff that matches the new perl. After trying to create a standalone squeezebox build with a separate perl (see below) I instead built the cpan modules to match using the squeezebox zip. Check what is lacking by running “/usr/libexec/squeezeboxserver”.
Build the cpan perl module stuff:
# wget https://github.com/Logitech/slimserver-vendor/archive/public/7.9.zip # unzip 7.9.zip # cd slimserver-vendor-public-7.9/CPAN # yum install yasm nasm # wget https://cpan.metacpan.org/authors/id/I/IN/INGY/YAML-LibYAML-0.59.tar.gz # sed -i s/YAML-LibYAML-0.[0-9]*/YAML-LibYAML-0.59/g buildme.sh # ./buildme.sh # \cp -af build/arch/* /usr/share/squeezeboxserver/CPAN/arch/ # Can conflict with rpm in the future? # \cp -af ./build/5.22/lib/perl5/i386-linux-thread-multi/Image/Scale.pm /usr/share/squeezeboxserver/CPAN/Image/Scale.pm # systemctl restart squeezeboxserver.service
There were new issues building YAML-LibYAML-0.35 due to flag “-Werror=format-security” on gcc5/fedora22, see https://fedoraproject.org/wiki/Format-Security-FAQ, and I updated the libYAML module to 0.59 to solve this. The modules may need copied and possibly updated and built again when updating the server-rpm.
Fixing Image::Scale versionmismatch by copying Scale.pm: https://github.com/Logitech/slimserver-vendor/issues/8
After upgrade to Fedora I ran into issues with perl and though I would try to build a specific version for squeezeboxserver to avoid these kind of issues. From http://forums.slimdevices.com/showthread.php?99648-Howto-build-a-self-contained-LMS & http://www.jamesarbrown.com/?p=186
Note that this solution is not used as I ended up using the normal rpm only building the cpan modules for the host perl, see above-
So I download, build and install perl 5.18.4 as this was working with fc21:
# PVER=5.18.4 # wget http://www.cpan.org/src/5.0/perl-${PVER}.tar.gz # tar -xzf perl-${PVER}.tar.gz # cd perl-${PVER} # ./Configure -des -Dprefix=/opt/perl-${PVER} -Dusethreads # make -j4 # make test # Did not work!!! # make install-strip
There were errors during “make test”, “EACCES” is not exported by the Errno module etc, but I hoped it would work anyhow. It did not! It seems to be related to using gcc5 for compiling perl.
Then I downloaded a 7.9-server and installed in /opt:
# NAME=logitechmediaserver-7.9.0-1467729831-noCPAN # wget http://downloads-origin.slimdevices.com/nightly/7.9/sc/5d05bcb/${NAME}.tgz # tar -xvf ${NAME}.tgz -C /opt/ # chown -R root:root /opt/${NAME}/ # find /opt/${NAME} \( -type d -exec chmod u+rwx,g+rx,o+rx {} \; -o -type f -exec chmod u+rw,g+r,o+r {} \; \) # chmod -R a+r /opt/${NAME}/
If I would end up using the perl I built I would need to update the shebang of the perl scripts slimserver.pl and scanner.pl. However, as I ended up using the host perl and instead only add the missing CPAN modules this did not happen.
I installed the default rpmfusion VirtualBox to host a game server.
To get better XP performance in an old vdi I added a sata controller, booted and installed intels matrix storage drivers, turned off and moved the vdi to the sata controller and booted again. Then I switched to the “Intel PRO/1000 T” version network adapter, the T version have native XP support.
There are some limitations with the mythtv upnp/dlna server so I decided to try serviio. This was recommended for Sasmung D6500 Bluray/mediaplayer and was said to support subtitles and transcoding. I tried some other servers first with limited success. Can be found here: http://www.serviio.org/
Do this to install:
$ wget http://download.serviio.org/releases/serviio-1.0.1-linux.tar.gz $ tar xvf serviio-1.0.1-linux.tar.gz $ cd serviio-1.0.1/bin $ ./serviio.sh & $ ./serviio-console.sh &
I did this for my vncserver user “bengt” and then I added the follwoing to rc.local to get it to autostart:
su bengt /home/bengt/serviio-1.0.1/bin/serviio.sh &
Then you may want to add plugins for things like svtplay http://forum.serviio.org/viewforum.php?f=20:
$ cd serviio-1.0.1/plugins $ wget http://forum.serviio.org/download/file.php?id=2703 $ unzip 'file.php?id=2703' $ rm 'file.php?id=2703' $ rm NHLGameCenterPlugin.groovy
Then you will need to browse the forum for URLs to add as online sources. I never did get this to work though :/
Upgrade: Stop Serviio server and console. Overwrite all files in the current Serviio location with the new ones but keep folder library intact.
Also tried http://www.universalmediaserver.com/ after serviio plugins for svtplay etc did not seem to work anymore:
$ wget http://universal-media-server.googlecode.com/files/UMS-2.0.0.tgz $ tar xvf UMS-2.0.0.tgz $ mv ums-2.0.0 ums $ cd ums $ ./UMS.sh
Had a fedora repo for plex closed source server. But it stopped working and I switched to manual updates as suggested in http://bendavis.me/2015/03/29/setup-plex-media-server-on-fedora/
Upgrade like this, check download link on https://plex.tv/downloads for latest version:
# wget https://downloads.plex.tv/plex-media-server/0.9.12.4.1192-9a47d21/plexmediaserver-0.9.12.4.1192-9a47d21.i386.rpm # rpm -Uvh plexmediaserver-0.9.12.4.1192-9a47d21.i386.rpm # systemctl enable plexmediaserver.service && systemctl start plexmediaserver
Access server on http://localhost:32400/web/index.html
I decided to rip my cd collection to FLAC to save some shelf space. In order to rip 1000+ cds the procedure needs to be simple. It looks like abcde + coverlovin + some scripting will do the trick. Coverlovin can be found at https://launchpad.net/coverlovin with a modified version at http://iaudiophile.net/forums/showthread.php?t=38213 supporting flac.
Install and configure:
# yum install abcde cdparanoia python-mutagen # vi /usr/local/bin/abcded #!/bin/bash [ -z "$CDROM" ] && CDROM=/dev/sr0 [ -z "$MUSIC" ] && MUSIC=/data/in/music [ -z "$DELAY" ] && DELAY=10 [ -z "$SPEED" ] && SPEED=8 mkdir -p "$MUSIC" cd "$MUSIC" while true; do echo "Insert CDs to rip, will be ejected when done. Ctrl+C to exit." while ! cdparanoia -Qd $CDROM 2>&1 | grep 'audio only'; do sleep $DELAY done abcde -S $SPEED -j 2 -x -b -N coverlovin.py "$MUSIC" -s large chmod a+rw -R "$MUSIC" done # chmod a+x /usr/local/bin/abcded $ vi ~/.abcde.conf CDROM=/dev/sr0 CDPARANOIAOPTS="--never-skip" OUTPUTTYPE=flac FLACOPTS="--verify --best" INTERACTIVE=n PADTRACKS=y OUTPUTDIR=/data/in/music OUTPUTFORMAT='${ARTISTFILE}/${ALBUMFILE}/${TRACKNUM} - ${TRACKFILE} - ${ARTISTFILE}' VAOUTPUTFORMAT='Various/${ALBUMFILE}/${TRACKNUM} - ${TRACKFILE} - ${ARTISTFILE}' MAXPROCS=2 EXTRAVERBOSE=y mungefilename () # Put spaces in the filenames instead of underscores { echo "$@" | sed s,:,-,g | tr / _ | tr -d \'\"\?\[:cntrl:\] }
To start ripping you can run something like “SPEED=4 abcded” and insert a cd. It will check every 10s for an inserted cd, rip cd, eject cd, download cover art and update file permissions.
To get access to the cdrom-device you may want to add the user to the cdrom group, for example using system-config-users, and logout/in again. Note that I had lots of ripping issues using my bluray device for ripping until I limited the read speed. To get rid of the lxde “Removable medium is inserted” dialog start pcmanfm, edit preferences and uncheck “Show available options for removable media when they are inserted”.
Useful command to rename images in your music archive:
find . -name "cover.jpg" -execdir mv {} folder.jpg \;
As steam client is now available in the rpmfusion repo, install:
# yum install steam
You may also want to install PlayOnLinux and run Steam in wine this way:
# cd /etc/yum.repos.d # wget http://rpm.playonlinux.com/playonlinux.repo # yum install PlayOnLinux
For xbox controller to work:
# yum install kernel-PAE-modules-extra joystick-support joystick
The userspace driver xboxdrv is better than kernel xpad support: http://pingus.seul.org/~grumbel/xboxdrv/
Compile xboxdrv:
# wget http://pingus.seul.org/~grumbel/xboxdrv/xboxdrv-linux-0.8.4.tar.bz2 # tar xvf xboxdrv-linux-0.8.4.tar.bz2 # cd xboxdrv-linux-0.8.4 # yum install scons libusb1-devel boost-devel # scons # make install
Create a startscript, for example /usr/local/bin/startxboxdrv, in this case for a maximum of four pads:
#!/bin/bash killall xboxdrv rmmod xpad modprobe uinput modprobe joydev xboxdrv --daemon --dbus disabled \ --force-feedback \ --next-controller \ --force-feedback \ --next-controller \ --force-feedback \ --next-controller \ --force-feedback # For Trine 2: --mimic-xpad
Run it from /etc/rc.d/rc.local for autostart:
/usr/local/bin/startxboxdrv &> /var/log/xboxdrv.log &
Disable xpad from loading in /etc/modprobe.d/blacklist.conf:
blacklist xpad
Currently I'm testing XBMC as a frontend for myth. Possibly for using a Windows-machine as frontend with Steam for gaming. And putting the mythtvbackend in a dedicated server in the garage.
You will need to enable the mythtv PVR plugin and configure your backend. But after this you are good to go with mythtv playback.
For Swedish play channels download the repo plugin from here: \ http://www.rieter.net/pages/XOT:Download \ Then you have to download the actual plygin, enable it and browse to it in video.
I use my harmony remote with a fractal design shape ir-receiver together with autohotkey to map keys to what XBMC wants. I also created the following autohotkey-script for XBMC/Steam to switch from my harmony remote and also fix audio issues by faking a monitor reconnection:
; S4 - Steam Browser_Forward:: Process,Close,xbmc.exe Process,Close,steam.exe Run,hdmion.exe Sleep 1000 Process,Close,hdmion.exe Run, "steam://open/bigpicture" Return ; S3 - XBMC Browser_Back:: Process,Close,xbmc.exe Process,Close,steam.exe Run,hdmion.exe Sleep 1000 Process,Close,hdmion.exe Run C:\Program Files\XBMC\XBMC.exe Return
Note that I've had problems with hdmi audio issues when turning off receiver and tv. It seems that running in a fullscreen window rather than real fullscreen will solve it, at least partly. You will still need to wait 10s for xbmc to close the audio output before turning off tv/receiver. You will also need to be patient when starting up before navigating the gui. Turning off gui sounds laso reduces the likelihood of issues.
At the beginning accessing movies through samba often caused buffering issues. When I switched to nfs I had to allow access from port 1024 and higher in system-config-nfs. This translates to the “insecure” option in /etc/exports. You can also these tweaks in smb.conf and restart samba: (Later this was found to be caused by old network card drivers.)
[global] # Performance tweaks from http://vornoff.wordpress.com/2012/02/09/tweaking-transfer-rates-of-samba-shares/ max xmit = 65535 socket options = TCP_NODELAY IPTOS_LOWDELAY SO_SNDBUF=65535 SO_RCVBUF=65535 read raw = yes write raw = yes max connections = 65535 max open files = 65535
There is a lot of server wrappers around and I did not now what to select so I set up my own solution instead:
# useradd minecraft # visudo ALL ALL=(ALL) NOPASSWD: /home/minecraft/start.sh # su - minecraft $ wget https://s3.amazonaws.com/Minecraft.Download/versions/1.10.2/minecraft_server.1.10.2.jar $ cd /home/minecraft && java -Xmx1024M -Xms1024M -jar minecraft_server.1.10.2.jar -o true nogui $ vi eula.txt server.properties whitelist.json start.sh $ chmod u+x start.sh
Then setup a start.sh-script containing the above java command line and start this using “lxterminal -e sudo -u minecraft /home/minecraft/start.sh”. Note that I had issues using lxde autostart desktop file in ~/.config/autostart until I let the script itself start the terminal. Also ensure to have the /home/minecraft directory backed up.
I bought a tellstick duo and a raspberry pi and a number switches and temperature sensors from Kjelle. I avoided tellstick net because I wanted my own server. I wanted a separate server for the tellstick to be able to place the stick central in my home due to 30m range.
Original sd images http://www.raspberrypi.org/downloads/ and tool for burning http://sourceforge.net/projects/win32diskimager/. Note that I now use dd on my linux desktop pc instead. Default credentials are pi / raspberry for OS.
I initially had a LOT of problems getting network and keyboard to work, not even the LNK-led were lit. I tested different power adapters, different ethernet cables and different keyboards. I read on forums that it was the same chip for network/keyboard and that it could be issues with the X1 crystal. Eventually I realized that it actually was the usb power CABLE that was the issue. Swapping this solved all of these issues.
Configuring OS, like setting hostname, extending file system to whole sd card and overclocking:
$ sudo raspi-config
Updating OS:
$ sudo apt-get update $ sudo apt-get upgrade $ sudo apt-get dist-upgrade $ sudo apt-get clean $ sudo apt-get autoclean
Updating firmware(/kernel?), may be needed before upgrade to a new raspberry pi:
$ sudo apt-get install rpi-update $ sudo rpi-update
Updating telldus-core to get get humidity to work in my oregon sensors:
$ sudo vi /etc/apt/sources.list deb http://download.telldus.com/debian/ stable main $ wget -q http://download.telldus.se/debian/telldus-public.key -O- | sudo apt-key add - $ sudo apt-get update $ mkdir /old $ sudo cp /etc/tellstick.conf /old $ sudo find /usr/local \( -name '*telldus*' -o -name 'td*' \) -exec mv "{}" /old \; $ sudo ldconfig $ sudo apt-get install telldus-core Be sure to overwrite existing telldusd but not tellstick.conf if you want to keep your config.
See http://developer.telldus.com/wiki/TellStickInstallationUbuntu installing telldus core “the official way”. Note that some cleanup for the old install in /usr/local may be needed, see http://elinux.org/R-Pi_Tellstick_core.
Add mail support:
$ sudo apt-get install ssmtp mailutils mpack $ sudo nano /etc/ssmtp/ssmtp.conf Fill in all values, for example relayhost = smtp.bredband.net in my case. $ echo -e "hej\ndå" | mail -s "$subject" -a "Content-Type: text/plain; charset=UTF-8" user@domain.com
You can move to an usb disk for better speed and reliability. See http://elinux.org/Transfer_system_disk_from_SD_card_to_hard_disk and http://www.redrobe.com/mike/boot-raspberry-pi-from-a-16mb-sd-card/ Still need a small 16MB+ FAT sdcard to boot from.
Also running overclocked turbo mode in “sudo raspi-config”. See http://elinux.org/RPiconfig where there also is a stability checking script to test your pi. If you are running on an usb stick you may want to update the script with /dev/sda2.
To create devices the TelldusCenter way which is compatible with NexaHome you can manually edit the file /etc/tellstick.conf as well:
$ sudo service telldusd stop $ sudo leafpad /etc/tellstick.conf $ sudo service telldusd start $ TelldusCenter
For example this can be added for my proove-switches, edit id/name/unit:
device { id = 1 name = "Brytare 1" controller = 0 protocol = "arctech" model = "selflearning-switch:proove" parameters { # devices = "" house = "666" unit = "1" code = "0000000000" system = "1" # units = "" fade = "false" } }
The house code is invented and you can use the Learn-button in TelldusCenter to learn the switch.
To add a proove-remote, edit id/name/unit:
device { id = 30 name = "Fjärr 1-1G" controller = 0 protocol = "arctech" model = "selflearning-switch:proove" parameters { # devices = "" house = "18507766" unit = "16" code = "0000000000" system = "1" # units = "" fade = "false" } }
My proove on/off remotes have house 50593790 and 18507766 with button→unit as 1/G→16, 2→15, 3→14. All buttons uses group=0 except G with group=1, which cannot be configured in tellstick.conf. So I do not know of any method of differentiating between button 1 and G
Some logged events from my devices:
tellstick,raw:class:command;protocol:arctech;model:selflearning;house:50593790;unit:16;group:0;method:turnon; tellstick,raw:class:command;protocol:arctech;model:selflearning;house:18507766;unit:16;group:0;method:turnon; Altan: tellstick,raw:class:sensor;protocol:oregon;model:1A2D;id:39;temp:28.9;humidity:31; Ny: tellstick,raw:class:sensor;protocol:oregon;model:1A2D;id:110;temp:26.0;humidity:51; Grund: tellstick,raw:class:sensor;protocol:oregon;model:1A2D;id:241;temp:19.2;humidity:50;
Downloaded the >=8GB sd image from forum thread http://www.telldus.com/forum/viewtopic.php?t=3157 and updated the jar-file from http://nexahome.se/. Note the special jar for raspberry pi with optional z-wave support. Manual http://nexahome.se/manual/.
Adding telldus to apt-sources:
$ sudo nano /etc/apt/sources.list.d/telldus.list deb http://download.telldus.com/debian/ stable main
Updating NexaHome according to http://www.telldus.com/forum/viewtopic.php?f=23&t=3157#p18591:
$ cd ~/nexahome $ wget http://nexahome.se/NexaHome_RPi_3.8.2.jar $ nano run_nexahome.sh
Some other things:
Bra kommandon:
Lägg till “ &” efter ett kommando för få tillbaks prompten direkt och köra kommandot i bakgrunden.
Intressanta filer och foldrar:
Om X-konfigurationen går åt helvete så kan man använda “CTRL+ALT+F1-7” för att komma åt andra terminaler. X ligger på “CTRL+ALT+F7”. Eller logga in remote.
Om du vill köra remote med en terminal så använd “ssh” i linux och “putty” i windows.
Om du vill köra remote med grafik så går det ju direkt med en X-server. Annars kan du köra “vncserver” i linux och “TightVNC” i Windows.
Det är lämpligt att skaffa så mycket ny hårdvara så att den gamla burken kan stå och tuffa bredvid. Åtminstone så man kan hämta filer på nätverket.
Får att få med sig inspelningarna så krävs en del jobb. Tanka ner nuvexport och kör sedan:
# bunzip2 /nuvexport-latest.tar.bz2 # tar xf /nuvexport-latest.tar # cd nuvexport-0.2/ # make install # apt-get install perl-Time-HiRes # su - mythtv $ nuvexport
Välj “Export to .nuv and .sql” och exportera alla inspelningar du vill ha med.
För att importera sql-filen kör du:
# cat *.sql | mysql -u mythtv -p
Ibland kan man behöva ge sig in och fixa i databasen när det strular till sig.
Tex så slutade “mythfilldatabase” att funka, fel i insert, vid övergång till vintertid. En hjälp vid felsökningen var att tömma program-tabellen i databasen, tex så här:
# mysql -p mythconverg # delete from program;
Kör sedan mythfilldatabase som användaren mythtv, eventuellt med –manual.
Vad jag tror så ligger alla databasefiler i /var/lib/mysql så så här kan man göra en backup:
# service mysqld stop # cp -R /var/lib/mysql /data/backup # service mysqld start
Bättre är kanske att packa ihop det med tar, men vad fan. OBS! Inte testat att återställa än!
Andra intressanta sql-kommandon är: (Glöm inte tab för att få hjälp med syntax.)
show [databases|tables|fields|keys], select
Annars kan det också vara intressant att installera phpmyadmin för att greja med databasen via webben. Se tidigare kapitel.
Jag har återgått till att tanka paket från atrpms igen. Det är mycket snabbare och smidigare vid uppgradering.
För att få alla beroenden på plats kan det vara lämpligt att installera mythtv-suite med apt-get. Ta sedan bort alla myth-paket från atrpms med “rpm -e”, lista dom tex med “rpm -q -a | grep myth”. I mitt fall:
# rpm -e libmyth-0.11-29.rh9.at mythtv-0.11-29.rh9.at mythmkmovie-1.0.1-3.rh9.at mythvideo-0.11-28.rh9.at mythgallery-0.11-29.rh9.at mythtv-frontend-0.11-29.rh9.at mythgame-0.11-27.rh9.at mythweb-0.11-28.rh9.at mythweather-0.11-27.rh9.at mythtv-suite-0.11-30.rh9.at mythmusic-0.11-27.rh9.at mythdvd-0.11-5.rh9.at mythtv-backend-0.11-29.rh9.at mythtv-theme-purplegalaxy-0.20030623-2.rh9.at mythtv-theme-visor-0.20030711-1.rh9.at mythtv-theme-photo-4-4.rh9.at
Eventuellt kanske man skall spara alla themes eftersom jag stötte på patrull när temat jag använde saknades sedan. (–nodeps) Tankade ner det från www.mythtv.org och packade upp det till /usr/local/share/mythtv/themes/ istället.
Först installerar man utvecklarversionerna av paketen plus lite mer med apt-get&atrpms:
# apt-get install lame-devel lbcdaudio-devel flac-devel libmad-devel libid3tag-devel libdvdread-devel fftw2-devel
Saknar du något paket så kolla om det finns på atrpms, http://atrpms.physik.fu-berlin.de/topic/multimedia/ . (Om man går den manuella vägen och tankar hem detta så kan man kolla på www.mythtv.org hur det går till.)
Tanka ner alla källkoden till alla moduler från www.mythtv.org. Packa upp med “tar xjf” och följ instruktionerna på www.mythtv.org. Läs filerna UPGRADING och README för att se hur det hela skall gå till.
Först fixar vi mythtv-paketet:
$ tar -xjf mythtv-0.12.tar.bz2 $ cd mythtv-0.12 $ ./configure $ qmake mythtv.pro $ make $ su # make install # exit
Make sure you have the /usr/local/lib in /etc/ld.so.conf and run 'ldconfig'. Jag gjorde också en fix för att manuell tidsoffset skulle funka i addTimeOffset() i filldata.cpp trots att vi har CET. (Istf för att “smart” räkna ut offseten för tidszonen så lade jag till samma tidzon igen textuellt efter berälningen.)
Här skall databasgrejerna tryckas in om man inte redan gjort det, sedan konfar vi backenden:
$ cd setup $ ./setup
Jag mapparna “/var/video” och /var/cache/mythtv“ med fulla rättigheter för alla att dumpa filmer i.
Testa runt lite med mythbackend, mythfilldatabase och mythfrontend, När det funkar så fixa autostart av backend:
# cp /home/mythtv/mythtv0.12/mythtv-0.12/contrib/etc.rc.d.init.d.mythbackend /etc/init.d/mythbackend # cp /home/mythtv/mythtv0.12/mythtv-0.12/contrib/etc.sysconfig.mythbackend /etc/sysconfig/mythbackend # chkconfig mythbackend on
Dags för mythmusic, kommentera först tillbaks “INCLUDEPATH += /usr/include/cdda” i settings.pro (RH9):
$ ./configure --enable-all $ qmake mythmusic.pro $ make $ su # make install # exit
Dags för mythvideo:
$ qmake mythvideo.pro $ make $ su # make install # mysql -u root -p < videodb/0.11-to-0.12.sql # exit
Observe that the mysql-command deals with an upgrade from 0.11 to 0.12. See UPGRADING for your case.
Dags för mythdvd:
$ ./configure --enable-transcode --enable-vcd $ qmake mythdvd.pro $ make $ su # make install # exit
För mythgallery, mythgame, mythnews och mythweather (=X) så följer man samma procedur:
$ qmake X.pro $ make $ su # make install # exit
Installering av mythweb sker genom att kopiera foldern till \var\www\html\mythweb och fixa rättigheter:
# cp -R mythweb-0.12 /var/www/html/mythweb # cd /var/www/html/mythweb/ # mkdir image_cache # mkdir php_sessions # chgrp -R apache {image_cache,php_sessions} # chmod g+rw {image_cache,php_sessions} # vi config/conf.php
Det verkar inte behöva ändras något för att funka, men filen omnämns i README.
# vi .htaccess Editera filen så att den börjar med typ följande: SSLRequireSSL AuthUserFile /var/www/passwd AuthName "Med i mythweb-klubben?" AuthType Basic require user maria bengt
Det kan vara värt att köra en uppdatering av dll-cachen för att saker skall funka:
# ldconfig
I bought a Hauppauge Nanostick PCTV 290e DVB-T2 to be able to see Boxer SVT 1/2 HD. Unless you are on kernel 3.0+ you'll need to upgrade your drivers to support this card. I followed the instructions here:
http://stevekerrison.com/290e/index.html
http://git.linuxtv.org/media_build.git
I did the following on my Fedora 14:
# cd /usr/src # git clone git://linuxtv.org/media_build.git # cd media_build # yum install -y perl-Proc-ProcessTable # ./build # make install # reboot
Then you'll have to scan for the channels in MythTV. As I wanted to reserve this card for HD channels I used a separate input for this card with only SVT 1/2 HD using the old Nova T 500 for other channels. When the kernel is updated you may have to redo these steps.
To get the dvb adapters to always have the same device number you can fiddle with udev-rules. It is also possible to reserve adapter number(s) for a specific driver module by adding some lines to your /etc/modprobe.d/local.conf:
alias char-major-81 videodev alias char-major-81-0 dvb-usb-dib0700 options dvb-usb-dib0700 adapter_nr=1,2 force_lna_activation=1
(This will reserve adapter number 1,2 for the Nova T 500 driver leaving 0 for the nanostick.)
It did not work to find the swedish HD channels with a full scan in mythtv. An interesting alternative is to use w_scan to do a full scan. It is however possible to manually enter the settings and scan single transports for channels. In the case of the Brudaremossen transmitter in Gothenburg the following settings can be used:
Frequency 570000000Hz and bandwidth 8MHz for MUX 6 transport. SVT1/2 HD and some HD pay channels. Frequency 205500000Hz and bandwidth 7Mhz for MUX 7 transport. You may need a VHF-antenna. Only HD pay-channels.
The rest of the settings can be left at Auto. Frequencies for other transmitters: http://www.teracom.se/Sandarinformation/Utbyggnadsplaner/
As one of my nanosticks died I bought a PCIe card instead. Linux driver support from the manufacturer, which means that you have to recompile it on kernel update. Linux drivers can be downloaded here: http://www.tbsdtv.com/download/
I did like this as root:
mkdir tbs cd tbs wget http://www.tbsdtv.com/download/document/common/tbs-linux-drivers_v160919.zip unzip tbs-linux-drivers_v160919.zip tar xvjf linux-tbs-drivers.tar.bz2 cd linux-tbs-drivers/ ./v4l/tbs-x86_r3.sh # For 32bit, see docs for other kernels. # sed -i 's#f_dentry#f_path.dentry#g' linux/drivers/media/rc/lirc_dev.c # Fix lirc compilation issue on kernel 3.19. Not needed in latest driver? # gedit v4l/isl6423.h # Fix compilation issues on kernel 4.2.8, add "," in "const struct isl6423_config *config,". Should not affect 6280 only other other cards. See http://www.tbsdtv.com/forum/viewtopic.php?f=52&t=2285 # gedit ./linux/drivers/media/dvb/dvb-usb/af9015.c # Add "#define GOLDEN_RATIO_PRIME_32 0x9e370001UL" for kernel 4.7.2, see http://www.tbsdtv.com/forum/viewtopic.php?f=47&t=10059 make -j4 make install reboot dmesg | grep DVB
The cards should be possible to configure in mythtvsetup now. After kernel upgrades you will need to remove the “linux-tbs-drivers” folder and unpack again, make clean does not seem to work.
Jag har nu byggt om en hauppauge mottagare till att kopplas in i serieporten på min sovrumsfrontend, allt enligt http://www.terrington.id.au/linux/my-set-top-box/hauppauge-serial-adapter
Se till att lircs serie-port-module finns tillgänglig:
# yum install lirc-devices lirc-kmdl-$KVER
Kolla upp vilken serieport och mata in rätt info i modules.conf:
# dmesg | grep ttyS
Kolla up irq och address, från tex “serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A” eller “serial8250: ttyS2 at I/O 0x3e8 (irq = 3) is a 16550A”
# vi /etc/modules.conf alias char-major-61 lirc_serial options lirc_serial irq=4 io=0x3f8
Sedan krävs det lite meck för att kärnan inte skall ta hand om serieporten och att lircd startar efter detta:
# vi /etc/local.rc setserial /dev/ttyS0 uart none service lircd start
Det strulade först, strömmatningen på RTS var hela tiden negativ. Efter mycket om och men upptäckte jag att serieporten antagligen inte fungerade eller var felkonfigurerad. Det verkade inte gå att kommunicera med den, tex med statserial, och det dök upp lite meddelanden som “ttyS0: LSR safety check engaged!” i dmesg. Allmän serieports-info på linux finns här http://www.linux.com/base/ldp/howto/Serial-HOWTO-9.html#locate_port.
Till slut fick jag det hela att fungera genom att stänga av IrDA i BIOS!!! Det verkar som om den pajade serieportarna; inte ens IrDa-serieportarna funkade med statserial. Det behövs inte ens någon konfiguration i /etc/modprobe.conf för att det skall funka.
Efter detta funkade allt och det var bara att lägga in /etc/lircd.conf och kontrollera med irw. Mer om detta finns i ett tidigare kapitel. Glöm inte de två filerna i mythtv:s hemkatalog.
Hittade instruktioner på http://biocrystallography.blogspot.com/2007/01/lirc-with-smscircc2-chip-in.html om att använda den inbyggda IrDA-modulen på laptopen. Tydligen går detta med lirc_sir på vissa laptops.
Kolla först irq och liknande så att irq och iomem stämmer med parametrarna som används senare:
dmesg | grep -i smsc cat /proc/interrupts cat /proc/ioports
Sedan kan du unloada modulen som normalt dirver kretsen och ersätta den med lirc_sir:
modprobe -rv smsc_ircc2 parport parport_pc modprobe -v lirc_sir io=0x2e8 irq=7 mode2
Om den gnäller när du försöker ladda modulen lirc_sir så kan det bero på att du inte har lyckats släppa på resurserna som delas, irq eller io. Parallellporten på min x1000 använde också irq 7, därför tog jag bort de extra parport-modulerna.
Först trodde jag att det gick åt helvete, men sen kom jag ihåg att lirc_serial fortfarande laddades rc.local. Sedan körde jag mode2 mot /dev/lirc1 istället och saker och ting började funka. Tyvärr så ville jag gärna behålla min skrivarport och dessutom funkade det dåligt på längre avstånd. Så jag kanske går över till serieports-varianten med ström från usb-porten istället.
När jag kastade ut mitt analgoa kort behövde jag stoppa fixa remoten så den funkade. Det lustig var att en några knappar funkade på nåt konstigt sätt genom kärnan. Flytta markören och volymen och lite annat. Dock så var det mänga knappar som inte funkade så jag fick gå tebaks till lircd.
Notera att förr hette filerna/servicen lircd, men sedan en fc10-uppdatering så är det bara lirc som gäller.
Det visar sig att kärnan mappar ir-mottagaren till tangenter OCH /dev/input/eventX. I mitt fall var X=3 och senare 5, kolla med 'cat' för att se vilken av device-filerna som spottar ur sig text i konsollen. Med “cat /proc/bus/input/devices” kan man ta reda på namnet att matcha mot för att hitta rätt även om X ändrar sig. Sedan kan man konfa lircd-demonen så här:
# vi /etc/sysconfig/lirc LIRCD_OPTIONS="-H dev/input -d /dev/input/eventX" eller LIRCD_OPTIONS="-H dev/input -d name=cx88*" # service lirc restart # irw
Kolla om du får ut något. Jag fick uppdatera ”/etc/lircd.conf“ trots att det var samma fjärrkontroll, kolla arkivet. Glöm inte att starta om mythfrontend för att ändringarna skall ta skruv. Sedan fc12 måste man använda ”/var/run/lirc/lircd“ som device i mythfrontend också.
Iom fc12 kan man använda gnome-lirc-properties för detta och få knappar via linux input layer:
# yum install gnome-lirc-properties # gnome-lirc-properties
Jag gick över till detta när jag bytte till IR-ingången i Nova-T 500 då jag tog ur den andra tunern för att spara ström. Dock betyder det att alla knappar numera börjar med “KEY_” så man får ändra i ”/home/mythtv/.mythtv/lircrc“. Dessutom skall man vara medveten att själva IR-mottagaren inte är samma på gamla Nova-T och 500:an även om den passar!!!
Man kan använda följande för att hitta koder till lircd.conf om man saknar någon knapp:
# irrecord -H devinput -d /dev/input/event6 test.conf
Tyvärr är inte atrpms lirc kompilerad med sändningsstöd och dessutom tål den inte flera enheter(!) Därför får man tanka ner källkoden och kompilera själv för sändningsmöjligheten. Läs på http://members.cox.net/rwraithr/.
OBS! Man kan numera antagligen hoppa över stegen för att göra om lircd till remoted, det är redan gjort. Källkoden finns i arkivet “remote-0.7.0pre5.tar.bz2” hämtad från sidan ovan.
Först bör man rensa bort gammalt lirc-skräp och fixa så man kan tanka källkod med atrpms:
# vi /etc/apt/sources.list Ta bort "#" från raden med src-rpms från atrpms. # apt-get update # apt-get source lirc # rpm -Uvh paketnamn
Källkoden finns sedan i ”/usr/src/redhat/SOURCES/“ kopiera och packa sedan upp med “tar xjfv”.
Modifiera till remote istf lirc och kompilera:
# ./lirc2remote.sh Följ instruktionerna i "IRBlaster_Howto.txt" och byt 61->72 och 8756->8768. Du måste eventuellt göra ett kopieringsjobb för "drivers/remote_mceusb". # ./autogen.sh # ./setup.sh Fixa så du får en serie-port med transmit PÅ! # ./configure.sh # ./make
Om make skiter sig så kör:
# cd /usr/src/linux-2.4 # make mrproper # cp /boot/config-`uname -r` .config # make oldconfig ; make dep # vi /usr/src/linux-2.4/include/linux/version.h
Remove custom from kernal name to be able to load module later.
Sedan är det dags att installera, kommer att skriva över installerad lirc:
# make install # cd /usr/local/bin mv ircat remote_ircat mv irexec remote_irexec mv irpty remote_irpty mv irrecord remote_irrecord mv irsend remote_irsend mv irw remote_irw mv irxevent remote_irxevent mv mode2 remote_mode2 mv xmode2 remote_xmode2 (# removed for copy'n'paste)
Sedan vill man ju återställa vanliga lircd från atrpms. Till exempel genom att ta bort befintliga paket och sedan installera om dom:
# rpm -qa | grep lirc # rpm -e paket att ta bort # export MYKERNEL=`uname -r` # apt-get install lirc-kmdl-$MYKERNEL # apt-get install lirc # chkconfig lircd on
Ta reda på IRQ och adress för önskad port och använd denna info:
# dmesg | grep ttyS # vi /etc/modules.conf alias char-major-72 remote_serial below remote_serial remote_dev options remote_serial irq=4 io=0x03f8 # depmod -A # setserial /dev/ttyS0 uart none # modprobe remote_serial # cp NokiaMM9820T /etc/remoted.conf Byt ut NokiaMM9820T mot en nertankad remotefil för DIN pryl. # remoted # remote_irsend SEND_ONCE Nokia 1
När det funkar så kan du lägga till följande rader i /etc/rc.local:
setserial /dev/ttyS0 uart none /usr/local/sbin/remoted
Glöm inte att ockå konfigurera lircd enligt installationsförfarandet ovan om det är första installationen!
After problems with incorrectly detected keys I decided to buy a dedicated remote control and a USB IR receiver. I went for the Fractal Design Shape MCE remote control which will register as a keyboard and mouse and use standard MCE keyboard shortcuts. In the end I only wanted to use the receiver with my Harmony One universal remote.
However, this was not as easy as I thought it would be for a number of reasons:
Now things seem to work well after mapping those keys that will work in MythTV to Harmony One and setting up myth keys to work with this setup.
Om man stoppar i en ny hårddisk så se upp så den inte är formaterad med ett linux-system, då bootar den inte längre. Formattera då tex på M$-burk först. Beskrivningen nedan gäller för att formattera hela den nya disken med xfs. Om du vill ersätta en hel disk med en ny större eller fixa dual-boot så är det bättre att köra en gparted live cd, se längre ned.
Då är det dags att partitionera, se till att det är rätt disk:
# hdparm -I /dev/sdb # fdisk /dev/sdb
Kolla nuvarande partitioner med “p”, se till att det är rätt disk. Skapa ny partition för hela disken med “n”, “p”, “1”, return, return och w.
Nu är det dags att formattera med xfs och montera:
# mkfs.xfs -f /dev/sdb1 # mount -t xfs /dev/sdb1 /mnt/data2
Och fixa så den monteras automatiskt på /mnt/data2 vid uppstart:
# mkdir /mnt/data2 # vi /etc/fstab
Lägg till ”/dev/sdb1 /mnt/data2 xfs defaults,noatime,nodiratime,nosuid,nodev,allocsize=256m 1 2“
Sedan kan man flytta över foldrar från diskar med som börjar bli fulla “cp -rpv” för att istället bind-montera dessa foldrar i /etc/fstab.
Om du använder gparted på en live cd för att kopiera boot-hårddisken så behövs grub installeras i mbr för att boot skall funka. Installering av Windows för dual-boot skriver också över mbr. Se också till att device-labeln följer med för de olika partitionerna för att saker skall monteras rätt. Jag använde Knoppix LiveCD för detta med följande kommandon:
# gparted # mount /dev/sda1 /boot # grub2-install /dev/sda
(Observera att /boot från hårddisken monteras över knoppix /boot för att grub-install skall funka. En live-cd med tillräckligt ny kärna kan behövas för nya moderkort.)
After upgrading my harddisk to a WD 2TB Green Power I discovered that disk access was dead slow sometimes. Yum/rpm would sleep for 5s between each installed package etc. This was later found to be caused by incorrect partition alignment. This disk incorrectly reports 512 byte sectors and actually use 4 kilobytes internally. This may impact disk speeds with as much as 10 times, but for me “rpm -vv –rebuilddb” was more like 100 times faster. More info here: http://thread.gmane.org/gmane.linux.utilities.util-linux-ng/2926
Use “fdisk -l -u” for checking alignment. Partitions should start at numbers dividable by 8, but 4 is also ok. It is possible to move/align partitions using GParted Live CD 0.6.1 or later.
Vad det gäller Win7 så verkar den installera sig snällt på den partition man väljer. Dock skriver den över MBR så man får köra in grub igen enligt ovanstående. När jag lade till en ny SSD-disk och ville behålla min dual-boot så stoppade jag i SSD-disken, bootade linux från min gamla och körde gparted för att kopiera över /boot-partitionen till SSD-disken. Efter bytte jag boot till SSD:n och installerade Win7 på resten av disken. Win7 skall kunna ändra storlek på partitioner om jag skulle vilja ha över resten av linuxe. Sen är planen att boota med det gamla linux och montera om /boot till SDD:n och installera om MBR enligt ovan och sen byta till SSD:n som boot för alltid. Dock behöver man nog ändra på /boot/grub/grub.conf för att partitionerna skall stämma. Det verkar som om den extra 100MB-partitionen som Win7 skapar är rätt att peka med +chainloader i grub.conf.
Observera att hd(0,x) i grub.conf alltid är den disk man valt att boota ifrån. Däremot så är /dev/sda i linux den första disken i systemet. Detta kan skapa lite huvudbry eftersom jag numera har grub på två diskar. Dessutom fick jag inte XP på gamla disken att funka när den startas från den nya. Jag bytte label på /boot på gamla disken så den alltid skall montera den nya diskens partition oavsett vilken man startar från. Det gör ju att den gamla diskens /boot kommer att ruttna med tiden. I slutändan gick det inte att boota från den andra disken ändå…
Du kan montera dina ext3-partitioner som ext4 för lite prestandaförbättring. Editera /etc/fstab och byt ext3 mot ext4 och boota om. Notera att man inte får alla ext4-förbättringar på det här sättet. Då måste filsystemet konverteras omonterat. Om man konverterar /boot till ext4 så är det nog lite extra strul. Just nu misstänker jag dock att det sunkar ihop med tiden om man monterar ext3 som ext4. Efter ett tag verkar filhanteringen gå extremt slött, märks tex i yum.
För att kolla hur fragmenterad en specifik fil är kan man köra filefrag-kommandot. Och för hela /-ext-filsystemet skall kan kunna köra shutdown med nån parameter för att det skall visas under nästa boot då den kör fsck.
För att defragmentera filer kör jag defrag som kopierar alla filer under en folder till nya filer:
# cd /usr/local/bin # wget http://ck.kolivas.org/apps/defrag/defrag # chmod a+x defrag
Dock vet jag inte om jag vågar prova på hela /, får nog kör init till nån lägre nivå först iaf isf. Sen verkar det inte alltid bli perfekt.
Om du vill defragmentera din xfs-partition kan du göra så här:
# yum install xfsdump # xfs_db -r -c frag -r /dev/sda4 # xfs_fsr -v /dev/sda4
(Det andra kommandot kollar hur mycket fragmenterat det är. En högre procentsiffra är sämre.)
Efter att ha kollat efter VFD-displayer att ha i burken för att slippa starta tvn för att spela musik kom jag på en annan lösning. Jag köpte helt enkelt en display för nackstödsmontage i bilen på kjell&co. Det kostar ungefär lika mycket och jag kommer troligtvis att använda den som digital fotoram på kuppen. Eftersom den tar ir-signaler så kan jag använda den med min harmony one fjärris och slå på/av den vid lämpliga tillfällen. Köpte också en 1200mA 12V nätadapter för att driva skärmen.
Lägg till följande i Device-sektionen i /etc/X11/xorg.conf för att få compositutgången att kopiera signalen till tvn:
Option "TwinView" Option "TwinViewOrientation" "Clone" Option "ConnectedMonitor" "DFP-0, TV-0" Option "TVStandard" "PAL-B" Option "TVOutFormat" "COMPOSITE"
Nuförtiden kör jag nog mer med nvidia-settings för att konfa dessa pryttlar.
In general when faced without completely broken configuration I usually attempt to fix the system using the Fedora rescue DVD: - Boot DVD in rescue mode, *start* the network. - chroot into Fedora (chroot /mnt/sysimage). - Attempt on reinstalling the kernel / dracut. yum reinstall dracut kernel kernel-devel - Reboot.
I have some backup scripts that will be executed by cron to do backup of the most important things like /etc and the mysql-database. I will then copy the backup to an external usb disk every once in a while. This will not do when on complete hdd-failure so I also backup filesystems needed to get a running system again before upgrading to a newer fedora.
To do a safe backup you can boot from a gparted livecd and do backups of at least / and /boot to an external usb disk. However, to avoid complete downtime you can hope that something like this will work:
# init 3 # killall keepmythbackendalive # killall mythbackend # service mysqld stop # service smb stop # service httpd stop # service vncserver stop # umount /ftp/in /ftp/archive /ftp/games /ftp/apps /ftp/music /ftp/pictures /ftp/videos /ftp/recordings
(Bind-mounts must be unounted or these will be copied by rsync.)
Then mount backup disk and rsync file structures:
# mount /mnt/temp /dev/sdd1 # rsync -avx --delete /boot/ /mnt/temp/ # umount /mnt/temp # mount /mnt/temp /dev/sdd2 # rsync -avx --delete / /mnt/temp/ # reboot
Maybe you will need to enter bios after rebooting and detect and fix hdd boot order. Mine got screwed up after I had the usb disk plugged in during reboot.
You can also use mondo rescue to backup your live filesystems. Check http://www.mondorescue.org/ for an up to date download link. Download and install:
# cd /etc/yum.repos.d # wget ftp://ftp.mondorescue.org/fedora/14/i386/mondorescue.repo # yum install mondo Use the following command to create backup DVD ISO:s in /data/backup excluding some large directories: # ionice -c3 mondoarchive -OiVN -I / -E "/data|/mnt|/ftp|/var/log" -d /data/backup -s 4480m
I also had to edit the /usr/sbin/mindi script to avoid running out of space when creating boot image, “BOOT_SIZE=65536”.
Backup and restore commands for mythtv mysql database:
# nice mysqldump -u mythtv -pmythtv mythconverg -c | /usr/bin/bzip2 -cq > $DESTDIR/backup/mythtv_backup.$TYPE.sql.bz2 # mysql -umythtv -pmythtv mythconverg < mythtv_backup.weekly.sql
For some reason all rpm/dnf operations were very slow on one on my machines. I decided to try and optimize the rpm database. See https://cpaneltips.com/rebuilding-a-corrupted-rpm-database/
Rebuilding rpm db:
# cp -a /var/lib/rpm /var/lib/rpm_backup # cd /var/lib/rpm # rm __db.* # rpm --rebuilddb
If this does not help then rebuild Packages database file:
# db_dump Packages >Packages_dump # mv Packages Packages_old # rpmdb --initdb # db_load -f Packages_dump Packages # rpm --rebuilddb
Maybe this works nowadays:
# rpmdb --exportdb >~/rpmdbdump # mv Packages Packages_old # rpmdb --importdb <~/rpmdbdump # rpm --rebuilddb
You may need to perform a rescue on your system, maybe reinstall grub2 after some issue or rearranging drives. Some interesting links:
The fedora install dvd contains a rescue mode reachable using “linux rescue” which will give you a prepared mounted image of your system disk which you can reach using “chroot /mnt/sysimage”. The live cd does not have this feature but you can set it up yourself this way:
# mkdir /mnt/sysimage # ll /dev/disk/by-label # mount /dev/sdc3 /mnt/sysimage # mount /dev/sdc1 /mnt/sysimage/boot # mount --bind /dev /mnt/sysimage/dev # mount --bind /proc /mnt/sysimage/proc # mount --bind /sys /mnt/sysimage/sys
When you have your system root prepared you can chroot into it and reinstall grub2 the normal way:
# chroot /mnt/sysimage # grub2-install /dev/sda # grub2-mkconfig -o /boot/grub2/grub.cfg
I used yum/fedora-upgrade after failures in previous upgrades: https://fedoraproject.org/wiki/Upgrading_Fedora_using_yum
First upgrade system, clean yum, backup and reboot:
# yum install -y fedora-upgrade # yum upgrade -y # yum clean all # cd /var/lib # rm -rf rpm_backup # mv rpm rpm_backup # cp -a rpm_backup rpm # reboot
It is nice if your /boot partition is larger than 200MB. If not you will probably have to remove old kernels AND have a wired connection to download at install time:
# df -h /boot # rpm -qa | grep kernel # yum remove <old_kernel>
Typically you will also have to remove dependent packages like nvidia kernel modules. You can also try the kernel-prune script in the preupgrade-link above.
You will need to remove some conflicting packages to avoid issues during upgrade:
# yum remove async-http-client java-1.5.0-gcj-src java-1.5.0-gcj-javadoc kernel-PAE-modules-extra-<for-old-kernel> directfb libbtctl # rpm -e --nodeps kmod-nvidia-304xx-3.19.8-100.fc20.i686+PAE-304.123-2.fc20.5.i686 xorg-x11-drv-r128-6.9.2-1.fc20.i686
You may want to use “rpm -e –nodeps” to remove without dependencies and keep “xorg-x11-drivers”?
To continue the upgrade:
# init 3 # Or use Ctrl+Alt+F2. # rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-21-$(uname -i) # yum update yum # yum --releasever=21 distro-sync # OR use "fedora-upgrade" # yum install system-release-nonproduct # Or system-release-server/system-release-workstation(/system-release-cloud)
During upgrade it will take some time for packages to download. You will also have to fix .rpmsave/.rpmnew if using fedora-upgrade. Note that I had to use the power button to shutdown after the upgrade.
Fixes, checks and cleanup after upgrade reboot:
# restorecon -R / # Good according to yum upgrade page # yum remove kernel-core-4.0.8-200.fc21.i686 # I am using PAE, why did this get installed? # system-config-firewall # Had to resave settings to make the server accessible again # yum install kmod-nvidia-PAE # Install proprietary drivers again? # grub2-install /dev/sda # grub2-mkconfig -o /boot/grub2/grub.cfg # vi /etc/php.ini always_populate_raw_post_data = -1 # yum repolist # package-cleanup --problems # package-cleanup --dupes # package-cleanup --orphans
Do not remove too much.
I used yum/fedora-upgrade after failures in previous upgrades: https://fedoraproject.org/wiki/Upgrading_Fedora_using_yum
First upgrade system, clean yum, backup and reboot:
# yum install -y fedora-upgrade # yum upgrade -y # yum clean all # cd /var/lib # rm -rf rpm_backup # mv rpm rpm_backup # cp -a rpm_backup rpm # reboot
It is nice if your /boot partition is larger than 200MB. If not you will probably have to remove old kernels AND have a wired connection to download at install time:
# df -h /boot # rpm -qa | grep kernel # yum remove <old_kernel>
Typically you will also have to remove dependent packages like nvidia kernel modules. You can also try the kernel-prune script in the preupgrade-link above.
You will need to remove some conflicting packages to avoid issues during upgrade:
# yum remove perl-PlRPC-0.2020-15.fc20.noarch # junit-demo-4.11-14.fc21.noarch firewalld-config-standard-0.3.14.2-2.fc21.noarch
You may want to use “rpm -e –nodeps” to remove without dependency checks if too many packages will get removed…
To continue the upgrade:
# init 3 # Or use Ctrl+Alt+F2. # rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-22-$(uname -i) # yum update yum # yum --releasever=22 distro-sync # OR use "fedora-upgrade"
During upgrade it will take some time for packages to download. You will also have to fix .rpmsave/.rpmnew if using fedora-upgrade. Note that I had to use the power button to shutdown after the upgrade.
Fixes, checks and cleanup after upgrade reboot:
# system-config-firewall # Had to resave settings to make the server accessible again # yum install kmod-nvidia-PAE # Optionally install proprietary drivers again? # grub2-install /dev/sda # grub2-mkconfig -o /boot/grub2/grub.cfg # yum repolist # package-cleanup --problems # package-cleanup --dupes # package-cleanup --orphans
Do not remove too much.
I still used package manager upgrade method https://fedoraproject.org/wiki/Upgrading_Fedora_using_yum and not the preferred dnf plugin method https://fedoraproject.org/wiki/Upgrading .
First upgrade system, clean dnf, backup and reboot:
# dnf upgrade # dnf clean all # cd /var/lib # rm -rf rpm_backup # mv rpm rpm_backup # cp -a rpm_backup rpm # reboot
You may need to remove some conflicting packages to avoid issues during upgrade using “dnf remove <pkg>”. Maybe even use “rpm -e –nodeps” to avoid dependency checks and removing lots of packages. Maybe old kernel packages to free space in /boot.
Continue the upgrade after switching to “safe” mode:
# systemctl isolate multi-user.target # Or use Ctrl+Alt+F2. # rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-23-$(uname -i) # dnf upgrade # dnf clean all # dnf --releasever=23 --setopt=deltarpm=false distro-sync
Fixes, checks and cleanup after upgrade reboot:
# system-config-firewall # Had to resave settings to make the server accessible again # dnf remove krb5-auth-dialog-3.15.4-2.fc23.i686 # Get rid of "network credentials expired" dialog at login # yum install kmod-nvidia-PAE # Optionally install proprietary drivers again? # grub2-install /dev/sda # grub2-mkconfig -o /boot/grub2/grub.cfg # yum repolist # package-cleanup --problems # package-cleanup --dupes # package-cleanup --orphans
Do not remove too much. You may also need to fix your squeezebox cpan modules (see above), upgrade owncloud database, etc.