package1, package2: tag1, tag2, tag3
package3: tag1, tag2
That is, every line has a list of packages with the same tags, and the list of
their tags.
Since any script I'm going to write has to at least be able to parse the data
into something like a package -> tags hash, then print it out.
Let's see how perl, python and ruby perform.
Tests
C++
The reference point for the experiment will be the C++ implementation,
tagcoll:
$ time tagcoll copy package-tags > /dev/null
real 0m0.421s
user 0m0.412s
sys 0m0.000s
Perl
First attempt is with Perl, creating the script that parses into a hash of
package => set of tags and prints the result.
There are set modules
for Perl on CPAN, but I have none handy at the moment. However, since they are
implemented using hashes, I can approximate them by using a hash.
Note that I also want to have a different copy of the tag set for every
package, so that I can manipulate them in the future without unwanted side
effects.
Here is the code:
#!/usr/bin/perl -w
use strict;
my %db;
# Read the tag database
while (<>)
chop();
my ($pkgs, $tags) = split(': ');
# Create the tagset using keys of a hash
my %tags = map $_ => undef split(', ', $tags);
for my $p (split(', ', $pkgs))
# Make a copy of the tagset
$db $p = %tags ;
# Write the tag database
while (my ($pkg, $tags) = each %db)
print $pkg, join(', ', keys %$tags), "\n";
Here is the running time:
$ time ./parse.pl package-tags > /dev/null
real 0m0.448s
user 0m0.436s
sys 0m0.008s
Not so bad, comparable with tagcoll.
Python
Then comes Python. I'm not much of a Python fancier, but I'm rather attracted
by the new set native type introduced with Python 2.4, which seems to have
most of what I need nice and done.
Here is the script:
#!/usr/bin/python
import sys
input = sys.stdin
if len(sys.argv) > 1:
input = open(sys.argv[1],"r")
# Read the tag database
db =
for line in input:
# Is there a way to remove the last character of a line that does not
# make a copy of the entire line?
line = line.rstrip("\n")
pkgs, tags = line.split(": ")
# Create the tag set using the native set
tags = set(tags.split(", "))
for p in pkgs.split(", "):
db[p] = tags.copy()
# Write the tag database
for pkg, tags in db.items():
# Using % here seems awkward to me, but if I use calls to
# sys.stdout.write it becomes a bit slower
print "%s:" % (pkg), ", ".join(tags)
Here is the running time:
$ time ./parse.py package-tags > /dev/null
real 0m0.418s
user 0m0.376s
sys 0m0.036s
I'm pleased, very pleased. Using the native set seems to be not only handy,
but efficient.
Ruby
Finally, Ruby. I like to use Ruby. In this case, however, it lacks a native
set implementation, although it has a set module which is implemented using a
hash.
Here is the script:
#!/usr/bin/ruby
require 'set'
infile = ARGV[0] ? File.new(ARGV[0]) : $stdin
# Read the tag database
db =
infile.each_line do line
line.chop()
pkgs, tags = line.split(": ")
# Create the set using the Set module
tags = Set.new(tags.split(", "))
pkgs.split(", ").each do p
# Is this a copy or a reference? I need to find out.
db[p] = tags
end
end
# Write the tag database
db.each do key, tags
# Ouch, Set does not do join by itself
print key, ": ", tags.to_a.join(", ")
end
Here is the running time:
$ time ./parse.rb package-tags > /dev/null
real 0m1.637s
user 0m1.572s
sys 0m0.052s
I hope I got something wrong in the script, but I can't see what.
Results
As much as I don't fancy Python, it looks like it's currently the best choice
for playing around with Debtags. I hope the native sets will bring me joy.
If in the future I'll be asked "how come you chose Python for this Debtags
thing?", I can point to this page.
svn cat svn://svn.debian.org/debtags/tagdb/tags > tags
cp tags tags.edited
[...edit tags.edited...]
tagcoll diff tags tags.edited
Note that there are probably many new tags in the
not-yet-revied
database, so one may
want to proceed this way:
svn cat svn://svn.debian.org/debtags/tagdb/tags > tagswget http://debtags.alioth.debian.org/tags/tags-current.gztagcoll diff tags tags-current > changeschanges removing those changes that make no sense
you can review the edits you made to the changes patch this way:
svn cat svn://svn.debian.org/debtags/tagdb/tags tagcoll --patch-from=changes.orig > tmp1
svn cat svn://svn.debian.org/debtags/tagdb/tags tagcoll --patch-from=changes.edited > tmp2
tagcoll diff tmp1 tmp2find /etc less do?ps aux do?mii-tool do and when would you use it?host www.google.com do?/etc/dnsmasq.conf?dhcp-option configuration parameter of
/etc/dnsmasq.conf?AuthUserFile /etc/apache2/students
AuthType Basic
AuthName "Students"
Require valid-user
What does it do?
What command would you use to add a new username and password to
/etc/apache2/students? (you can write the entire commandline if you know
it, but just the name of the command is fine)/etc/apache2/sites-available. How do you activate the new site?Listen 443 to /etc/apache2/ports.conf?/var/log/syslog, and when would you read it?smbclient //localhost/web do?sudo smbpasswd -a enrico do?/etc/samba/smb.conf?iptables?man 5 postconf and man 8 postconf?mailq do?sudo postsuper -d ALL deferred do?dovecot do?/etc/dovecot/dovecot.conf, what is the difference between
having protocols = imap and protocols = imaps?enrico@enricozini.org in the file
/home/enrico/.forward?$ sudo ifdown eth0
$ sudo ifup eth0
$ ifconfig
# See if the DNS machine is on
# The network
$ ping -n 192.168.0.1
# See if the DNS resolves names
$ host www.dream.edu.et
# Ping the gateway
$ ping gateway
# Ping an outside host
$ ping -n 10.4.15.6
# Ping the proxy
$ ping proxy
# Open a web page and see if it displays
# See if it caches
http_proxy=http://proxy.dream.edu.et:3030/ wget -S -O/dev/null http://www.enricozini.org 2>&1 grep X-Cache
$ ping smtp
$ nmap smtp -p 25 grep 25/tcp
$ if nmap gateway -p 25 grep 25/tcp grep -q open ; then echo "It works"; fi
$ send a mail and see if you receive it
nagios:
New useful tools seen today
wget - The non-interactive network downloader.
Special devices
/dev/null:
/dev/zero:
/dev/random, /dev/urandom
/dev/random is cryptographically secure, but it can hang
waiting for system eventswget -O/dev/null http://www.example.org
dd if=/dev/zero of=testdisk bs=1M count=50
mke2fs testdisk
sudo mount -o loop testdisk /mnt
Tiny little commands
true - do nothing, successfullyfalse - do nothing, unsuccessfullyyes - output a string repeatedly until killedwhile /bin/true; do echo ciao; doneyes boring-tool-that-asks-lots-of-silly-questions2>&1 Redirects the standard error in the standard output2> Redirects the standard error instead of the standard outputtop, pressing
M to sort by memory usage.y: copy ("yank")p: pasteP: paste befored: cut ("delete")c: changei: insert.: repeat last operationw: word : paragraphf letter: from the cursor until the given letterv: selectionV: line selection^V: block selectionyw: copy worddw: cut wordyy: copy linedd: cut lineV (select lines) y: copy a selection of linesV (select lines) d: cut a selection of linesp: pastevimtutor.
Installing squirrelmail
To install squirrelmail:
apt-get install squirrelmail/usr/sbin/squirrelmail-config
and configure IMAP and SMTP.
In our case, since we use IMAPS, the IMAP server is imap.dream.edu.et, port
993, secure IMAP enabled and SMTP is smtp.dream.edu.et.Read /usr/share/doc/squirrelmail/README.Debian.gz (with zless) for how
to proceed with setup. A short summary:
/etc/squirrelmail/apache.conf into the apache conf.d directory/etc/squirrelmail/apache.conf for example setting up the
virtual hosts, or running it only on SSL/etc/network/interfaces:
iface eth0:1 inet static
address 192.168.0.201
netmask 255.255.255.0
gateway 192.168.0.3
auto eth0:1
This is the trick commonly used to put different virtual HTTPS hosts on the
same computer.
Links
squid documentation:
apt-get install openssh-server
Then you can login with:
$ ssh efossnet@proxy.dream.edu.et
To verify the host key fingerprint of a machine:
$ ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub
Note: you need to verify it before logging in!
More information at http://www.securityfocus.com/infocus/1806
Example ssh usages
To log in:
$ ssh efossnet@proxy
To run a command in the remote computer:
$ ssh efossnet@proxy "cat /etc/hosts"
To copy a file to the remote computer:
$ scp Desktop/july-18.tar.gz efossnet@proxy:
To copy a file from the remote computer:
$ scp efossnet@proxy:july-18.tar.gz /tmp/
Beware of brute-force login attempts
Warning about SSH: there are people who run automated scans for ssh servers and
try to login using commonly used easy passwords.
If you have an SSH server on the network, use strong passwords, or if you can
it's even better to disable password authentication: in
/etc/ssh/sshd_config, add:
PasswordAuthentication no
To log in using public/private keys:
ssh-keygen -t rsa
ssh-copy-id -i .ssh/id_rsa.pub efossnet@proxy
1153294204.912 887 192.168.0.200 TCP_MISS/503 1441 GET http://www.google.com.et/search? - NONE/- text/html
That "/503" is one of the HTTP error codes.
Explanation of the error codes:
apt-get install mailx
echo ciao mail efossnet@localhost
To configure a workstation not to do any mail delivery locally and send all
mail produced locally to smtp.dream.edu.et:
apt-get install squirrelmail (on a working apache
setup).
To setup mailing lists: apt-get install mailman, then follow the
instructions in /usr/share/doc.
Mail server issues we encountered
When a mail is sent to efossnet@localhost, the system tries to send it to
efossnet@yoseph.org
Investigation:
rm ~efossnet/.forward
Apache
To add a new website:
cd /etc/apache2/sites-availablesudo cp default coursesudo vi course:
ServerName directive with the address of your server:
ServerName course.dream.edu.et/usr/share/doc and you want to use a different document
root.sudo a2ensite coursesudo /etc/init.d/apache2 reloadu (in command mode)
Redo: ^R (in command mode)
You can undo and redo multiple times.
To recover a lost password for root or for the ubuntu admin user
Boot with a live CD, mount the system on the hard disk (the live CD usually
does it automatically), then edit the file /etc/shadow, removing the
password:
enrico:$1$3AJfasjJFHa234dfh230:13343:0:99999:7:::
becomes:
enrico::13343:0:99999:7:::
You can edit the file because, in the live CD system, you can always become
root.
After you do this, reboot the system: you can log in without password, and set
yourself a new password using the command passwd.
Installing packages not on the CDs
To get a package for installing when offline:
apt-get --print-uris install dnsmasqapt-get --download-only install dnsmasq will download the
package for you in /var/cache/apt/archives.
You can install various previously downloaded debian packages with:
dpkg -i *.deb
Backups
There are various ways:
dump (for ext2/ext3 file systems)
or xfsdump (for xfs file systems).
Makes a low-level dump of the file system.
It must be used for every different partition.
It makes the most exact backup possible, including inode numbers.
It can do full and incremental backups.
To see the type of the filesystems, use 'mount' with no parameters.
To restore: restore or xfsrestore.tar
Filesystem independent.
It can work accross partitions.
It correctly backups permissions and hard links.
It can do full and incremental backups.
Example:
tar lzcpf backup.tar.gz /home /var /etc /usr/local
tar lzcpf root.tar.gz /
To restore:
tar zxpf backup.tar.gz
faubackup
Filesystem independent.
Uses hard drive as backup storage.
Always incremental.
It cannot do compression.
Unchanged files in new backups are just links to old backups, and do not
occupy space.
Any old backup can be deleted at any time without compromising the others.
It can be used to provided a "yesterday's files" service to users (both
locally and exported as a read-only samba share...).
To restore, just copy the files from the backup area.amanda
apt-get install amanda-client amanda-server
It is a network backup system.
It can do full and incremental backups.
You can have a backup server which handles the storage and various backup
clients that send the files to backup to the server.
It takes some studying to set up.
To restore: it has its own tool.dpkg --get-selections > pkglist
debconf-get-selections > pkgconfig
To restore:
dpkg --set-selections < list
debconf-set-selections < pkgconfig
apt-get dselect-upgrade
If you do this, they you only need to backup /etc, /home,
/usr/local, /var.mysqldump name-of-database gzip > name-of-database.dump.gz
To restore:
zcat name-of-database.dump.gz mysql
crontab -e
As root: add a file in one of the /etc/cron.* directories.
In cron. hourly,daily,weekly,monthly you put scripts.
In the other directories you put crontab files (man 5 crontab).
If the system is turned off during normal maintainance hours, you can do two
things:
$ at 17:40
echo "Please tell Enrico that the lesson is finished" mail efossnet@dream.edu.et
^D
When and how to automate
rkhunter, chkrootkitchecksecuritydebsecantiger^C: interrupt (sends SIGTERM)^\: interrupt (send SIGQUIT)^D: end of input^S: stop scrolling^Q: resume scrolling^Q.
Problems we had today with postfix
efossnet@dream.edu.et is accepted only if sent locally.
Reason:
$ host -t mx dream.edu.et
Host dream.edu.et not found: 3(NXDOMAIN)
Solution: tell dnsmasq to handle a MX record also for dream.edu.et:
mx-host=dream.edu.et,smtp.dream.edu.et,50apt-get --print-uris doesn't print the URIs if the package is in the
local cache, and there seems to be no way to have it do it./etc/apache2/sites-available/default, is the NameVirtualHost *
directive appropriate there? It gets in the way when using 'default' as a
template for new sites.
Otherwise, one can add a new (disabled) site that can be used as a template
for new sites instead of default.crontab -e are not that easy to read.To do more advanced network and service monitoring, try nagios:
Test DHCP:
$ sudo ifdown eth0 $ sudo ifup eth0 $ ifconfigTest the DNS:
# See if the DNS machine is on # The network $ ping -n 192.168.0.1 # See if the DNS resolves names $ host www.dream.edu.etTest the gateway:
# Ping the gateway $ ping gateway # Ping an outside host $ ping -n 10.4.15.6Test the proxy:
# Ping the proxy $ ping proxy # Open a web page and see if it displays # See if it caches http_proxy=http://proxy.dream.edu.et:3030/ wget -S -O/dev/null http://www.enricozini.org 2>&1 grep X-CacheTest the mail server:
$ ping smtp $ nmap smtp -p 25 grep 25/tcp $ if nmap gateway -p 25 grep 25/tcp grep -q open ; then echo "It works"; fi $ send a mail and see if you receive it
New useful tools seen today:
wget - The non-interactive network downloader.Special devices:
Example uses:
- /dev/null:
- On read, there is no data.
- On write, discards data.
- /dev/zero:
- On read, reads an infininte amount of zero bits.
- On write, discards data.
- /dev/random, /dev/urandom
- On read, reads random bits.
- On write, discards data.
- Difference: /dev/random is cryptographically secure, but it can hang waiting for system events
wget -O/dev/null http://www.example.org dd if=/dev/zero of=testdisk bs=1M count=50 mke2fs testdisk sudo mount -o loop testdisk /mntTiny little commands:
Example uses:
- true - do nothing, successfully
- false - do nothing, unsuccessfully
- yes - output a string repeatedly until killed
while /bin/true; do echo ciao; done Using /bin/false as a shell yes boring-tool-that-asks-lots-of-silly-questionsSome more shell syntax:
Some people run commands ignoring the standard error:
- 2>&1 Redirects the standard error in the standard output
- 2> Redirects the standard error instead of the standard output
command 2> /dev/nullThis causes unexpected error messages to go unnoticed: please do not do it. What to check if a machine is very slow:
See if the ram is full:
$ freeIf it is, you see what are the fattest programs using top, pressing M to sort by memory usage.See if there are lots of programs competing for CPU:
$ topCheck if you have I/O bottlenecks:
$ vmstat(but I don't know how to read it)For a desktop on older hardware, you can try xubuntu instead of ubuntu
- y: copy ("yank")
- p: paste
- P: paste before
- d: cut ("delete")
- c: change
- i: insert
- a: append
- .: repeat last operation
The best way to learn more vim is always to run vimtutor.
- yw: copy word
- dw: cut word
- yy: copy line
- dd: cut line
- V (select lines) y: copy a selection of lines
- V (select lines) d: cut a selection of lines
- p: paste
To have different virtual hosts over HTTPS, you need to have a different IP for every virtual host: name based virtual hosts do not work on HTTPS. You can configure multiple IP addresses on the same computer: use network interfaces named: eth0:1, eth0:2, eth0:3... These are called interface aliases. You cannot setup interface aliases using the graphical network configuration and you need to add them in /etc/network/interfaces:
apt-get install squirrelmail
/usr/sbin/squirrelmail-config and configure IMAP and SMTP. In our case, since we use IMAPS, the IMAP server is imap.dream.edu.et, port 993, secure IMAP enabled and SMTP is smtp.dream.edu.et.
Read /usr/share/doc/squirrelmail/README.Debian.gz (with zless) for how to proceed with setup. A short summary:
- link /etc/squirrelmail/apache.conf into the apache conf.d directory
- customise /etc/squirrelmail/apache.conf for example setting up the virtual hosts, or running it only on SSL
iface eth0:1 inet static
address 192.168.0.201
netmask 255.255.255.0
gateway 192.168.0.3
auto eth0:1
This is the trick commonly used to put different virtual HTTPS hosts on the
same computer.
apt-get install openssh-serverThen you can login with:
$ ssh efossnet@proxy.dream.edu.etTo verify the host key fingerprint of a machine:
$ ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pubNote: you need to verify it before logging in! More information at http://www.securityfocus.com/infocus/1806 Example ssh usages:
Warning about SSH: there are people who run automated scans for ssh servers and try to login using commonly used easy passwords. If you have an SSH server on the network, use strong passwords, or if you can it's even better to disable password authentication: in /etc/ssh/sshd_config, add:
To log in:
$ ssh efossnet@proxyTo run a command in the remote computer:
$ ssh efossnet@proxy "cat /etc/hosts"To copy a file to the remote computer:
$ scp Desktop/july-18.tar.gz efossnet@proxy:To copy a file from the remote computer:
$ scp efossnet@proxy:july-18.tar.gz /tmp/
PasswordAuthentication noTo log in using public/private keys:
If you use ssh often, read these:
Create your key:
ssh-keygen -t rsaCopy your public key to the machine where you want to log in:
ssh-copy-id -i .ssh/id_rsa.pub efossnet@proxyNow you can ssh using your RSA key
ssl does not work. Reason: squid tries to directly connect to the ssl server, but the AAU network wants us to go through their proxy. Ideal solution: none. There is no way to tell squid to use a parent proxy for SSL connections. Solution: update the documentation for the Dream university users telling to setup a different proxy for SSL connections. Longer term solution: get the AAU network admins to enable outgoing SSL connections from the Dream university proxy. Other things that can be done:
- report a bug on squid reporting the need and requesting the feature
- download squid source code and implement the feature ourselves, then submit the patch to the squid people
Browsing normal pages returns an error of 'Connection refused'. In the logs, the line is:
1153294204.912 887 192.168.0.200 TCP_MISS/503 1441 GET http://www.google.com.et/search? - NONE/- text/htmlThat "/503" is one of the HTTP error codes. Explanation of the error codes:Reason: the other proxy is refusing connections from our proxy. Solution: none so far. Will need to get in touch with the admins of the other proxy to try to find out why it refuses connection to our proxy, and how we can fix the problem.
Quick way to send test mails:
- The mail name is the name of the mail server you're setting up (TODO: need more details on what's it used for)
- The smarthost is the name of the mail server that will relay mail for you.
apt-get install mailx echo ciao mail efossnet@localhostTo configure a workstation not to do any mail delivery locally and send all mail produced locally to smtp.dream.edu.et:
To setup a webmail: apt-get install squirrelmail (on a working apache setup). To setup mailing lists: apt-get install mailman, then follow the instructions in /usr/share/doc. Mail server issues we encountered:
- install postfix choosing "Satellite system"
- put smtp.dream.edu.et as a smarthost.
When a mail is sent to efossnet@localhost, the system tries to send it to efossnet@yoseph.org
Cause: the user efossnet had forgotten that he or she had setup a .forward file in the home directory. Solution:
- Investigation:
- "yoseph.org" does not appear anywhere in /etc or /var/spool/postfix
- postfix configuration has been reloaded
- postfix logs show that the mail has been 'forwarded'
rm ~efossnet/.forward
cd /etc/apache2/sites-available
sudo cp default course
sudo vi course:
Remove the first line
Add a ServerName directive with the address of your server:
ServerName course.dream.edu.etCustomize the rest as needed: you at least want to remove the support for browsing /usr/share/doc and you want to use a different document root.
sudo a2ensite course
sudo /etc/init.d/apache2 reload
enrico:$1$3AJfasjJFHa234dfh230:13343:0:99999:7:::becomes:
enrico::13343:0:99999:7:::You can edit the file because, in the live CD system, you can always become root. After you do this, reboot the system: you can log in without password, and set yourself a new password using the command passwd.
Otherwise, apt-get --download-only install dnsmasq will download the package for you in /var/cache/apt/archives. You can install various previously downloaded debian packages with:
- apt-get --print-uris install dnsmasq
- Manually download the packages at the URLs that it gives you
dpkg -i *.deb
Some data requires exporting before backing it up:
dump (for ext2/ext3 file systems) or xfsdump (for xfs file systems). Makes a low-level dump of the file system. It must be used for every different partition. It makes the most exact backup possible, including inode numbers. It can do full and incremental backups. To see the type of the filesystems, use 'mount' with no parameters. To restore: restore or xfsrestore.
tar Filesystem independent. It can work accross partitions. It correctly backups permissions and hard links. It can do full and incremental backups. Example:
tar lzcpf backup.tar.gz /home /var /etc /usr/local tar lzcpf root.tar.gz /To restore:tar zxpf backup.tar.gzfaubackup Filesystem independent. Uses hard drive as backup storage. Always incremental. It cannot do compression. Unchanged files in new backups are just links to old backups, and do not occupy space. Any old backup can be deleted at any time without compromising the others. It can be used to provided a "yesterday's files" service to users (both locally and exported as a read-only samba share...). To restore, just copy the files from the backup area.
amanda apt-get install amanda-client amanda-server It is a network backup system. It can do full and incremental backups. You can have a backup server which handles the storage and various backup clients that send the files to backup to the server. It takes some studying to set up. To restore: it has its own tool.
You can schedule these dumps to be made one hour before the time you make backups.
To save the list of installed packages and the answer to configuration questions:
dpkg --get-selections > pkglist debconf-get-selections > pkgconfigTo restore:dpkg --set-selections < list debconf-set-selections < pkgconfig apt-get dselect-upgradeIf you do this, they you only need to backup /etc, /home, /usr/local, /var.To save the contents of a MySQL database:
mysqldump name-of-database gzip > name-of-database.dump.gzTo restore:zcat name-of-database.dump.gz mysql
crontab -eAs root: add a file in one of the /etc/cron.* directories. In cron. hourly,daily,weekly,monthly you put scripts. In the other directories you put crontab files (man 5 crontab). If the system is turned off during normal maintainance hours, you can do two things:
For scheduling one-shot tasks, use at(1):
- Change /etc/crontab to use different maintanance hours
- Install anacron (it's installed by default in ubuntu)
$ at 17:40 echo "Please tell Enrico that the lesson is finished" mail efossnet@dream.edu.et ^D
Start at step 1 and go to 2 or 3 if/when you actually need it. (credits to sto@debian.org: he's the one from which I heard it for the first time, said so well).
- First, you manage to do it yourself
- Then, you document it
- Then, you automate it
- rkhunter, chkrootkit
- checksecurity
- debsecan
- tiger
Therefore, if the terminal looks like it got stuck, try hitting ^Q.
- ^C: interrupt (sends SIGTERM)
- ^\: interrupt (send SIGQUIT)
- ^D: end of input
- ^S: stop scrolling
- ^Q: resume scrolling
Problems found yesterday and today:
Problem: mail to efossnet@dream.edu.et is accepted only if sent locally. Reason:
$ host -t mx dream.edu.et Host dream.edu.et not found: 3(NXDOMAIN)Solution: tell dnsmasq to handle a MX record also for dream.edu.et:mx-host=dream.edu.et,smtp.dream.edu.et,50The problem not solved with the previous solution. Reason: postfix was making complaints which mentioned localhost as a domain name. Solution: fixed by changing 'myhostname' in main.cf to something different than localhost. Note: solved by luck. Investigate why this happened.
there is no way to tell squid to use another proxy for SSL connections: it only does them directly
if you want to configure evolution to get mail from /var/mail/user, you need to explicitly enter the path. It would be trivially easier if evolution presented a good default, since it's easy to compute. It would also be useful if below the "Path" entry there were some text telling what path is being requested: the mail spool? the evolution mail storage?
In Evolution: IMAP or IMAPv4r1? What is the difference? Why should I care?
apt-get --print-uris doesn't print the URIs if the package is in the local cache, and there seems to be no way to have it do it.
in /etc/apache2/sites-available/default, is the NameVirtualHost * directive appropriate there? It gets in the way when using 'default' as a template for new sites. Otherwise, one can add a new (disabled) site that can be used as a template for new sites instead of default.
the default comments put by crontab -e are not that easy to read.
Example use of vim block selection:
- always take note of what you do
- make yourself always able to explain to another person what you did
- keep a copy of the configuration files before changing them, so that you can see what you changed
- be always able to move the service to another computer
- make sure that it works after reboot
To change network configuration with config files, edit:
- ESC
- exits insert mode.
- ^V
- starts block selection. Move the arrows to form a rectangle.
- c
- change. Type the new content for the line.
- ESC
- gets out of insert mode, and the change will happen in all the lines.
/etc/network/interfacesTo also setup DNS in /etc/network/interfaces, use dns-search and dns-nameservers (for this to work, you need to have the package resolvconf):
dns-search dream.edu.et dns-nameservers 192.168.0.1 192.168.0.2To make a router that connects to the internet on demand using a modem:
apt-get install dialdTo see the path of network packets:
mtr 4.2.2.2Basic NAT script:
OUT=eth2 IN=eth0 modprobe iptable_nat iptables -t nat -A POSTROUTING -o $OUT -j MASQUERADE echo 1 > /proc/sys/net/ipv4/ip_forwardWhat happens at system startup:
To install a new startup script:
- the BIOS loads and runs the boot loader
- the boot loader loads the kernel and the inintrd ramdisk and runs the kernel
- the kernel runs the script 'init' in the initrd ramdisk
- the script 'init' mounts the root directory
- the script 'init' runs the command /sbin/init in the new root directory
- 'init' starts the system with the configuration in /etc/inittab
sudo ln -s /usr/local/sbin/firewall /etc/init.d sudo update-rc.d firewall defaults 16 75Normally you can just do:
sudo update-rc.d [servicename] defaultsTo have a look at the start and stop order numbers, look at /etc/rc2.d for other start scripts and /etc/rc0.d for other stop scripts To test a proxy, low level way:
$ telnet proxy 8080 Trying 192.168.0.6... Connected to proxy.dream.edu.et. Escape character is '^]'. GET http://www.google.com HTTP/1.0 [press enter twice]
damog: enrico’s notes are now half planet, hehDamn those folds
aj: we should all complain about the lack of folds![]()
Next.