How to reinstall Grub 2 to master boot record

How to reinstall Grub 2 to master boot record https://answers.launchpad.net/me-tv/+question/79735 GRUB Using Ubuntu livecd Here assuming the Ubuntu partition is sda7 and /boot partition is sda6 (if you have a separate /boot partition). Boot up ubuntu from the livecd, open terminal and run: sudo -i mount /dev/sda7 /mnt mount /dev/sda6 /mnt/boot  #skip this one if … Read more

Securing a New Linux Installation

http://linuxgazette.net/105/odonovan.html Linux Internet Server Security and Configuration Tutorial http://www.yolinux.com/TUTORIALS/LinuxTutorialInternetSecurity.html Install basic security tools aptitude install portsentry fail2ban denyhosts logwatch rkhunter Configure basic security tools OSSEC http://www.ossec.net/main/manual/manual-installation http://dcid.me/texts/my-ossec-setup-manual.php apt-get install gcc make libc-dev wget http://www.ossec.net/files/ossec-hids-2.6.tar.gz tar zxvf ossec-hids-2.6.tar.gz cd ossec-hids-2.6 sudo ./install.sh Select: local (if you only have one system to monitor), root@localhost, enable active response … Read more

Aptitude

Záloha a obnova nainstalovaných balíčků Pokud budete zálohovat Debian nebo na něm založenou distribuci, budete asi chtít zálohovat spíše seznam explicitně nainstalovaných balíčků než seznam všech nainstalovaných balíčků. Pokud používáte nástroj Aptitude, pak víte, že tento nástroj si zapamatuje, co bylo nainstalováno jen jako závislost, a pokud pak odinstalujete původní balíček, Aptitude vám nabídne k … Read more

HTPC a NAS configuration

Aktuální HW konfigurace – položky: skříň: Cooler Master Elite 361 základní deska: ASUS P8H61-M PRO (rev 3.0) CPU: Intel Pentium G630T RAM: Kingston 4GB KIT DDR3 1600MHz CL9 HyperX blu Edition SSD: ADATA Premier SP800 32GB HDD: Western Digital Green 2000GB 64MB cache (2x) NIC: AXAGO PCEE-GR Zdroj: Chieftec GPS-450A Chladič: Zalman CNPS8900 quiet Monitor: … Read more

Apache2 security – mod_rewrite, mod_security

Enable mod_rewrite in Apache2 http://www.grosseosterhues.com/2011/07/enabling-mod-security-protection-in-apache2-on-ubuntu/ http://www.linuxlog.org/?p=135 a2enmod rewrite /etc/apache2/sites-available/000-default Options Indexes FollowSymLinks MultiViews AllowOverride all Order allow,deny allow from all /etc/init.d/apache2 restart .htaccess <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> Enable mod_evasive and mod_security in Apache2 aptitude install libapache-mod-security libapache2-mod-evasive a2enmod … Read more

SSH Port Forwarding (SSH Tunneling)

http://www.linuxhorizon.ro/ssh-tunnel.html Syntax: ssh -L localport:host:hostport user@ssh_server -N where: -L – port forwarding parameters (see below) localport – local port (chose a port that is not in use by other service) host – server that has the port (hostport) that you want to forward hostport – remote port -N – do not execute a remote command, … Read more

Installing WordPress on Ubuntu

http://www.ubuntugeek.com/installing-wordpress-3-0-on-ubuntu-10-04-lucid-lynx.html Installation apt-get install apache2 libapache2-mod-php5 mysql-server php5-mysql php5-curl php5-gd libssh2-php cd /var/www/ wget http://wordpress.org/latest.tar.gz tar -zxvf latest.tar.gz ls -la chown -R www-data:www-data wordpress rm -f latest.zip Apache /etc/apache2/sites-available/wordpress.conf <VirtualHost *:80>         ServerAdmin my@email.com         ServerName www.example.org         ServerAlias example.org         DocumentRoot /var/www/wordpress         Redirect permanent / https://www.example.org/         ErrorLog /var/log/apache2/example.org-error.log         # Possible values include: debug, info, notice, warn, error, crit, … Read more

Linux counter client

http://linuxcounter.net http://linuxcounter.net/user/207256.html Register new machine and get LiCo “Machine ID” and “Update key”. 1. Login to your profile. userid 207256 password xyz 2. Add user cron to launch Linux counter update script. useradd -m cron 3. Install lico-update.sh script. cd /usr/local/bin wget -N –no-cache https://github.com/alexloehner/linuxcounter-update-examples/raw/master/_official/lico-update.sh chown root:root /usr/local/bin/lico-update.sh chmod 755 /usr/local/bin/lico-update.sh 4. Install cron.d job. … Read more

DynDNS Linux client

http://www.dyndns.com janfai / jan.faix@gmail.com Linux Update Client http://dyn.com/support/clients/linux/ Update Client Configurator http://www.dyndns.com/support/tools/clientconfig.html hosts: faix.homelinux.net 94.230.149.155 zviretnik.dyndns.info 94.143.171.101 wget -N –no-cache http://cdn.dyndns.com/ddclient.tar.gz tar -zxvf ddclient.tar.gz cd ddclient-3.7.3 cp ddclient /usr/local/bin/ chown root:root /usr/local/bin/ddclient chmod 750 /usr/local/bin/ddclient mkdir /etc/ddclient /etc/ddclient/ddclient.conf daemon=600 syslog=yes cache=/tmp/ddclient.cache mail-failure=jan.faix@gmail.com pid=/var/run/ddclient.pid use=web, web=checkip.dyndns.com/, web-skip='IP Address' login=janfai password=xxxxxxx protocol=dyndns2 server=members.dyndns.org faix.homelinux.net chown root:root /etc/ddclient/ddclient.conf … Read more

Linux mini-howto

# Linux je operační systém s monolitickým jádrem. Moduly jsou objektové soubory, dynamické části jádra. Umožňují rozšířit za běhu funkce stávajícího jádra (LKM = Linux Loadable Kernel Module). # daemons basic operations /etc/init.d/apache status /etc/init.d/apache restart # filter file content cat /var/log/… | grep (192.168….) -v 9190 | grep 192.168…. | more tail -f /var/log/… … Read more