mIRC like perform in Xchat (multiple connect commands)

Instead of being limited to one connect command you can make af file with all the commands you need in.

In "Connect Command" you can use "/load -e /path/to/file" with all the things needed.
Make individual files for each network you are on.

For quakenet you can do something like this in the file:
msg Q@CServe.quakenet.org auth username password
mode yournickname +x 
msg q invite #secret_channel_that_is_invite_only
j #channel_1
j #channel_2
j #secret_channel_that_is_invite_only


// Vladimirr.dk
Udgivet i FreeBSD, IRC, Knowledge Base, Linux, Old Base | Skriv en kommentar

Password recovery on Cisco-routers

Step-by-step...

1. Get connected with a rollover-cable from your serial-interface, to the
routers console-interface.

2. Coldboot your router, and within the first 60 secs of the boot-sequence 
send the break signal.

3. You're now in boot-mode, and now we can change the routers config-register 
to NOT load the startup-config from the routers NVRAM at startup.
This are done by changeing it from default 0x2102 to 0x2142 by entering the 
command: 'o/r 0x2142'.

4. Reboot the router by entering 'i'.

5. Bypass the setup-mode, and enter privileged mode.

6. Copy the bypassed startup-config to running-config by entering the 
command: 'copy start run'. We will not be prompted for password, as we already 
are in privileged mode.

7. Set new passwords on privileged mode, interfaces, lines ect.

8. Go to global configuration mode and reset the config-register to the 
default, by entering: 'config-register 0x2102'.

!! Remember to backup the running config to NVRAM!

// Benne
Udgivet i Cisco, Knowledge Base, Networking, Old Base | Skriv en kommentar

PHP unicode decoder

function unicode_decode($txt) {
 $txt = preg_replace_callback(
  '/%u([[:alnum:]]{4})/',
  create_function('$match', 'return "&#".hexdec($match[1]).";";'),
  $txt
 );
 $txt = preg_replace_callback(
  '/%([[:alnum:]]{2})/',
  create_function('$match', 'return "&#".hexdec($match[1]).";";'),
  $txt
 );
 return ($txt);
}

 

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

Dead paths in FreeBSD

If your FreeBSD can’t find the path to a newly installed program from ports, just run “rehash”

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

Binary Prefix Definition

http://physics.nist.gov/cuu/Units/binary.html

MegaBytes = 1000 * 1000 bytes
MeBiBytes = 1024 * 1024 bytes

Udgivet i Knowledge Base, Old Base | Skriv en kommentar

cvsup FreeBSD to current

Install cvsup:

cd /usr/ports/net/cvsup-without-gui && make install

For Stable use tag=RELENG_4

Create file /usr/src/current-supfile with this inside:
Use this cvsup file:
# IMPORTANT: Change the next line to use one of the CVSup mirror sites
*default host=cvsup.dk.FreeBSD.org
*default base=/usr
*default prefix=/usr
*default release=cvs tag=.
*default delete use-rel-suffix
*default compress
src-all

Run cvs up
/usr/local/bin/cvsup -g -L 2 /usr/src/current-supfile

Compile new source

rm -rf /usr/obj/* <- deletes old objectfiles cd /usr/src make buildworld <- starts the compile configure the kernel makefile cd /usr/src/sys//conf/
cp GENERIC MYKERNEL

edit mykernel to fit your configuration

compile kernel:

cd /usr/src
make buildkernel KERNCONF=MYKERNEL

install kernel:
make installkernel KERNCONF=MYKERNEL

reboot the machine, go into boot prompt and type: boot -singel now machine will boot into singelmode

fsck / <- run fsck on / mount -u / <- remont / rw mount -a -t ufs <- mount other unix file systems swapon -a <- activate swap install the souce we compiled before cd /usr/src make installworld Merge config files: (i almost never do this) /usr/sbin/mergemaster -a update sysinstall cd /usr/src/release/sysinstall make all install reboot into youre newly upgraded os: fastboot

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

Using threads in perl

Remember setting threads in your ./Configure, cause it’s not compiled by default!

Example:

#!/usr/bin/perl

use Thread;

new Thread \&test_sub;

sub test_sub {
while(1) {
sleep 2;
print “TestSUB\n”;
}
}

while(1){
sleep 3;
print “NormalProc\n”;
}

For more information, see http://www.xav.com/perl/lib/Thread.html

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

Netgear MR314 telnet interface

ifaces:
enif0 = lan
enif1 = wan

ifconfig:
ip ifconfig

route:
ip route status
ip route add [/] []
ip route addiface [/] []
ip route drop [/]

dhcp:
ip dhcp status
ip dhcp client release
ip dhcp client renew

arp:
ip arp status

Udgivet i Hardware hacking, Knowledge Base, Old Base | Skriv en kommentar

Change NIC MAC in linux

root@spacecamp:~# ifconfig eth2 down
root@spacecamp:~# ifconfig eth2 hw ether aa:aa:aa:aa:aa:aa
root@spacecamp:~# ifconfig eth2 up
root@spacecamp:~# ifconfig eth2
eth2      Link encap:Ethernet  HWaddr AA:AA:AA:AA:AA:AA
          inet addr:192.168.20.1  Bcast:192.168.20.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1275 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:0 (0.0 b)  TX bytes:319067 (311.5 Kb)
          Interrupt:11 Base address:0x4000
Udgivet i Knowledge Base, Linux, Networking, Old Base | Skriv en kommentar

Adding an ip alias to a NIC in FreeBSD & Linux

Freebsd :
rc.conf:

ifconfig_rl0_alias0=”10.1.1.24 netmask 0xffffffff”

manually:

ifconfig rl0 alias 10.1.1.24 netmask 0xffffffff

Linux:

ifconfig eth0:0 10.1.1.25 netmask 255.255.255.255

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