Tag Archives: Debian

Compiling Linux Kernel 3.6.X the debian/ubuntu way for Hyper-V

Here is a guide to compile a kernel 3.6.X kernel for hyper-v the debian way.

sudo apt-get install git-core kernel-package fakeroot build-essential ncurses-dev

#Download the latest kernel
cd /usr/src
sudo wget --continue http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.6.6.tar.bz2
sudo tar jxvf linux-3.6.6.tar.bz2
cd linux-3.6.6

#Copy kernel config to the new source
sudo cp /boot/config-`uname -r` ./.config

#Choice what you want
#Hyper-V is locate at: Device Drivers, Microsoft Hyper-V guest support
sudo make menuconfig

#Compile the kernel
sudo make-kpkg clean
sudo fakeroot make-kpkg --initrd --append-to-version=-hyperv01 kernel_image kernel_headers
cd ..
sudo dpkg -i linux-image-3.6.*
sudo init 6

Get list of installed programs from dead disk ubuntu debian

If you have a dead installation, some will not boot you can use this commands, to get the list of installed programs.
grep -B 1 \
"^Status: install ok installed$" /media/recovery2/var/lib/dpkg/status | \
awk '/^Package:.*$/{print $2"\t\tinstall"}' | \
sort > package.list
And this command to install it on a new installation:
dpkg --set-selections < package.list
apt-get dselect-upgrade

Pureftpd (Ubuntu / Debian)

Setting up Pure ftpd to run on certains port is very simple.
Log on to you linux box and run this command:

echo “60010 60030” > /etc/pure-ftpd/conf/PassivePortRange
/etc/init.d/pure-ftpd restart

or if you run mysql as a backend

/etc/init.d/pure-ftpd-mysql restart

Now you just need to forward port 60010 to 60030, to you linux box.

Debian packages cpio failes to be updated

If you have some troubles upgrading cpio, it returns this error:

Preparing to replace cpio 2.6-18 (using …/cpio_2.6-18.1+etch1_i386.deb) …
Unpacking replacement cpio …
Replaced by files in installed package tar …
dpkg: error processing /var/cache/apt/archives/cpio_2.6-18.1+etch1_i386.deb (–u npack):
unable to create `./usr/share/locale/ko/LC_MESSAGES/cpio.mo’: No such file or d irectory
Errors were encountered while processing:
/var/cache/apt/archives/cpio_2.6-18.1+etch1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Try to run this commands:

mkdir -p /usr/share/locale/ko/LC_MESSAGES
mkdir -p /usr/share/locale/gl/LC_MESSAGES
mkdir -p /usr/share/locale/ru/LC_MESSAGES
mkdir -p /usr/share/locale/tr/LC_MESSAGES
mkdir -p /usr/share/locale/sv/LC_MESSAGES
mkdir -p /usr/share/locale/zh_CN/LC_MESSAGES
mkdir -p /usr/share/locale/da/LC_MESSAGES
mkdir -p /usr/share/locale/nl/LC_MESSAGES

And then the update should be working just fine

Tweaking mySQL in Debian

This guide is not complete to tweak you mySQL on Debian systems, because a good tweak is depending on what you want to use mySQL to.

Key Buffer:
The key buffer holds the indexes of tables in memory, and of cause a bigger key buffer result in faster row lookups. The bigger this value is the better is it, but preventing swaping. good rule of thumb seems to be to use 1/4 of system memory. key_buffer = 256M

Query Cache:
query_cache_size, as the name say it is the total memory available to query caching. query_cache_limit is the maximum number of kilobytes one query may be in order to be cached. If you set this value to high it will prevent a lot of small query to be cached. Setting it to low will prevent bigger query to be cached.
query_cache_size = 128MB
query_cache_limit = 4MB

Table Cache:
If you application need to open a lot of tables, a important variable is table_cache, it is the number of tables a thread can keep open at the same time.
table_cache = 512

The InnoDB Engine:
Allmost everybody do not use InnoDB engine I mySQL, there are using MyISAM istead. Mysql reserved memory for InnoDB, so you could easy skip this Add skip-innodb to you my.cnf file.

Binary Logging:
If you don’t want to replicate data changes to a second server, and don’t use the binary logging as incredimental backup, you can disable this feature.
Comment out this line:
log_bin = /var/log/mysql/mysql-bin.log

[ad]

Installere 2 ens Debian maskiner op.

Det kan være praktisk at nå man skal installere 2 ens maskiner op, bare at finde frem til hvilket pakker der er installeret på den ene, og så overfører dem til den anden, dette gøres nemt med dpkg og dselect.
Først skal vi på maskine1 havde hentede de pakker ud som er installeret på den.

dpkg --get-selections > installedpackages

Så skal vi have overført filen fra maskine1 til maskine2, dette gøres lettes via SCP.

scp installedpackages [email protected]:/root

hvor XXX.XXX.XXX.XXX selvfølgeligt er IP adressen på maskine2.

Herefter gå vi på maskine 2 og henter denne selection.

cd /root
dpkg --clear-selections
dpkg --set-selections < installedpackages

Herefter kører vi dselect.

dselect install

Problems with apt-get in Debian (NO_PUBKEY A70DAF536070D3A1)

I got this error:

W: GPG error: http://security.debian.org testing/updates Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY A70DAF536070D3A1
W: GPG error: ftp://ftp.port80.se testing Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY A70DAF536070D3A1
W: You may want to run apt-get update to correct these problems

This can be resolve but typing:
gpg --keyserver wwwkeys.eu.pgp.net --recv-keys A70DAF536070D3A1
gpg --armor --export A70DAF536070D3A1 | apt-key add -

Debian and build a package from source

I want to build pure-ftpd from source becurs my debian server dosent support capabilities.
So first i download the package:
host:/usr/local/src/# cd /usr/local/src
host:/usr/local/src/# apt-get -b source packagename

Then i change the debian/rules files in the package, so that pure-ftpd not support capabilities. (–without-capabilities)

host:/usr/local/src/# cd pure-ftpd-1.0.21/debian

host:/usr/local/src/#nano rules

Then i compile pure-ftpd.

host:/usr/local/src/# cd ..

host:/usr/local/src/# dpkg-buildpackage -rfakeroot -uc -b

Then I install the pure-ftpd-common and pure-ftpd-mysql

host:/usr/local/src/# cd ..

host:/usr/local/src/# dpkg -i pure-ftpd-common_1.0.21-11.1_all.deb

host:/usr/local/src/# dpkg -i pure-ftpd-mysql_1.0.21-11.1_i386.deb