Author Archives: jan

Generate certificate StartSSL for virtual hosts in Apache

Generate certificate StartSSL for virtual hosts in Apache

openssl req -new -newkey rsa:2048 -nodes -out /etc/ssl/user.zviretnik.csr -keyout /etc/ssl/private/user.zviretnik.key -subj "/C=CZ/ST=cs/L=Praha/O=/CN=user.zviretnik.eu"
chmod 640 /etc/ssl/private/user.zviretnik.key

https://www.startssl.com/

copy StartSSL certificate to:
touch /etc/ssl/user.zviretnik.cer

Show content of CSR:
openssl req -in user.zviretnik.csr -noout -text

Repair splash screen of Ubuntu or Linux Mint

Quick Tip: Fix for Ugly Plymouth themes in Ubuntu / Mint
http://www.ubuntugeek.com/quick-tipplymouth-themes-in-ubuntu-10-04-lucid-lynx.html

Quick tip for those having trouble with their splash screens in Ubuntu / Mint.

To change the default splash screen:

sudo update-alternatives --config default.plymouth
sudo update-initramfs -u

To fix the delayed loading of the splash:

sudo -s
echo FRAMEBUFFER=y >>/etc/initramfs-tools/conf.d/splash
update-initramfs -u

Postfix satellite configuration

dpkg-reconfigure postfix

/etc/mailname

faix.homelinux.net

/etc/aliases

postmaster: root
webmaster: root
www-data: root
jan: jan.faix@gmail.com
wassana: fern.cht@gmail.com
root: jan.faix@gmail.com

newaliases

/etc/postfix/relay_passwd

mail.faix.cz mail:xxxxxxxx

chown root:root /etc/postfix/relay_passwd
postmap /etc/postfix/relay_passwd

/etc/postfix/main.cf

myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
myhostname = home-desktop
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = faix.homelinux.net, home-desktop, localhost.localdomain, localhost
relayhost = mail.faix.cz
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/relay_passwd
smtp_sasl_security_options =
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 800000000
message_size_limit = 100000000
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
mail_owner = postfix
mydomain = faix.homelinux.net
mynetworks = 127.0.0.0/8 192.168.122.0/24
compatibility_level = 2

/etc/init.d/postfix restart

SASL authentication:

apt-get install libsasl2-modules sasl2-bin

Set password for user “mail”:

add user "postfix" to group "sasl"
usermod -a -G sasl postfix

/etc/init.d/postfix restart
/etc/init.d/saslauthd restart

Hosting multiple websites with Apache2

http://www.debian-administration.org/articles/412
http://fob.po8.org/node/289

If you are running multiple websites with Apache2 with mixed ports (usually http port 80, https port 443) change following configuration files. Variable NameVirtualHost should be only in file virtual.conf, find and comment it in other configuration files!

FOB: I recently reported being stuck trying to set up multiple SSL name-based virtual hosts on the same IP address with non-SSL name-based virtual hosts. Soon after, I figured it out. Shortly after that, one of my students suggested the same solution to me.

/etc/apache2/conf.d/virtual.conf

#
# We're running multiple virtual hosts.
#
NameVirtualHost *:80
NameVirtualHost *:443

/etc/apache2/sites-enabled

<VirtualHost *:80>
ServerAdmin webmaster@zviretnik.eu
ServerName zviretnik.eu
ServerAlias www.zvietnik.eu
...

<VirtualHost *:443>
ServerAdmin webmaster@zviretnik.eu
ServerName www.zviretnik.eu
ServerAlias zviretnik.eu
...

The ports 80 and 443 should be also defined in following configuration file.

/etc/apache2/ports.conf

Listen 80
<IfModule mod_ssl.c>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>

Also check your /etc/hosts file, if DNS name and IP address is correct.

127.0.0.1 localhost zviretnik.eu
94.143.171.113 zviretnik.eu zvire

Přírodní recepty

Přírodní projímadlo (uchovávat max. 2-4 dny)

6-8 čerstvých fíků, miska Kasie sennové nebo úzkolisté (Cassia senna / angustifolia), 100 g cukru, 1 limetka
vylouhovat kasii, scezený vývar rozmixovat s fíky
hmotu přivést k varu se 100 g cukru, odstavit a smíchat s 1/2 limetkové šťávy

Gel proti akné (uhovávat max. 6 týdnů)

měsíček (calondola oficialis), sklidit hned po rozkvětu
smíchat hrst květů měsíčku a hrst levandule s kakustem bahenním zalít 2,5 dcl horké vody
louhovat max. 10 min., rozmixovat a scedit přes síto s látkou
do roztoku přidat kolagen (vegetariánská želatina smíchaná s 2 lžícemi vody)
nechat schladnout, přidat pár kapek tee tree oil a 1 panáka vodky

FreeNX remote desktop access

https://help.ubuntu.com/community/FreeNX

FreeNX is a system that allows you to access your desktop from another machine over the Internet. You can use this to login graphically to your desktop from a remote location. One example of its use would be to have a FreeNX server set up on your home computer, and graphically logging in to the home computer from your work computer, using a FreeNX client.

It’s Open Source, secure (SSH based), fast and versatile! License: GPL

FreeNX server:

sudo add-apt-repository ppa:freenx-team
sudo apt-get install python-software-properties
sudo sed -i 's/natty/lucid/g' /etc/apt/sources.list.d/freenx-team-ppa-natty.list
sudo apt-get update
sudo apt-get install freenx
wget https://bugs.launchpad.net/freenx-server/+bug/576359/+attachment/1378450/+files/nxsetup.tar.gz
tar -xvf nxsetup.tar.gz
sudo cp nxsetup /usr/lib/nx/nxsetup
sudo /usr/lib/nx/nxsetup --install
scp /var/lib/nxserver/home/.ssh/client.id_dsa.key client-user@cliet-machine:/~
sudo /etc/init.d/freenx-server start

By default, nxserver uses port 22 for communicating over SSH.
/etc/ssh/sshd_config
/etc/nxserver/node.conf

# The port number where local ‘sshd’ is listening.

SSHD_PORT=22

FreeNX client:
sudo apt-get install qtnx

Firefox favorite addons and settings

WOT – Safe Browsing Tool
Tab Mix Plus
Firefox Sync
FlashGot
NoScript
Cookie Monster
Flagfox
User Agent Switcher
Google Hangouts

Adobe – Flash Player: Settings manager – Global Storage Settings panel:

http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager03.html

Panopticlick tests your browser to see how unique it is:
https://panopticlick.eff.org/

Multimedia plug-in for Gecko browsers
aptitude install gecko-mediaplayer

Apache2 – WordPress & Gallery solutions

If Apache server status page http://zviretnik.eu/server-status error 403 page not found appear, the solution could be modification of .htaccess file of WordPress. Mode rewrite has to have following rule:

# Stop Processing if you see server-info or server-status
RewriteRule ^(server-info|server-status) - [L]
# The Rewrite Condition below did not work
# RewriteCond %{REQUEST_URI} !=/server-status

Don’t forget, that server status is accessible mostly only from localhost. If you want to change it, you have to edit /etc/apache2/mods-enabled/status.conf (Allow from localhost).

In case you upgrade to Apache2, it may happen that your Gallery 3 show following error message when you try to change permission on album or photo:

Oh no! Your server needs a configuration change in order for you to hide photos! Ask your server administrator to enable mod_rewrite and set AllowOverride? FileInfo? Options to fix this.

If you have mode rewrite enabled (a2enmod rewrite) and your virtual host directory configuration already contain “AllowOverride FileInfo Options“, than problem could be in your /etc/hosts file. The localhost entry has to have also FQDN name of your server, for example:

127.0.0.1       localhost       zviretnik.eu