Free Xchat for windows

http://silverex.info/download/

Udgivet i Knowledge Base, Links, Old Base | Skriv en kommentar

XMessage [Popup i X]

Lav en popup besked i X

# echo “Unifix” | xmessage -file – -center

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

Changing Agent reply in firefox

go to url : about:config
Rightclick on a random value, choose new->string and type:
general.useragent.overide

press enter

and then type in the agent string of the browser you want to fake 🙂

If you want a ‘valid’ fakename , visit this page with the browser you want to fake
http://cybermike.dk/agent.php

Udgivet i Knowledge Base, Old Base, Workstation | Skriv en kommentar

Firefox: Søg i basen

Har du prøvet at skrive [google unifix] i addrbar i firefox….
Smart at den så søger på google på unifix….

Her er hvordan du gør det med Unifix knowledge database……

Gå ind og lav en ny bookmark….

I name kan man skrive: Base
Location: http://base.fujang.dk/cgi-bin/index.pl?query=%s&action=query
[Hvor %s er hvor du vil indsætte dit søge ord]
Keyword: base
[Et hintede til firefox]
Description: Unifix knowledge database
[OK]

Prøv nu at skrive i din addrbar: base firefox

Som standart kan man også bruge: google dict goto quot

Udgivet i Knowledge Base, Old Base, Workstation | Skriv en kommentar

DHCP -> A,PTR -> DNS (ics)

This is an example for a private /24 network prefixed width 10.10.10. With a dhcp area from 1-50 and server ip 254 and admin pc 100.

First dhcpd.conf:
option domain-name “lan.company.dk”;
option domain-name-servers 10.10.10.254;
default-lease-time 600;
max-lease-time 7200;
authoritative;
ddns-update-style interim;
ddns-ttl 7200;

subnet 10.10.10.0 netmask 255.255.255.0 {
range 10.10.10.1 10.10.10.50;
option routers 10.10.10.254;
option broadcast-address 10.10.10.255;
ignore client-updates;
ddns-updates on;
ddns-domainname “lan.”;
ddns-rev-domainname “in-addr.arpa.”;
default-lease-time 600;
max-lease-time 7200;

key “dhcpkey” {
algorithm hmac-md5;
secret
“secretmd5hashwhoknowsfor”;
};

zone cafe. {
primary 127.0.0.1;
key “dhcpkey”;
}

zone 10.10.10.in-addr.arpa {
primary 127.0.0.1;
key “dhcpkey”;
}

}

host admin {
hardware ethernet 00:0b:6a:46:31:77;
fixed-address 10.10.10.100;
}

– dhcpd.conf end

Next we need some dns. We need bind 9, the named.conf should look something like this:

include “/usr/local/etc/rndc.key”;

options {
directory “/usr/local/etc”;
pid-file “/var/run/named/pid”;
};

zone “cafe.” IN {
type master;
file “lan.zone”;
update-policy { grant dhcpkey subdomain lan. A TXT; };
notify yes;
};

zone “10.10.10.in-addr.arpa.” {
type master;
file “lan.rev”;
update-policy { grant dhcpkey subdomain 10.10.10.in-addr.arpa. PTR TXT; };
notify yes;
};

zone “.” {
type hint;
file “named.root”;
};

– named.conf end

Ofcourse path’s may change, this was done on freebsd, this one requires 2 zonefiles and a rndc.key:

key “dhcpkey” {
algorithm hmac-md5;
secret “secretmd5hashwhoknowsfor”;
};

– rndc.key end

Key’s are genereated and then cut’n’pasted:
localhost# dnssec-keygen -a HMAC-MD5 -b 256 -n HOST dhcpkey
Kdhcpkey.+157+00190
localhost# dnssec-keygen -a HMAC-MD5 -b 256 -n HOST dhcpkey
Kdhcpkey.+157+43984

lan.zone:
$TTL 10800 ; 3 hours
cafe IN SOA server.lan. ekim.at.unifix.org. (
115 ; serial
10800 ; refresh (3 hours)
3600 ; retry (1 hour)
604800 ; expire (1 week)
3600 ; minimum (1 hour)
)
NS server.lan.
A 10.0.0.1
admin A 10.10.10.100
main A 10.10.10.254
server A 10.10.10.254
lan.zone – end

and lan.rev:
$TTL 180 ; 3 minutes
10.10.10.in-addr.arpa IN SOA main.lan. mike.at.unifix.org. (
16 ; serial
180 ; refresh (3 minutes)
60 ; retry (1 minute)
60 ; expire (1 minute)
60 ; minimum (1 minute)
)
NS main.lan.
100 PTR admin.lan.
254 PTR server.lan.
lan.rev – end

Notice evntualle that .254 has both main and server as A record but can only have one PTR record thus server.lan.

Happy hacking, now your network should be namyfied 🙂

Udgivet i Knowledge Base, Linux, Networking, Old Base | Skriv en kommentar

Creative port forwarding in FreeBSD (multivnc)

We needed some dynamic forwarding in FreeBSD

cd /usr/ports/sysutils/socket
make install

We needed to forward some vnc

vbcafe# echo vnc 5900/tcp >> /etc/services
vbcafe# echo vnc1 5901/tcp >> /etc/services
vbcafe# echo vnc2 5902/tcp >> /etc/services
vbcafe# echo vnc3 5903/tcp >> /etc/services
vbcafe# echo vnc4 5904/tcp >> /etc/services
vbcafe# echo vnc5 5905/tcp >> /etc/services
vbcafe# echo vnc6 5906/tcp >> /etc/services
…and so on

Or for the lazy ones:
perl -e ‘for ($i=0; $i<50; $i++) { print “vnc$i “.($i+5900).”/tcp\n”;}’ >> /etc/services

vnc1 stream tcp nowait nobody /usr/local/bin/socket socket 10.1.1.1 5900

Udgivet i FreeBSD, Knowledge Base, Networking, Old Base | Skriv en kommentar

dhcp reverse lookup

Maskiner som requester dhcp og angiver deres hostadresse kan der laves lookup paa med flg. script. Hvis ikke det virker er det hoejest sandsynligt fordi dit os kalder dhcpd paa en anden maade en min freebsd box goer(std opsat) saa kan du angive path til dhcpd.leases filen manuelt. Jeg har lagt filen i /bin og kaldt den ‘fip’ derved:

vbcafe# ssh `fip pc9`
ssh: connect to host 10.10.10.19 port 22: Connection refused

og her var scriptet:

#!/usr/bin/perl

open fil, “ps ax|”;
while ( $dat = <fil>)
{
if ($dat =~ /dhcpd/)
{
@dat = split(” “,$dat);
$path=@dat[8];
}
}

$saveip=”not found\n”;

# $path = ‘-set-to-dhcpd.leases-file-if-dosnt-work’;

open fil,$path;
while ($dat=<fil>)
{
chop(@dat);
@dat=split(” “,$dat);
if ( @dat[0] eq “lease”) { $ip=@dat[1]; }
if ( @dat[1] eq ‘”‘.$ARGV[0].'”;’) { $saveip=$ip; }
}
close(fil);

print $saveip;

if ($saveip eq “not found”) {exit -1;}

#######################
Og til sidst 2 blanker linier til ære for Ove Sprogø, den store danske skuespiller som idag desvære ikke er mere. Må fred være med ham.

#######################

Udgivet i Knowledge Base, Linux, Networking, Old Base | Skriv en kommentar

Cafe firewall FreeBSD

==== rc.conf ===============================================

defaultrouter=”192.168.10.1″
hostname=”npcafe.secure-net.dk”
ifconfig_vr0=”inet 10.10.10.254 netmask 255.255.255.0″
ifconfig_sis0=”inet 192.168.10.199 netmask 255.255.255.0″

gateway_enable=”YES”
sshd_enable=”YES”
usbd_enable=”YES”
apache2_enable=”YES”
named_enable=”YES”

smbd_enable=YES
nmbd_enable=YES
dhcpd_enable=YES
dhcpd_ifaces=vr0

firewall_enable=YES

natd_enable=”YES”
natd_interface=”sis0″

==== firewall =============================================

#!/bin/sh

case “$1” in
start)
echo Starting firewall
ipfw -f flush

natd -n sis0
ipfw add divert natd ip from any to any via sis0

ipfw pipe 3 config bw 128Kbit/s queue 10 # Intet
ipfw pipe 2 config bw 2Mbit/s queue 10 # Mindre end vi har
ipfw pipe 1 config bw 10Mbit/s queue 10 # Mere end vi har

ipfw add allow all from any to me 445 keep-state
# ipfw add allow all from any to 212.242.77.76 22 keep-state

ipfw add deny all from 10.10.10.10/24 to any 22 keep-state

#Ting der er vigtige
ipfw add pipe 1 all from any 22 to any # SSH
ipfw add pipe 1 all from any 27960 to any # Quake3

#Ting der er semi vigtige
ipfw add pipe 2 all from any 80 to any # HTTP

#Ting der kan vaere lige meget
ipfw add pipe 3 all from any to any # Resten

ipfw add accept all from any to any
exit 0
;;
stop)
echo Stopping firewall
killall natd
# Minimal firewall settings, all allow for self and mike
ipfw -f flush
ipfw add allow all from any to any via lo0
ipfw add allow all from me to any keep-state
ipfw add allow all from 212.242.77.76 to me keep-state
;;
open)
echo Opening up firewall
ipfw -f flush
ipfw add allow all from any to any
;;
*)
echo “Usage: `basename $0` {start|stop|open}” >&2
exit 64
;;
esac

==== old firewall ============================== [syntax]

#!/bin/sh

case “$1” in
start)
echo Starting firewall
ipfw -f flush

natd -n sis0
ipfw add divert natd ip from any to any via sis0

# Clients to me

ipfw add allow all from 10.10.10.10/24 to me 139 keep-state #smb
ipfw add allow all from 10.10.10.10/24 to me 68 keep-state #dhcp
ipfw add allow all from 10.10.10.10/24 to me 53 keep-state #dns

# Admin to me
ipfw add allow all from 10.10.10.100 to me keep-state # kasse
ipfw add allow all from 212.242.77.76 to me keep-state # mike
ipfw add allow all from 81.19.234.132 to me keep-state # mike-2

# Clients to world
ipfw add deny all from 10.10.10.10/24 to any 445 keep-state #vira
ipfw add allow all from 10.10.10.10/24 to any keep-state #open

ipfw pipe 2 config bw 2Mbit/s queue 10
ipfw pipe 1 config bw 128Kbit/s queue 10

# layer 1 stuff
ipfw add queue 2 tcp from 10.10.10.10/24 to any 53 out
# ipfw add queue 1 tcp from 10.10.10.10/24 to any 27960 out
# ipfw add queue 1 tcp from 10.10.10.10/24 to any 22 out

# layer 2 stuff
#ipfw add queue 2 tcp from 10.10.10.10/24 to any 80 out
# ipfw add queue 2 tcp from 10.10.10.10/24 to any 21 out
# ipfw add queue 2 tcp from 10.10.10.10/24 to any 596 out

# layer 3 stuff – Anything not mentioned above gets the crap
ipfw add pipe 1 all from any to any out

ipfw add accept all from any to any

exit 0
;;
stop)
echo Stopping firewall
killall natd
# Minimal firewall settings, all allow for self and mike
ipfw -f flush
ipfw add allow all from any to any via lo0
ipfw add allow all from me to any keep-state
ipfw add allow all from 212.242.77.76 to me keep-state
;;
open)
echo Opening up firewall
ipfw -f flush
ipfw add allow all from any to any
;;
*)
echo “Usage: `basename $0` {start|stop|open}” >&2
exit 64
;;
esac

Udgivet i FreeBSD, Knowledge Base, Networking, Old Base | Skriv en kommentar

PDF -> PNG

#!/usr/bin/perl

for ($i=1; $i<=24; $i++)
{
system “gs -q -r300 -sDEVICE=png256 -sOutputFile=page$i.png -dFirstPage=$i -dLastPage=$i -dBATCH -dNOPAUSE ../skaerm-samlet-fantasy.pdf”;
}

Ripper 24 sider fra pdf dokumentet ‘skaerm-samlet-fantasy.pdf’ i stoerelse ‘300’ (wtf det saa en betyder) med filnavne page1-25.png

Udgivet i Knowledge Base, Old Base, Programmering | Skriv en kommentar

php4 on apache2 and IIS on windows xp

stop IIS and Apache

extract the zip file to c:\programmer\php
copy c:\programmer\php\php4ts.dll to c:\windows\system32\
copy c:\programmer\php\php.ini-recommended to c:\windows\php.ini

edit php.ini. Put:
doc_root = c:\webroot
extension_dir = “c:\programmer\php\extensions\”
session.save_path = c:\Inetpub\tmp\
if on IIS:
browscap = c:\windows\system\inetsrv\browscap.ini
done editing php.ini

create c:\Inetpub\tmp and make it writeable for all users, or for the web server user

for apache2 install:
edit httpd.conf. Put:
LoadModule php4_module “c:\programmer\php\sapi\php4apache2.dll”
AddType application/x-httpd-php .php

add ‘index.php’ to DirectoryIndex
done editing httpd.conf

for IIS install:
open the management console (start -> right click on ‘my computer’ -> manage)
go to Internet Information Service
right click on ‘Default Web Server’ and click properties
click Isapi filters and add
type a filter name (‘PHP’ would do fine) and give the path to php4isapi.dll (c:\programmer\php\sapi\php4isapi.dll)
click ok and go to the tab ‘Home Directory’
click ‘configuration’
click ‘add’
give the path to php4isapi.dll and the extension type ‘.php’
check ‘all methods’ and ‘script engine’
close all dialogs and restart IIS

Udgivet i Knowledge Base, Old Base, Windows | Skriv en kommentar