Difference between revisions of "HowTo's"

From PostgreSQL_wiki
Jump to: navigation, search
(Software matige RAID)
 
(45 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
<big>'''Webhuis HowTo's.'''</big>
 
<big>'''Webhuis HowTo's.'''</big>
  +
* [[Tips and Tricks]]
 
== Common ==
 
== Common ==
=== Uwork apt (lenny) ===
+
=== Webhuis apt (lenny) ===
Uwork maakt gebruik van apt-cache ten behoeve van de snelheid bij nstallaties.
+
Webhuis maakt gebruik van apt-cache ten behoeve van de snelheid bij nstallaties.
 
==== Key voor Webhuis packages ====
 
==== Key voor Webhuis packages ====
Uwork maakt gebruik van in eigen beheer samengestelde packages, waarvoor een key noodzakelijk is.
+
Webhuis maakt gebruik van in eigen beheer samengestelde packages, waarvoor een key noodzakelijk is.
 
wget http://packages.webhuis.nl/debian/dists/webhuis-key.asc
 
wget http://packages.webhuis.nl/debian/dists/webhuis-key.asc
 
apt-key add webhuis-key.asc
 
apt-key add webhuis-key.asc
Line 35: Line 36:
 
Tips and Tricks: [[HowTo%27s#apt_key_update]]
 
Tips and Tricks: [[HowTo%27s#apt_key_update]]
   
  +
== Mac ==
== Fysieke server voor virtualisatie (dom0) ==
 
  +
* http://docs.joomla.org/Migrating_from_1.0.x_to_1.5_Stable
 
  +
* http://www.linuxquestions.org/questions/linux-server-73/how-to-setup-dhcp-reservations-in-a-ldap-enviroment-and...-662440/
* [[HowTo's]]
 
  +
* http://www.novell.com/coolsolutions/feature/19965.html
* Webhuis pagina [[webhuis_info]]
 
  +
* http://macdevcenter.com/pub/a/mac/2004/05/25/ldap.html
=== Hardware checks vooraf ===
 
  +
* http://docs.info.apple.com/article.html?path=ServerAdmin/10.4/en/c7od25.html
 
  +
* http://www.computerworld.com/s/article/9016687/How_to_Understanding_Mac_OS_X_Open_Directory?taxonomyId=157&pageNumber=3
'''Vaststellen''' of de processor 64 of 32 bit is:
 
  +
* http://www.bind9.net/
 
  +
* http://www.openldap.org/lists/openldap-software/200310/msg00412.html
# grep flags /proc/cpuinfo
 
  +
* http://lukecole.name/index.php?subject=howto
 
  +
* http://lukecole.name/index.php?subject=labs
lm = Long Mode = 64 bits
 
Real Mode = 16 bits
 
Protected Mode = 32 bits
 
 
'''Vaststellen''' of de processor virtualisatie ondersteund
 
 
# egrep ‘(vmx|svm)’ /proc/cpuinfo
 
 
=== Software matige RAID ===
 
Voor het bouwen van een softwarematige RAID
 
*in the following menu, scroll to your first disk and hit enter: the partitionier asks you, if you want to create an empty partition table. Say "yes". (Hint: this will erase your existing data, if any.)
 
*The partitioner is back in the disk overview, scroll one line downwards over the line with "FREE SPACE" and hit enter.
 
*Create a partition with the size you need, but remember the size and the logical type.
 
*In the "Partition settings" menu, go to "Use as" and hit enter.
 
*Change the type to "physical volume for RAID".
 
*Finish this partition with "Done setting up the partition".
 
*Create other partitions on the same disk, if you like.
 
*Now repeat all the steps from the first disk for the second disk.
 
After this, you should have at least two disks with the same partition schema and all partitions (beside swap) should be marked for RAID use.
 
*Now look at the first menu entry in the partitioner menu, there is a new line: "Configure software RAID". Go into this menu.
 
*Answer the question, if you like to write the changes, with "Yes".
 
*Now pick "Create MD device".
 
*Use RAID1 and give the number of active and spare devices (2 and 0 in our case).
 
*In the following menu, select the same device number on the first and second disk and Continue.
 
 
Repeat this step for every two devices until you are done. Then use "Finish" from the Multidisk configuration options.
 
 
You are back in the partitioner menu and now you see one ore more new partitions named as "Software RAID Device". You can use this partitions like any normal partition and continue installing your system.
 
 
Meer info op : http://www.howtoforge.com/software-raid1-grub-boot-debian-etch
 
 
=== Ubuntu netinstall (keramic) ===
 
De Ubuntu netinstall heeft een addertje onder het gras. De keuze lijkt tussen Intel i386 en amd64
 
http://ftp.ubuntu.com/ubuntu/dists/karmic/main/installer-i386/current/images/netboot/ubuntu-installer/i386/initrd.gz
 
http://ftp.ubuntu.com/ubuntu/dists/karmic/main/installer-i386/current/images/netboot/ubuntu-installer/i386/linux
 
 
=== Debian netinstall (lenny) ===
 
Als er al een linux versie op de machine aanwezig kan de volgende installatie met een netinstall geschieden door de netinstall images op te nemen in /boot en het grub menu aan te passen.
 
Op deze installatie komt een dom0, dus het is voldoende om ongeveer 8 Gb schijfruimte te nemen voor de linux partitie en 1 Gb voor swap. Op het restant van de schijf komt later een lvm te staan ten behoeve van de xen-domains.
 
http://nsaunders.wordpress.com/2006/11/06/a-usb-stick-grub-and-ubuntu/
 
http://www.debuntu.org/how-to-install-ubuntu-linux-on-usb-bar
 
Als root:
 
# cd /boot
 
AMD-64
 
# wget http://ftp.nl.debian.org/debian/dists/lenny/main/installer-amd64/current/images/netboot/debian-installer/amd64/linux
 
# wget http://ftp.nl.debian.org/debian/dists/lenny/main/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz
 
Intel 32 bits
 
# wget http://ftp.nl.debian.org/debian/dists/lenny/main/installer-i386/current/images/netboot/debian-installer/i386/linux
 
# wget http://ftp.nl.debian.org/debian/dists/lenny/main/installer-i386/current/images/netboot/debian-installer/i386/initrd.gz
 
==== grub ====
 
In menu.lst moet een entry staan voor elk bootable image, bijvoorbeeld:
 
title Lenny netinstall Debian GNU/Linux
 
root (hd0,0)
 
kernel /boot/linux root=/dev/sda1 ro quiet splash ramdisk_size=32768
 
initrd /boot/initrd.gz
 
De waarden van de kernel en de initrd paramteres moeten corresponderen met de exacte naam en pad van de kernel en de initrd.gz ramdisk. Na de aanpassing volgen de commando's:
 
# grub-install /dev/sda
 
# reboot
 
 
=== Xen install ===
 
==== AMD-64 ====
 
# apt-get install xen-linux-system-2.6.26-2-xen-amd64 xen-tools
 
 
==== Intel ====
 
i386
 
# apt-get install xen-linux-system-2.6.26-1-xen-686 xen-tools libvirt0 less xvnc4viewer bzip2 xenstore-utils xenwatch xen-utils-3.2-1
 
xen-hypervisor-3.2-1-i386 xen-hypervisor-i386
 
==== Algemeen ====
 
apt-get install lvm2 xen-tools
 
==== xend-config.cfg ====
 
Configuratie voor dom0 met een enkele netwerkkaart.
 
#
 
# Uwork xen configuratie met network-bridge networkscript
 
#
 
(logfile /var/log/xen/xend.log)
 
(loglevel DEBUG)
 
(network-script network-bridge)
 
(vif-script vif-bridge)
 
(dom0-min-mem 196)
 
(dom0-cpus 0)
 
vnc-listen ''
 
 
==== Xen opzetten ====
 
===== Network brideging =====
 
# vi /etc/xen/xend-config.sxp
 
 
In geval van een enkele ethernet kaart
 
Comment out (network-script network-dummy) voeg toe:
 
(network-script network-bridge)
 
==== Xen multinic opzetten ====
 
De configuratie van een Xen host met meerdere netwerkkaarten is vanaf release 3.2 gewijzigd, oude configuraties werken niet meer. De juiste manier van configureren is moerlijk te vinden, het is vrij slecht gedocumenteerd.
 
 
Voor het opzetten van een multinic host is het noodzakelijk verschilende bestanden in samenhang te wijzigen.
 
* /etc/modules
 
* /etc/xen/scripts/network-multinic
 
* /etc/xen/xend-config.sxp
 
* /etc/network/interfaces
 
N.B. De machine is erg gevoelig voor fouten in de samenhang tussen deze machine. Een fout leidt er doorgaans toe dat het boot proces stopt, of dat de interfaces niet opkomen.
 
===== /etc/modules =====
 
loop max_loop=64
 
options netloop nloopbacks=255
 
===== /etc/xen/scripts/network-multinic =====
 
Plaats het script network-multinic in /etc/xen/scripts en zorgt ervoor dat het uitvoorbaar is:
 
#!/bin/sh
 
#
 
# Uwork network-multinic xen 3.2
 
#
 
dir=$(dirname "$0")
 
#/usr/bin/logger -t xend-network "network-bridge $* vifnum=0, vifnum=1"
 
"$dir/network-bridge" "$@" netdev=eth0 bridge=xen-br0 vifnum=0
 
"$dir/network-bridge" "$@" netdev=eth1 bridge=xen-br1 vifnum=1
 
===== /etc/xen/xend-config.sxp =====
 
Comment out (network-script network-dummy) voeg toe (network-script network-multinic)
 
#
 
# Uwork xen configuratie met multinic networkscript
 
#
 
(network-script network-multinic)
 
(vif-script vif-bridge)
 
(dom0-min-mem 196)
 
(dom0-cpus 0)
 
(vncpasswd '')
 
===== /etc/network/interfaces =====
 
Het opvallende aan de inhoud van het bestand interfaces is dat de vertouwde aanduidingen voor de netwerkinterfaces eth0 en eth1 zijn vervangen door de namen van de bridges xen-br0 en xen-br1.
 
# This file describes the network interfaces available on your system
 
# and how to activate them. For more information, see interfaces(5).
 
#
 
# Uwork xen netwerk configuratie voor xen dom0 multinic
 
#
 
# The loopback network interface
 
auto lo
 
iface lo inet loopback
 
#
 
# The external network interface
 
auto xen-br0
 
allow-hotplug xen-br0
 
iface xen-br0 inet dhcp
 
#
 
auto xen-br1
 
allow-hotplug xen-br1
 
iface xen-br1 inet static
 
address 10.22.23.1
 
netmask 255.255.255.128
 
 
==== LVM ====
 
Nieuw logical volume
 
lvcreate -L <size> (1T) <name> /dev/dev-xen/
 
 
===== lvm =====
 
# pvcreate /dev/sda?
 
# pvdisplay
 
# pvscan
 
Creeer een logical volume
 
# vgcreate dev-xen /dev/sda? (Kan ook bij de install)
 
# vgdisplay
 
===== xen-tools =====
 
Zet de lvm in de xen-tools configuratie
 
# vi /etc/xen-tools/xen-tools.conf
 
lvm = dev-xen
 
Zorg voor een root password door uncomment van:
 
passwd = 1
 
Zorg voor console access door onderstaande regel toe te voegen:
 
serial_device = hvc0
 
====== xen-tools.conf ======
 
lvm = dev-xen
 
install-method = debootstrap
 
size = 8Gb # Disk image size.
 
memory = 128Mb # Memory size
 
swap = 128Mb # Swap size
 
fs = ext3 # use the EXT3 filesystem for the disk image.
 
dist = lenny # Default distribution to install.
 
image = sparse # Specify sparse vs. full disk images.
 
passwd = 1
 
kernel = /boot/vmlinuz-`uname -r`
 
initrd = /boot/initrd.img-`uname -r`
 
mirror = http://mirror.webhuis.nl:3142/ftp.us.debian.org/debian/
 
ext3_options = noatime,nodiratime,errors=remount-ro
 
ext2_options = noatime,nodiratime,errors=remount-ro
 
xfs_options = defaults
 
reiser_options = defaults
 
serial_device = hvc0
 
 
== Virtuele server (domU) ==
 
=== Bouwen van een virtuele server ===
 
xen-create-image --verbose --force --hostname=ips-vpn --ip=10.68.71.200 --netmask=255.255.255.240 --gateway=10.68.71.193 --size=8gb
 
--debootstrap --dist=lenny --mirror=http://mirror.webhuis.nl:3142/ftp.nl.debian.org/debian --role=udev
 
Aanpassen xmdomain.cfg:
 
Voeg toe onder de memory parameter:
 
extra = "clocksource=jiffies"
 
Herstart de domU
 
   
 
== [[Configuratie van applicaties]] ==
 
== [[Configuratie van applicaties]] ==
Uwork zit in het proces van uitbreiden en verbeteren van geautomatiseerde configuratie van applicaties. Uwork genereert reeds complete en complexe configuraties voor samba-ldap en de vpn-router op basis van racoon. De pagina [[Configuratie van applicaties]] bevat de princioes waarop de configuratie plaatsvindt.
+
Webhuis zit in het proces van uitbreiden en verbeteren van geautomatiseerde configuratie van applicaties. Webhuis genereert reeds complete en complexe configuraties voor samba-ldap en de vpn-router op basis van racoon. De pagina [[Configuratie van applicaties]] bevat de princioes waarop de configuratie plaatsvindt.
   
 
== Tips and Tricks ==
 
== Tips and Tricks ==
  +
== Debian ==
  +
=== Corrupt passwd ===
  +
Als passwd corrupt is, dan start de machine niet op. In [http://wiki.webhuis.nl/index.php/KVM#Reset_root_password|single user mode] is de prompt:<br/>
  +
I do not know my name@none:#<br/>
  +
Verder kun je niets. Stappen om er uit te komen:
  +
<pre>
  +
# mount -rw -o remount /
  +
# pwconv
  +
# passwd
  +
# sync
  +
# reboot
  +
</pre>
  +
Nuttige link:
  +
http://www.cyberciti.biz/tips/recovering-deleted-etcshadow-password-file.html
  +
  +
=== wheezy ===
  +
=== laptop ===
  +
http://forum.thinkpads.com/viewtopic.php?f=9&t=98479
  +
Status van de touchpad, kan als user:
  +
synclient -l
  +
In een terminal enabling touchpad:
  +
synclient TapButton1=1
  +
Definitiever in 50-synaptics.conf, /etc/X11/xsession.d :
  +
Option "TapButton1" "1"
  +
* http://unix.stackexchange.com/questions/43933/xfce4-loses-title-bars-on-all-windows
  +
Xfce's window manager crashed for some reason and the simple fix is to run xfwm4 in console.
   
 
=== Lenny ===
 
=== Lenny ===
 
==== Problems:====
 
==== Problems:====
===== Netwerk domU =====
 
De netwerkinterface van de domU werkt niet op de Intel machine. De vpn-router werkt wel, maar de toegevoegde machines niet.
 
 
 
===== slurpd vervangen =====
 
===== slurpd vervangen =====
 
===== DNS =====
 
===== DNS =====
Line 251: Line 87:
 
Lenny maakt standaard gebruik van ipv6 en name resolution loopt fout:
 
Lenny maakt standaard gebruik van ipv6 en name resolution loopt fout:
 
dc01:~# cat /etc/resolv.conf
 
dc01:~# cat /etc/resolv.conf
#search uwork.nl
+
#search webhuis.nl
 
nameserver 38.99.20.68
 
nameserver 38.99.20.68
 
nameserver 208.69.39.2
 
nameserver 208.69.39.2
Line 270: Line 106:
   
 
==== Solved ====
 
==== Solved ====
  +
===== datum =====
  +
date +%Y%m%d%T -s "20111120 13:31:00"
  +
===== Netwerk domU =====
  +
De netwerkinterface van de domU werkt niet op de Intel machine. De vpn-router werkt wel, maar de toegevoegde machines niet.
  +
  +
De interface op de dom0 in /etc/network/interfaces moeten de naam xen-brx krijgen scripts gaan analoog.
  +
 
===== xm console werkt niet op de Intel machine =====
 
===== xm console werkt niet op de Intel machine =====
   
Line 286: Line 129:
 
W: You may want to run apt-get update to correct these problems
 
W: You may want to run apt-get update to correct these problems
 
Oplossing:
 
Oplossing:
gpg --keyserver subkeys.pgp.net --recv 9AA38DCD55BE302B
+
gpg --keyserver keys.gnupg.net --recv 9AA38DCD55BE302B
 
gpg --export --armor 9AA38DCD55BE302B | apt-key add -
 
gpg --export --armor 9AA38DCD55BE302B | apt-key add -
  +
Keyservers:
===== lvextend =====
 
  +
* gpg-keyserver.de
Voorbeeld uitbreiden logical volume:
 
  +
* pgp.mit.edu
# lvextend -L+400M /dev/dev-xen/winxp.img
 
  +
* subkeys.pgp.net
 
  +
* keys.gnupg.net
  +
===== apt InRelease update =====
  +
apt-get update levert een error op:
  +
N: Repository 'http://ftp.uk.debian.org/debian buster InRelease' changed its 'Version' value from '10.19' to '10.13'
  +
E: Repository 'http://ftp.uk.debian.org/debian buster InRelease' changed its 'Suite' value from 'stable' to 'oldstable'
  +
Oplossing:
  +
# apt-get update --allow-releaseinfo-change
 
===== subversion =====
 
===== subversion =====
Localtime is gewijzigd van file naar sysmbolic link, dat resulteert in de volgende fout:
+
Localtime is gewijzigd van file naar symbolic link, dat resulteert in de volgende fout:
 
# cfengine2:/var/backups/cfengine2# svn commit -m "handmatig 20090921"
 
# cfengine2:/var/backups/cfengine2# svn commit -m "handmatig 20090921"
 
svn: Commit failed (details follow):
 
svn: Commit failed (details follow):
Line 365: Line 215:
 
Oplossing:
 
Oplossing:
 
De dom0 was verkeerd geinstalleerd. Volg de wiki van debian.org en installeer xen-linx-system
 
De dom0 was verkeerd geinstalleerd. Volg de wiki van debian.org en installeer xen-linx-system
  +
=== find is your friend ===
  +
* http://www.mysysad.com/2007/07/using-common-unix-find-command_07.html
  +
==== Verwijderen ^M in directory tree ====
  +
Het verwijderen van de vermaledijde "control M, of ^M" in alle bestanden in een hele directory gaat als volgt:
  +
<pre>
  +
find -type f -name "*.txt" -exec sed -i 's/^M//g' {} \;
  +
  +
find . -name \*[xml..dtd..sh] | xargs tar cvf ~/configs.tar
  +
  +
</pre>
  +
  +
=== Scripts ===
  +
==== Verwijderen bepaalde ASCII code in een bestand ====
  +
Het is bedrijfszekerder om ASCII codes met directe referentie aan de code te wijzigen of te verwijderen:
  +
sed -i 's/\x00//g' asg-dump.txt
  +
==== Octaal weergeven permissies ====
  +
Gebruik dit statement om de permissies in octale vorm weer te geven.
  +
ls -l | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf("%0o ",k);print}'
  +
ls|while read i; do echo -ne "$i\t"; stat "$i"|sed -n -e 4p|cut -f2 -d" "|cut -b 2-5;done|awk '&#123;print $2,$1&#125;'
  +
  +
==== Backup volume over het network met dd en ssh ====
  +
* http://www.pantz.org/software/dd/drivecopywithsshanddd.html
  +
<pre>
  +
dd if=/dev/dev-xen/data-disk | ssh user@10.99.99.99 dd of=/home/beheerder/data-disk
  +
dd if=/dev/dev-xen/data-disk | gzip -1 - | ssh user@10.99.99.99 dd of=/home/beheerder/data-image.gz
  +
</pre>
  +
==== Restore volume ====
  +
Restore gaat met:
  +
<pre>
  +
root@hist:~# dd if=wbhs-pkg-disk.tgz | gunzip -1 - | dd of=/dev/kvm-data/big-data
  +
mount -t ext3 /dev/kvm-data/big-data /mnt
  +
</pre>
  +
  +
==== Archiveren over het netwerk ====
  +
<pre>
  +
tar cvf - . | gzip -c -1 | ssh user@10.99.99.99 cat ">" remote-tar-file.gz
  +
ssh target_address cat <localfile ">" remotefile
  +
</pre>
  +
  +
==== Restore MBR ====
  +
If things get messed up, you can boot with a Linux CD, mount the partition containing /root (hda1 in this example) and put back the MBR with the command:
  +
dd if=/mnt/hda1/root/hda.boot.mbr of=/dev/hda bs=512 count=1
  +
==== Strippen characters ====
  +
Null characters verwijderen:
  +
tr -d '\000' < adressen-android.csv > adressen-android-2.csv
  +
sed 's/\x0//g' adressen-android.csv > adressen-android-3.csv
  +
  +
=== Ubuntu Lucid ===
  +
==== Restore panel ====
  +
Als de taskbar of het panel is overleden, open je met alt-F2 een commando venster:
  +
<pre>
  +
alt-F2
  +
killall plasma-desktop
  +
ff wachte....
  +
alt-F2
  +
plasma-desktop
  +
</pre>
  +
that should do it.
  +
  +
==== smbmount ====
  +
De smbmount als user levert bij Lucid Lynx problemen op. Het probleem ligt in de suid bit. De oplossing komt van een Ubuntu forum.
  +
dutchy@vampire:~$ mount.cifs //dragon/dutchy dragon/
  +
Password:
  +
mount error(1): Operation not permitted
  +
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
  +
Dit is hetzelfe als:
  +
martin@dell:~$ smbmount //samba.webhuis.nl/share ~/share -o user=martin,pass=xxxxxxxx
  +
mount error(1): Operation not permitted
  +
Hetzelfde probleem geldt bij de umount operatie. De oplossing:<br/>
  +
Setting the set uid bit fixed the problem:
  +
dutchy@vampire:~$ sudo chmod +s /sbin/mount.cifs
  +
of
  +
root@dell:~# chmod +s /sbin/mount.cifs
  +
root@dell:~# chmod u+s /sbin/umount.cifs
  +
Sjoerd Visser heeft er een mooie tutorial over geschreven: http://www.sjoerd-visser.demon.nl/net-linux/samba.html#Shares%20mounten%20met%20smbmount
  +
<hr/>
  +
Terug naar: [[Main Page]]

Latest revision as of 16:58, 29 December 2023

Webhuis HowTo's.

Common

Webhuis apt (lenny)

Webhuis maakt gebruik van apt-cache ten behoeve van de snelheid bij nstallaties.

Key voor Webhuis packages

Webhuis maakt gebruik van in eigen beheer samengestelde packages, waarvoor een key noodzakelijk is.

wget http://packages.webhuis.nl/debian/dists/webhuis-key.asc
apt-key add webhuis-key.asc

sources.list

deb http://mirror.webhuis.nl:3142/ftp.nl.debian.org/debian/ lenny main
deb-src http://mirror.webhuis.nl:3142/ftp.nl.debian.org/debian/ lenny main
deb http://mirror.webhuis.nl:3142/security.debian.org/ lenny/updates main
deb-src http://mirror.webhuis.nl:3142/security.debian.org/ lenny/updates main
deb http://mirror.webhuis.nl:3142/volatile.debian.org/debian-volatile lenny/volatile main
deb-src http://mirror.webhuis.nl:3142/volatile.debian.org/debian-volatile lenny/volatile main
# root@udell:~# cat /etc/papersize
a4
# root@udell:~# dpkg-reconfigure libpaper1
Replacing config file /etc/papersize with new version
# root@udell:~# cat /etc/papersize
letter
# root@udell:~# dpkg-reconfigure libpaper1
Replacing config file /etc/papersize with new version
# root@udell:~# cat /etc/papersize
a4

Dit werkt nog niet voor AMD-64:

#
#  Packages Webhuis
#
deb     http://mirror.webhuis.nl:3142/packages.webhuis.nl/debian     etch non-free

Tips and Tricks: HowTo's#apt_key_update

Mac

Configuratie van applicaties

Webhuis zit in het proces van uitbreiden en verbeteren van geautomatiseerde configuratie van applicaties. Webhuis genereert reeds complete en complexe configuraties voor samba-ldap en de vpn-router op basis van racoon. De pagina Configuratie van applicaties bevat de princioes waarop de configuratie plaatsvindt.

Tips and Tricks

Debian

Corrupt passwd

Als passwd corrupt is, dan start de machine niet op. In user mode is de prompt:

I do not know my name@none:#

Verder kun je niets. Stappen om er uit te komen:

# mount -rw -o remount /
# pwconv
# passwd
# sync
# reboot

Nuttige link: http://www.cyberciti.biz/tips/recovering-deleted-etcshadow-password-file.html

wheezy

laptop

http://forum.thinkpads.com/viewtopic.php?f=9&t=98479

Status van de touchpad, kan als user:

synclient -l

In een terminal enabling touchpad:

synclient TapButton1=1

Definitiever in 50-synaptics.conf, /etc/X11/xsession.d :

Option "TapButton1" "1"

Xfce's window manager crashed for some reason and the simple fix is to run xfwm4 in console.

Lenny

Problems:

slurpd vervangen
DNS

master slave werkt niet goed

Lenny maakt standaard gebruik van ipv6 en name resolution loopt fout:

dc01:~# cat /etc/resolv.conf
#search webhuis.nl
nameserver 38.99.20.68
nameserver 208.69.39.2
#nameserver 10.20.31.35
dc01:~# ping opendns.org
ping: unknown host opendns.org
Lenny NT access denied
hvm op lenny

werkt niet, daardoor is win2008 niet op lenny te installeren

xm create /etc/xen/win2008-32g-install.cfg

No login prompt when using `xm console`

Using a lenny domU, make sure you have hvc0 listed in inittab, like 1:2345:respawn:/sbin/getty 38400 hvc0. There happened to be a lot of changes of default console unit used by Xen (tty1, xvc0, hvc0 etc) but for a Lenny domU (version > 2.6.26-9) it's hvc0.

Solved

datum

date +%Y%m%d%T -s "20111120 13:31:00"

Netwerk domU

De netwerkinterface van de domU werkt niet op de Intel machine. De vpn-router werkt wel, maar de toegevoegde machines niet.

De interface op de dom0 in /etc/network/interfaces moeten de naam xen-brx krijgen scripts gaan analoog.

xm console werkt niet op de Intel machine

Het opstarten van het console blijft steken.

Oplossing: Lenny xen werkt met een andere console definitie. Toevoegen in de <domain>.cfg:

extra       = 'console=hvc0 xencons=tty'
apt key update

apt-get update levert een error op:

W: GPG error: http://mirror.webhuis.nl etch Release: The following signatures couldn't be verified because
the public key is not available:  NO_PUBKEY 9AA38DCD55BE302B
W: GPG error: http://mirror.webhuis.nl etch/updates Release: The following signatures couldn't be verified because
the public key is not available: NO_PUBKEY 9AA38DCD55BE302B
W: You may want to run apt-get update to correct these problems

Oplossing:

gpg --keyserver keys.gnupg.net --recv 9AA38DCD55BE302B
gpg --export --armor 9AA38DCD55BE302B | apt-key add -

Keyservers:

  • gpg-keyserver.de
  • pgp.mit.edu
  • subkeys.pgp.net
  • keys.gnupg.net
apt InRelease update

apt-get update levert een error op: N: Repository 'http://ftp.uk.debian.org/debian buster InRelease' changed its 'Version' value from '10.19' to '10.13' E: Repository 'http://ftp.uk.debian.org/debian buster InRelease' changed its 'Suite' value from 'stable' to 'oldstable' Oplossing:

  1. apt-get update --allow-releaseinfo-change
subversion

Localtime is gewijzigd van file naar symbolic link, dat resulteert in de volgende fout:

# cfengine2:/var/backups/cfengine2# svn commit -m "handmatig 20090921"
svn: Commit failed (details follow):
svn: Entry '/var/backups/cfengine2/etc/localtime' has unexpectedly changed special status

Oplossing:

# cfengine2:/var/backups/cfengine2# svn pd svn:special etc/localtime
property 'svn:special' deleted from 'etc/localtime'.
# cfengine2:/var/backups/cfengine2# svn rm etc/localtime
D         etc/localtime 
# cfengine2:/var/backups/cfengine2# svn commit -m "handmatig 20090921"
Transmitting file data ...
Committed revision 224.
TLS bij ldap
http://rustykruffle.com/tech-stuff/ubuntu/ultimate-home-server-ldap-gnutls-nightmare/

try

ldd $(which slapd)

you may see, that slapd is build with gnutls and not openssl :-)

You have two different solutions to fix this:

1. use the tool certtool from gnutls in package gnutls-bin. doc is in gnutls-doc or use the doc from the qemu/kvm packages and look their for vnc.

2. create a copy of /etc/ssl/certs/cacert.pem and reorder your certificates. gnutls expects just the opposite order as openssl :-(

De oplossing:

   - Comment out TLSCipherSuite settings on upgrade from all versions prior
     to 2.4.7-5, and throw a debconf error to the user notifying them of
     this, since all OpenSSL cipher suite values are incompatible with
     GnuTLS.
Clock

Problem

domU verzuipt in clocksource meldingen en is niet responsief.

Workaround In your domU /etc/sysctl.conf add the line:

xen.independent_wallclock=1.

On the dom0, edit the configuration file of the domU (e.g. /etc/xen/foobar.cfg and add (or expand) the extra-line:

extra="clocksource=jiffies".

These settings can be activated without rebooting the domU. After editing the configuration files, issue

# sysctl -p and echo "jiffies"> /sys/devices/system/clocksource/clocksource0/current_clocksource

on the domU prompt.

# sysctl -p
# echo "jiffies"> /sys/devices/system/clocksource/clocksource0/current_clocksource

Because the clock won't be relying on the dom0 clock anymore, you probably need to use ntp on the domU to synchronize it properly to the world.

Na een reboot staat de clock op jiffies zonder het echo commando. In Xen luistert de domU zonder ntp naar de clock van de dom0

tty

Domain is na create niet te benaderen.

PTY allocation request failed on channel 0
stdin: is not a tty
                  

Voeg aan de xen-create het volgende toe:

--role=udev
xen-create-image --verbose --force --hostname=mi-m --ip=10.37.41.11 --netmask=255.255.255.128 --gateway=10.37.41.1 --size=8gb
                 --debootstrap --dist=lenny --mirror=http://mirror.webhuis.nl:3142/ftp.nl.debian.org/debian --role=udev
lib/modules

Op de AMD-64:

ontbreekt, vpn-router werkt niet

Op de Intel machine werkt het wel.

Oplossing: De dom0 was verkeerd geinstalleerd. Volg de wiki van debian.org en installeer xen-linx-system

find is your friend

Verwijderen ^M in directory tree

Het verwijderen van de vermaledijde "control M, of ^M" in alle bestanden in een hele directory gaat als volgt:

find -type f -name "*.txt" -exec sed -i 's/^M//g' {} \;

find . -name \*[xml..dtd..sh] | xargs tar cvf ~/configs.tar

Scripts

Verwijderen bepaalde ASCII code in een bestand

Het is bedrijfszekerder om ASCII codes met directe referentie aan de code te wijzigen of te verwijderen:

sed -i 's/\x00//g' asg-dump.txt

Octaal weergeven permissies

Gebruik dit statement om de permissies in octale vorm weer te geven.

ls -l | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf("%0o ",k);print}'
ls|while read i; do echo -ne "$i\t"; stat "$i"|sed  -n -e 4p|cut -f2 -d" "|cut -b 2-5;done|awk '{print $2,$1}'

Backup volume over het network met dd en ssh

dd if=/dev/dev-xen/data-disk | ssh user@10.99.99.99 dd of=/home/beheerder/data-disk
dd if=/dev/dev-xen/data-disk | gzip -1 - | ssh user@10.99.99.99 dd of=/home/beheerder/data-image.gz

Restore volume

Restore gaat met:

root@hist:~# dd if=wbhs-pkg-disk.tgz | gunzip -1 - | dd of=/dev/kvm-data/big-data
mount -t ext3 /dev/kvm-data/big-data /mnt

Archiveren over het netwerk

tar cvf - . | gzip -c -1 | ssh user@10.99.99.99 cat ">"  remote-tar-file.gz 
ssh target_address cat <localfile ">" remotefile

Restore MBR

If things get messed up, you can boot with a Linux CD, mount the partition containing /root (hda1 in this example) and put back the MBR with the command:

dd if=/mnt/hda1/root/hda.boot.mbr of=/dev/hda bs=512 count=1

Strippen characters

Null characters verwijderen:

tr -d '\000' < adressen-android.csv > adressen-android-2.csv
sed 's/\x0//g' adressen-android.csv > adressen-android-3.csv

Ubuntu Lucid

Restore panel

Als de taskbar of het panel is overleden, open je met alt-F2 een commando venster:

alt-F2
killall plasma-desktop
ff wachte....
alt-F2
plasma-desktop

that should do it.

smbmount

De smbmount als user levert bij Lucid Lynx problemen op. Het probleem ligt in de suid bit. De oplossing komt van een Ubuntu forum.

dutchy@vampire:~$ mount.cifs //dragon/dutchy dragon/
Password:
mount error(1): Operation not permitted
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

Dit is hetzelfe als:

martin@dell:~$ smbmount //samba.webhuis.nl/share ~/share -o user=martin,pass=xxxxxxxx
mount error(1): Operation not permitted

Hetzelfde probleem geldt bij de umount operatie. De oplossing:
Setting the set uid bit fixed the problem:

dutchy@vampire:~$ sudo chmod +s /sbin/mount.cifs

of

root@dell:~# chmod +s /sbin/mount.cifs
root@dell:~# chmod u+s /sbin/umount.cifs

Sjoerd Visser heeft er een mooie tutorial over geschreven: http://www.sjoerd-visser.demon.nl/net-linux/samba.html#Shares%20mounten%20met%20smbmount


Terug naar: Main Page