repostiroy Best list ever: https://sites.google.com/site/mydebiansourceslist/ --- #additional packages: apt-get install wget bzip2 rdate unzip zip less lftp nmap openssl lynx links-ssl fileutils sysutils apt-get remove lpr nfs-common portmap pidentd pcmcia-cs pppoe pppoeconf ppp pppconfig update-rc.d -f exim remove update-inetd --remove daytime update-inetd --remove telnet update-inetd --remove time update-inetd --remove finger update-inetd --remove talk update-inetd --remove ntalk update-inetd --remove ftp update-inetd --remove discard <- Yes /etc/init.d/inetd reload #Quota apt-get install quota quotatool --- Configuring Exim4 for Maildir Delivery: echo 'dc_localdelivery=maildir_home' >> /etc/exim4/update-exim4.conf.conf make maildir in new-users homedirs: maildirmake /etc/skel/Maildir --- edit /etc/login.defs QMAIL_DIR Maildir/ #MAIL_DIR /var/mail MAIL_FILE Maildir/ --- mrtg apt-get install snmpd mrtg mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig echo "rocommunity public" > /etc/snmp/snmpd.conf /etc/init.d/snmpd restart cfgmaker --output /etc/mrtg.cfg public@localhost cd /var/www/mrtg ln -s *html index.html --- #MORE INFO http://www.howtoforge.com/perfect_setup_debian_sarge -=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=- #Ubuntu setup #A Mini-Howto for apache2-SSL apt-get install apache2 apache2-ssl-certificate #(and answer the questions) #Now, enable ssl: a2enmod ssl #configure ssl: cp /etc/apache2/sites-available/default /etc/apache2/sites-available/ssl ln -s /etc/apache2/sites-available/ssl /etc/apache2/sites-enabled/ssl #"/etc/apache2/sites-enabled/ssl" should look like this: NameVirtualHost *:443 (... configure the directories too...) and "/etc/apache2/sites-enabled/default" should look like this: NameVirtualHost *:80 (... configure the directories too...) In /etc/apache2/ports.conf, add Listen 443 In the middle of /etc/apache2/sites-available/ssl file, insert this two lines: SSLEngine On SSLCertificateFile /etc/apache2/ssl/apache.pem ---------------- RAID1 bootable 2 harddisks: --------------------------- reinstalled the boot loader so that the system will boot even if the primary disk (sda) disappears in the future. grub-install /dev/sda $ grub grub> device (hd0) /dev/sdb grub> root (hd0,0) grub> setup (hd0) grub> quit ====================== add partition to raid group mdadm -a /dev/mdX /dev/sdYZ ====================== lm-sensors setup mkdev.sh #!/bin/bash # The number of devices to create (max: 256) NUMBER=32 # The owner and group of the devices OUSER=root OGROUP=root # The mode of the devices MODE=600 # This script doesn't need to be run if devfs is used if [ -r /proc/mounts ] ; then if grep -q "/dev devfs" /proc/mounts ; then echo "You do not need to run this script as your system uses devfs." exit; fi fi i=0; while [ $i -lt $NUMBER ] ; do echo /dev/i2c-$i mknod -m $MODE /dev/i2c-$i c 89 $i || exit chown "$OUSER:$OGROUP" /dev/i2c-$i || exit i=$[$i + 1] done #end of file ============================== maildir delivery postconf -e 'home_mailbox = Maildir/' postconf -e 'mailbox_command =' /etc/init.d/postfix restart ============================== Change default editor update-alternatives --config editor =============================== Dealing with Bandwith Theft #56 Posted by ajt on Wed 18 Oct 2006 at 20:43 I run a few web sites. I don't care if people copy any images off them to use on their own site. I don't mind if they use one of my own images to link back to my site. I do care if they just use an image on their site because they are to lazy to copy the image or to save thair bandwidth. A friend suggested an Apache re-write rule to prevent it happening. After a tweak, I've found it most useful, I just need to wait long enough to take effect. RewriteEngine on RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g|png)$ [NC] RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !(www\.)?domain\.com [NC] RewriteCond %{HTTP_REFERER} !google\. [NC] RewriteCond %{HTTP_REFERER} !search\?q=cache [NC] RewriteRule (.*) - [F,NC,L] UPDATE: Note that domain.com means your domain. --------------- Ethernet problems multiple ethernet cards udev /etc/udev/rules.d/z25_persistent-net.rules --------------- compact flash fstab Because we want to treat the CF card as gently as possible, we edit /etc/fstab, adding the "noatime" option to prevent the system from continually recording each time a file is accessed: /dev/hda1 /mnt/hda1 ext2 noatime,noauto,users,exec 0 0 ---------------- Get a list of all installed packages and install all that in another system Get a list: server1# dpkg --get-selections \* >all_from_server1.txt Use that list to install it on another server server2# cat all_from_server1.txt | dpkg --set-selections server2# dselect install remove ------- #vserver #install the tools aptitude install linux-image-vserver-686 util-vserver vserver-debiantools ssh #make newsserver #doesn't always work! newvserver --vsroot /var/lib/vservers/ --hostname test1 --domain int.bitsource.net --ip 10.1.10.99/24 --dist etch --mirror http://cache.int.bitsource.net:3142/debian/ --interface eth1 #then use this instead vserver news build -n news --hostname news --interface eth0:216.66.000.000/24 -m debootstrap --force --contex 2002 -- -d etch -m http://cache:3142/debian/ #autostart a server on bootup echo "default" > /etc/vservers/[vserver_name]/apps/init/mark #The Files /var/lib/vservers Home directory for the vservers files /etc/vservers.conf basic config file (not much to see there) /etc/vservers Hold the config directories for each virtual server /usr/sbin/vserver Utility to interact, build, start, stop, enter, etc the vservers /bin/vshelper Another utility to control how vservers function /usr/lib/util-vserver Main scripts/functions/etc ------------- Q: 32 vs 64 Bit? What should I take? A: If you have the choice make the host a 64 bit one. You can run a guest as 32 bit or as 64 bit on a 64 bit host. To run it as 32 bit, you need to compile the x86_64 (a.k.a. AMD64) with the following options: [*] Kernel support for ELF binaries Kernel support for MISC binaries [*] IA32 Emulation <---- without that, the entire 32bit API is not present IA32 a.out support You can force the guest to behave like a 32 environment like this: echo linux_32bit > /etc/vservers/$NAME/personality echo i686 > /etc/vservers/$NAME/uts/machine (thanks cehteh for the hint!) But you can force debootstrap to but 32 bit binaries into the guest by 'export ARCH=i386'; export ARCH=i386 ; vserver build .... ---------------------------- “New Wordpress (2.2.0) etch-backport” deb ftp://ftp.cyconet.org/debian etch-backports main non-free contrib =================================== Debian makes it easy to selectively install testing or unstable packages by adding "testing" or "unstable" to your sources.list and putting this in /etc/apt/apt.conf: APT::Default-Release "stable"; Then all apt-based programs will prefer stable packages everywhere possible. If you explicitly run "apt-get install somepackage/ testing", then it will install the testing version of that package and continue to auto-upgrade it as testing receives updates. Alternatively, you can "man apt_preferences" and tweak your "/etc/apt/ preferences" file to your heart's content. This includes things like "Forcibly downgrade packages to the 'local' version if found in my local deb repo", "Prefer stable over testing and unstable", etc. Cheers, Kyle Moffett ===================================== How do I turn on NumLock on startup? (2004-01-21) To enable NumLock in the console, paste this code into rc.local or make an init script and put it into /etc/init.d/: echo "Enabling NumLock..." for tty in /dev/tty{1,2,3,4,5,6,7,8,9,10,11,12}; do setleds -D +num < $tty done X windows is nice enough to turn this off again... so paste the following code into a file named xsetnumlock.c: #include #include int main(void) { Display* disp = XOpenDisplay(NULL); if (disp == NULL) return 1; XTestFakeKeyEvent(disp, XKeysymToKeycode(disp, XK_Num_Lock), True, CurrentTime); XTestFakeKeyEvent(disp, XKeysymToKeycode(disp, XK_Num_Lock), False, CurrentTime); XCloseDisplay(disp); return 0; } Run this command to compile it: $ gcc -I/usr/X11R6/include -L/usr/X11R6/lib -o xsetnumlock xsetnumlock.c -lX11 -lXtst Run xsetnumlock from ~/.Xclients (or any of its alternatives: .xsession, .xinitrc or whatever...). -------------------------- /etc/sysctl.conf kernel.panic = 30 ------------------- free kernel memory, make cached memory zero echo 3 >/proc/sys/vm/drop_caches ================================= Set mysql root password Firstly, set a root password for MySQL if you haven't done so already: # mysql -u root mysql> SET PASSWORD FOR root@localhost=PASSWORD('new_password'); mysql> quit; ================================= find -type f -exec chmod 664 {} \; find -type d -exec chmod 755 {} \; ================================= usb camera not detected apt-get install gthumb ================================= rm -rf * fails with rm: Argument list too long. mse find . -name 'spam-*' -print0 | xargs -0 rm ================================= #purge removed packages dpkg --list | grep '^rc\b' | awk '{ print $2 }' | xargs sudo dpkg -P =============== remove all gui related packages to turn desktop in server apt purge libx11-6 libwayland-client0