Shell script patch sys openbsd and build new kernel

July 22, 2008

#!/bin/sh
cd /usr/src

#wget –passive-ftp ftp://ftp.openbsd.org/pub/OpenBSD/`uname -r`/sys.tar.gz

#tar zxvf sys.tar.gz

#wget –passive-ftp ftp://ftp.openbsd.org/pub/OpenBSD/patches/`uname -r`/common/*

echo “run patch -p0 < *.patch”

ls *.patch >> file.patch

for i in `cat file.patch`
do
patch -p0 < $i
done

cd /usr/src/sys/arch/`arch -s`/conf
config GENERIC && cd ../compile/GENERIC
make depend && make && sudo make install
reboot


dns-cache-poisoning-test vul or not

July 21, 2008

Use this command

$ dig +short @{name-server-ip} porttest.dns-oarc.net txt
$ dig +short @ns1.example.com porttest.dns-oarc.net txt
$ dig +short @208.67.222.222 porttest.dns-oarc.net txt

Output:
z.y.x.w.v.u.t.s.r.q.p.o.n.m.l.k.j.i.h.g.f.e.d.c.b.a.pt.dns-oarc.net.
“208.67.222.222 is GOOD: 26 queries in 0.1 seconds from 26 ports with std dev 17746.18″

Another test,
$ dig +short @125.22.47.125 porttest.dns-oarc.net txt

Output:

z.y.x.w.v.u.t.s.r.q.p.o.n.m.l.k.j.i.h.g.f.e.d.c.b.a.pt.dns-oarc.net.
“125.22.47.139 is POOR: 42 queries in 8.4 seconds from 1 ports with std dev 0.00″


Network Layer — IP — Internet Protocol

July 16, 2008

The key to all this is the following relations of decimal versus binary:

Decimal Binary How the binary is built
0 00000000
128 10000000 (128)
192 11000000 (128 + 64)
224 11100000 (128 + 64 + 32)
240 11110000 (128 + 64 + 32 + 16)
248 11111000 (128 + 64 + 32 + 16 + 8)
252 11111100 (128 + 64 + 32 + 16 + 8 + 4)
254 11111110 (128 + 64 + 32 + 16 + 8 + 4 + 2)
255 11111111 (128 + 64 + 32 + 16 + 8 + 4 + 2 + 1)

Given that, we can build the following table:

Useful only for| Useful for subnets | Useful for subnets | Useful for subnets
CIDR blocks | of /8, or for CIDR | of /8 or /16, or for | of any networks
of any networks| blocks of /16 and | CIDR blocks of /24 |
| /24 networks | networks |
| | |
0.0.0.0 /0 | 255.0.0.0 /8 | 255.255.0.0 /16 | 255.255.255.0 /24
128.0.0.0 /1 | 255.128.0.0 /9 | 255.255.128.0 /17 | 255.255.255.128 /25
192.0.0.0 /2 | 255.192.0.0 /10 | 255.255.192.0 /18 | 255.255.255.192 /26
224.0.0.0 /3 | 255.224.0.0 /11 | 255.255.224.0 /19 | 255.255.255.224 /27
240.0.0.0 /4 | 255.240.0.0 /12 | 255.255.240.0 /20 | 255.255.255.240 /28
248.0.0.0 /5 | 255.248.0.0 /13 | 255.255.248.0 /21 | 255.255.255.248 /29
252.0.0.0 /6 | 255.252.0.0 /14 | 255.255.252.0 /22 | 255.255.255.252 /30
254.0.0.0 /7 | 255.254.0.0 /15 | 255.255.254.0 /23 | 255.255.255.254 /31

Read the rest of this entry »


Renungan bersama…

March 23, 2008

Tahukah kita apa yang terbaik untuk kita? Kalau kita dilahirkan miskin, kita sering berdoa untuk menjadi kaya. Hendak mengubah kehidupan, kita kata. Tapi kita pastikah kekayaan itu yang terbaik untuk kita?


key foxit reader pro

March 5, 2008

[Foxit Reader Pro]
SN=FRPFZ5390
Users=1
Licensee=EXPLOSiON
LicenseDate=2007/04/07
Sign=3BBCDAEDF161010820508F6B9DB787480155964B1520842088EF1E14086C381BEC27CAB41ECEFA2A


Protected: ???

February 12, 2008

This post is password protected. To view it please enter your password below:



Display Microsoft fonts like in Windows in CentOS/Fedora

January 14, 2008

Staying in front of your computer for hours and hours with the default fonts can be a challenge on Linux/Unix. I, for one, can’t work properly without the Windows fonts comfort :)

Having the windows fonts working on Unix systems is fairly easy, but on Red Hat-based operating systems such as CentOS or Fedora, can be a real nightmare. The most critical aspect of having the Microsoft fonts to display properly on CentOS in compiling freetype with bytecode interpreter enabled. Let’s go through this procedure.

This tutorial assumes you have the 3 most popular community repositories enabled (Karanbir Singh, Dag Wieers and Dries).

Read the rest of this entry »


Bring back deleted files with lsof

January 14, 2008

There you are, happily playing around with an audio file you’ve spent all afternoon tweaking, and you’re thinking, “Wow, doesn’t it sound great? Lemme just move it over here.” At that point your subconscious chimes in, “Um, you meant mv, not rm, right?” Oops. I feel your pain — this happens to everyone. But there’s a straightforward method to recover your lost file, and since it works on every standard Linux system, everyone ought to know how to do it.

Read the rest of this entry »


Creating Jigsaw Download (Jigdo) files for downloading ISO’s

January 13, 2008

Introduction

Jigdo (JIGsaw DOwnload) is a small utility that can assemble a CD/DVD image from it’s internal files.

For example, Debian has been using it for years for distributing the entire distribution: you downloaded a .jigdo file, and then, using the utility jigdo-lite (package jigdo-file on Debian like and RPM based [1]. This way, you only downloaded small files from servers, preventing line failures, spreading load between several servers, etc.

Furthermore, if you already had some files (for example if you started at version X and have been downloading and keeping al files until X.Y, jigdo, can use those updated files to compare them against the .jigdo file and avoid downloading duplicated files…

Read the rest of this entry »


Prevent locked by iptables rules

January 12, 2008
*/10 * * * * /root/cikon/allow.sh
#!/bin/sh
/sbin/iptables -F
/sbin/iptables --flush
/sbin/iptables --table nat --flush
/sbin/iptables --delete-chain
/sbin/iptables --table nat --delete-chain  

#2nd way to write into allo.sh

#!/bin/sh
/sbin/iptables -F
/sbin/iptables -F -t nat
/sbin/iptables -F -t mangle
/sbin/iptables -P INPUT ACCEPT
/sbin/iptables -P OUTPUT ACCEPT
/sbin/iptables -P FORWARD ACCEPT