What is Rfc1983 and what about it?

This is not something to argue about, this is how it is. Argue and youre stupid, 
disagree and we just wont talk to you. Waste more of our valuable time with this 
subject and be disliked.

Source: ftp://ftp.rfc-editor.org/in-notes/rfc1983.txt

   cracker
      A cracker is an individual who attempts to access computer systems
      without authorization.  These individuals are often malicious, as
      opposed to hackers, and have many means at their disposal for
      breaking into a system.  See also: hacker, Computer Emergency
      Response Team, Trojan Horse, virus, worm.

   hacker
      A person who delights in having an intimate understanding of the
      internal workings of a system, computers and computer networks in
      particular.  The term is often misused in a pejorative context,
      where "cracker" would be the correct term.  See also: cracker.
Udgivet i Knowledge Base | Skriv en kommentar

Genialt IDE til php udvikling, crossplatform, ftp browsing og opensource

http://aptana.com/

Udgivet i Links | Skriv en kommentar

Genialt IDE til php udvikling, crossplatform, ftp browsing og opensource

http://aptana.com/

Udgivet i Knowledge Base | Skriv en kommentar

install mod_mono on gentoo

The mod_mono and some dependencies are masked:
(I use ~amd64, use ~x86 if that applies to your system)

# echo "www-apache/mod_mono ~amd64" >> /etc/portage/package.keywords
# echo "dev-dotnet/xsp ~amd64" >> /etc/portage/package.keywords
# echo "dev-lang/mono ~amd64" >> /etc/portage/package.keywords

# echo "www-apache/mod_mono aspnet2" >> /etc/portage/package.use

install the mono package

# emerge -av mono mod_mono

Next, add: '-D MONO' to APACHE2_OPTS in /etc/conf.d/apache2

Restart apache and have fun programming C# :D
Udgivet i Knowledge Base, Linux, Old Base | Skriv en kommentar

Change timezone on Debian boxes

Current default timezone: 'Europe/Copenhagen'
Local time is now:      Mon Jun 25 13:51:47 CEST 2007.
Universal Time is now:  Mon Jun 25 11:51:47 UTC 2007.
Run 'dpkg-reconfigure tzdata' if you wish to change it.
Udgivet i Knowledge Base, Linux, Old Base | Skriv en kommentar

Recover MySQL root password

/etc/init.d/mysql stop
/usr/bin/mysqld_safe --skip-grant-tables --skip-networking &
mysql -u root
use mysql;
UPDATE user SET Password=PASSWORD("your password here") WHERE User="root";
exit
# kill all the mysql processes
/etc/init.d/mysql stop
# Start MySQL again
/etc/init.d/mysql start
Udgivet i Knowledge Base, Old Base, SQL | Skriv en kommentar

Tool for recovering broken harddisk…and stuff like that

http://www.cgsecurity.org/wiki/TestDisk

Udgivet i Knowledge Base, Old Base | Skriv en kommentar

Dualscreen med x200 paa debian med aabne drivere

Section "Files"
        FontPath        "/usr/share/fonts/X11/misc"
        FontPath        "/usr/X11R6/lib/X11/fonts/misc"
        FontPath        "/usr/share/fonts/X11/cyrillic"
        FontPath        "/usr/X11R6/lib/X11/fonts/cyrillic"
        FontPath        "/usr/share/fonts/X11/100dpi/:unscaled"
        FontPath        "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
        FontPath        "/usr/share/fonts/X11/75dpi/:unscaled"
        FontPath        "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
        FontPath        "/usr/share/fonts/X11/Type1"
        FontPath        "/usr/X11R6/lib/X11/fonts/Type1"
        FontPath        "/usr/share/fonts/X11/100dpi"
        FontPath        "/usr/X11R6/lib/X11/fonts/100dpi"
        FontPath        "/usr/share/fonts/X11/75dpi"
        FontPath        "/usr/X11R6/lib/X11/fonts/75dpi"
        # path to defoma fonts
        FontPath        "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection

Section "Module"
        Load    "i2c"
        Load    "bitmap"
        Load    "ddc"
        Load    "dri"
        Load    "extmod"
        Load    "freetype"
        Load    "glx"
        Load    "int10"
        Load    "vbe"
EndSection

Section "InputDevice"
        Identifier      "Generic Keyboard"
        Driver          "kbd"
        Option          "CoreKeyboard"
        Option          "XkbRules"      "xorg"
        Option          "XkbModel"      "pc104"
        Option          "XkbLayout"     "us"
EndSection

Section "InputDevice"
        Identifier      "Configured Mouse"
        Driver          "mouse"
        Option          "CorePointer"
        Option          "Device"                "/dev/input/mice"
        Option          "Protocol"              "ImPS/2"
        Option          "Emulate3Buttons"       "true"
EndSection

Section "Device"
        Identifier      "ATI Technologies Inc RV370 5B60 [Radeon X300 (PCIE)]"
        Driver          "ati"
        BusID           "PCI:2:0:0"
        Screen          0
EndSection


Section "Device"
        Identifier      "ATI Technologies Inc RV370 5B60 [Radeon X300 (PCIE)] 2"
        Driver          "ati"
        BusID           "PCI:2:0:0"
        Screen          1
EndSection



Section "Monitor"
        Identifier      "SyncMaster"
        Option          "DPMS"
EndSection

Section "Screen"
        Identifier      "Default Screen"
        Device          "ATI Technologies Inc RV370 5B60 [Radeon X300 (PCIE)]"
        Monitor         "SyncMaster"
        DefaultDepth    24
        SubSection "Display"
                Depth           24
                Modes           "1680x1050"
        EndSubSection
EndSection


Section "Screen"
        Identifier      "Secondary Screen"
        Device          "ATI Technologies Inc RV370 5B60 [Radeon X300 (PCIE)] 2"
        Monitor         "SyncMaster"
        DefaultDepth    24
        SubSection "Display"
                Depth           24
                Modes           "1680x1050"
        EndSubSection
EndSection



Section "ServerLayout"
        Identifier      "Default Layout"
        Screen          "Default Screen"
        Screen          "Secondary Screen" LeftOf "Default Screen"
        InputDevice     "Generic Keyboard"
        InputDevice     "Configured Mouse"
        Option          "Xinerama" "on"
        Option          "Clone" "on"
EndSection

Section "DRI"
        Mode    0666
EndSection
Udgivet i Knowledge Base, Linux, Old Base | Skriv en kommentar

Parse dhcpd.leases and return all active leases

#!/usr/bin/php
<?
$fh=fopen("/chroot/dhcp/var/lib/dhcp/dhcpd.leases","r");

while ($dat=fgets($fh))
{
        if (preg_match("/lease/",$dat))
        {
                $active=false;
                $ip = preg_split("/ /",$dat);$ip=$ip[1];
                $dat=fgets($fh);
                while (!preg_match("/hardware ethernet/",$dat))
                {
                        if (preg_match("/binding state active/",$dat))
                        {
                                $active=true;
                        }
                        $dat=fgets($fh);
                }
                $mac = preg_split("/ |;/",$dat); $mac=$mac[4];
                if ($active)
                {
                        print $ip." - ".$mac."\n";
                }
        }
}
?>
Udgivet i Apache, Knowledge Base, Old Base, PHP | Skriv en kommentar

Opsætning af pmacct på debian

pmacct og mysql installeres via apt.
i mysql oprettes databasen pmacct og brugeren pmacct@localhost med koden pmacct:
  
  create database pmacct;
  grant all privileges on pmacct.* to pmacct@localhost identified by 'pmacct';

følgende config bruges: (/etc/pmacct/pmacctd.conf)

! pmacctd configuration
!
!
!
daemonize: true
pidfile: /var/run/pmacctd.pid
syslog: daemon
interface: eth1

aggregate[inbound]: dst_host
aggregate[outbound]: src_host
aggregate_filter[inbound]: dst net 217.195.176.0/24
aggregate_filter[outbound]: src net 217.195.176.0/24
plugins: mysql[inbound], mysql[outbound]
sql_table[inbound]: acct_in
sql_table[outbound]: acct_out
sql_table_version[inbound]: 1
sql_table_version[outbound]: 1

sql_host: localhost
sql_db: pmacct
sql_user: pmacct
sql_passwd: pmacct
sql_refresh_time: 60
sql_history: 1h
sql_history_roundoff: mh


Følgende sql script bruges til at oprette tabeller: 
(vim /usr/share/doc/pmacct/sql/pmacct-create-db_v1_in-out.mysql)

use pmacct;

drop table if exists acct_in;
create table acct_in (
        mac_src CHAR(17) NOT NULL,
        mac_dst CHAR(17) NOT NULL,
        ip_src CHAR(15) NOT NULL,
        ip_dst CHAR(15) NOT NULL,
        src_port INT(2) UNSIGNED NOT NULL,
        dst_port INT(2) UNSIGNED NOT NULL,
        ip_proto CHAR(6) NOT NULL,
        packets INT UNSIGNED NOT NULL,
        bytes BIGINT UNSIGNED NOT NULL,
        stamp_inserted DATETIME NOT NULL,
        stamp_updated DATETIME,
        PRIMARY KEY (mac_src, mac_dst, ip_src, ip_dst, src_port, dst_port, ip_proto, stamp_inserted)
);
drop table if exists acct_out;
create table acct_out (
        mac_src CHAR(17) NOT NULL,
        mac_dst CHAR(17) NOT NULL,
        ip_src CHAR(15) NOT NULL,
        ip_dst CHAR(15) NOT NULL,
        src_port INT(2) UNSIGNED NOT NULL,
        dst_port INT(2) UNSIGNED NOT NULL,
        ip_proto CHAR(6) NOT NULL,
        packets INT UNSIGNED NOT NULL,
        bytes BIGINT UNSIGNED NOT NULL,
        stamp_inserted DATETIME NOT NULL,
        stamp_updated DATETIME,
        PRIMARY KEY (mac_src, mac_dst, ip_src, ip_dst, src_port, dst_port, ip_proto, stamp_inserted)
);


Start pmacctd og lad den guffe traffik:

/etc/init.d/pmacct start

Optimer udlæsning af traffikken lidt:

CREATE VIEW vTraffic AS SELECT acct_in.ip_dst AS ip, acct_in.stamp_inserted AS Time, acct_out.bytes AS Sent, acct_in.bytes AS Recieved FROM acct_in, acct_out WHERE acct_in.ip_dst = acct_out.ip_src AND acct_in.stamp_inserted = acct_out.stamp_inserted ORDER BY Time, inet_aton(ip);

(Der burde være brugt outer join, da hosts som kun sender eller modtager i en given time ikke bliver målt. I praksis ser jeg bort fra dette, da vi nok ikke har den slags hosts overhovedet?)
Udgivet i Knowledge Base, Linux, Old Base | Skriv en kommentar