SSH Pre-login banner

/etc/issue.ssh should contain the banner:

web01:~# cat /etc/issue.ssh

This is a Level2 system

web01:~#


and add:

Banner /etc/issue.ssh

to /etc/ssh/sshd_config

then sighup
Udgivet i Knowledge Base, Linux, Old Base | Skriv en kommentar

Novell NetWare 6.5 administration

To switch console, use ctrl+esc.

To set up TCP/IP load the following module from the System Console:

inetcfg

To set up a printer, load the following modules:

broker
ndpsm

(These should start automatically)
hpgate
ndpsgw


To reboot, type 'reset server' at the System Console
Udgivet i Knowledge Base, Networking, Old Base | Skriv en kommentar

Klientel anvendelse af CVS (pserver)

 --- Remote anvendelse:

Log ind på CVS Serveren og log herefter ind på remote maskinen med flg. kommando:

# ssh web01.mcs.bz -R 2401:127.0.0.1:2401

Herefter kan CVS Serveren tilgåes fra web01 ved at connecte til localhost port 2401, trafik mellem CVS Serveren og web01 er krypteret vha. SSH

 --- Login på CVS

# cvs -d :pserver:mike@localhost:/root login


 --- Oprettelse af Projekt

Opret ønsket mappestruktur el. anvend eksisterende inkl. filer for at oprette et projekt i CVS, og anvende herefter følgende kommando:

# cvs -d :pserver:mike@localhost:/root import -m "" Thyfisk MCS production


 --- Checkud af projekt

# cvs -d :pserver:mike@localhost:/root checkout Thyfisk

 --- Commit af projektet
 - virker kun med filer som allerede ligger i CVS og engang er hentet derfra.
# cvs -d :pserver:mike@localhost:/root commit

 --- Indsendelse af ændringer/nye ting
 - virker med alle filer
# cvs -d :pserver:mike@localhost:/root import -m "Tilføjelse af README.TXT" Thyfisk MCS production


 --- Kortere kommandoer

# export CVSROOT=:pserver:mike@localhost:/root
Udgivet i Knowledge Base, Linux, Old Base | Skriv en kommentar

D-Link DFE-570TX

This is a 4 Port NIC Card from D-Link, the systems sees it as a DEC-21152(But on
the board/chip itself it says Intel 21152) this is in fact a PCI Bridge which 
bridges to 4 PCI Nic's which again Linux believe is a DEC-21143TX Chip (and on the
board/chips it says Intel 21143TX)

At first we tried the "tulip" driver which did'nt work, we then concluded that we 
needed to find a driver for the PCI Bridge before we could engange the NIC Chips 
on the board, out of desperation we tried first modprobe pci_hotplug and the 
followed by modprobe tulip which then resultet in four available eth devices.
Udgivet i Knowledge Base, Networking, Old Base | Skriv en kommentar

MRTG on debian

Installing an configuring mrtg on debian is quite straightforward. Just issue a "apt-get install mrtg" and you're done. 
As for configuring it, there are just another few minutes more. You can use a very useful utility, called "cfgmaker" 
to generate the config file needed by mrtg. For example:

~#cfgmaker community@device1 > /etc/mrtg/device1.cfg,
where community is the ro snmp community, device1 is either an ip address either it's FQDN hostname. 
Next you can edit /etc/mrtg/device1.cfg to fine tune the configuration. 
It's recommended that you make a different config for every device you wish to monitor. Also, make sure you edit the 
WorkDir parameter in the config file which tells mrtg where to put the generated html files. You can use "indexmaker" 
to generate an index file for the html files that mrtg outputs in WorkDir.

Next, we need to poll the snmp on the device periodically, so we add some entries in the crontab like this:

*/5 * * * *     nice /usr/bin/mrtg /etc/mrtg/device1.cfg 2>&1 >/dev/null 2>/dev/null
which will run mrtg every 5 minutes with low priority.

For calculating mrtg totals I've used a tool called mrtg_total which can be found here: 
http://www.geocities.com/josef_wendel/mrtg_total.html

Basically, it's a perl script that totals the information stored in the mrtg log files. Installation is straightforward,
just add the required tags (described in the documentation) to the mrtg config file and add another entry to crontab:

30 0 * * *      nice /usr/sbin/mrtg_total.pl /etc/mrtg/device1.cfg 2>&1 >/dev/null 2>/dev/null

This is run only once per day because mrtg_total only totals a complete day.

Another tool that could be used in this case is mrtg-traffic-sum. You can read more about this and other mrtg tools 
here: http://oss.oetiker.ch/mrtg/doc/mrtg-traffic-sum.en.html
Udgivet i Knowledge Base, Linux, Old Base | Skriv en kommentar

Extract a mysql query to XML

echo "select * from table" | mysql -B --xml -h [host] -u [user] -p[password] [database] > output.xml

not all of the parameters are needed of course.

use --table if you want the nice ascii tables around the result
if -B is given and neigther --xml nor --table are given, the output is tabbed out.
Udgivet i Knowledge Base, Old Base, SQL | Skriv en kommentar

Install Mono on Debian

This works on Sarge and Etch:

apt-get install mono libmono-corlib2.0-cil
Udgivet i Knowledge Base, Linux, Old Base | Skriv en kommentar

Layout til IPAccounting

Traffic
	trafid		INT AUTOINCREMENT
	time		DateTime		\
	ip		INT			/ Burde være lavet som kombined key med clustered index?
	sent		INT
	recieved	INT

Index på `time` og `ip`

LocalIPs
	lid		INT AUTOINCREMENT
	ip		INT
	description	VARCHAR(255)
Udgivet i Knowledge Base, Old Base | Skriv en kommentar

HP Procurve commands

Many commands are similar to cisco IOS.

Locate a specific mac addres in the port table:

switch1.mcn.dk# show mac-address 0010a7-0600d4

 Status and Counters - Address Table - 0010a7-0600d4

  MAC Address : 0010a7-0600d4
  Located on Port : 25
Udgivet i HP, Knowledge Base, Networking, Old Base | Skriv en kommentar

XML formatting with xmllint

To get a nice output of any xml file:

xmllint --format <file>

To strip all spaces, tabs and newlines:

xmllint --noblanks <file>

For sorting look at xmlstar.sourceforge.net
Udgivet i Knowledge Base, Old Base | Skriv en kommentar