Snippets...page 1
Snippets...Heckling the lusers
Snippets...Life Notes and Windows tips from the Olde Days
Snippets...More L.N. and W. T. F. T. O. D., Partte Twoe
Snippets...Linux
% man spinthewheel
Name
spinthewheel - spins the wheel after drawing it.
Syntax
int spinthewheel (wheel, direction)
wheel *wheel;
int direction;
Description
spinthewheel spins the wheel after drawing it. The first
argument is a pointer to the wheel to spin; the second is
the direction in which to spin the wheel, and must be
assigned one of the following:
LEFT - spin the wheel left
RIGHT - spin the wheel right
See Also
drawthewheel(S), rotatethewheel(S)
Note
The spectral properties of spinthewheel are limited.
rotatethewheel provides a much better, more elaborate,
wheel spinner.
%
The research group of IBM Corp. has developed an auditing tool that can
monitor 802.11 wireless networks and collect security-related
information, allowing system administrators to take proper actions to
improve network security (http://www.research.ibm.com/gsal/wsa). The
Wireless Security Auditor, a prototype application running on Linux,
enables network administrators to find vulnerable access points by
monitoring and analyzing them in real-time and ensuring they are either
corrected or removed so they no longer pose a security threat to the
company network.
One person reports that disabling "BIOS shadow" (system & VIDEO), helped for him. As
Linux doesn't
use the BIOS, shadowing it doesn't help. Some computers may even give you 384k of extra
RAM if
you disable the shadowing. Just disable it, and see what happens. -- Philippe d'Offay
(xxx@pmdsoft.com).
dd if=/dev/random of=testfile bs=1024k count=*
dd if=/dev/HARD_DISK of=/dev/null bs=1024k count=MEGS
Change HARD_DISK to "hda" to the name of your harddisk (e.g. hda or sda. Or use "df .").
Change
the MEGS to the number of megabytes of main memory that you have. This will cause the
first
several megabytes of your harddisk to be read from disk, forcing the C source files and the
gcc
binary to be reread from disk the next time you run it. Now type make again.
dd if=/dev/zero of=/tmp/lfs.disk bs=1024 count=768000
mke2fs /tmp/lfs.disk
We don't have a partition to mount. But we've got a file. Mounting a file goes
via the so-called "loop device". Now it is vitally important to check your
actual kernel configuration for having the "CONFIG_BLK_DEV_LOOP" (Block Devices
-> Loop Device in "make [x|menu]config"). You can also do this through the
command
cat /usr/src/linux/.config | grep CONFIG_BLK_DEV_LOOP
If it says something like "CONFIG_BLK_DEV_LOOP=m" or "CONFIG_BLK_DEV_LOOP=y",
then everything is fine and you can skip the next few steps. If it says some-
thing like "# CONFIG_BLK_DEV_LOOP is not set" then you have to compile a module
enabling the usage of loop devices for your kernel. That's
sed s/\#\ CONFIG_BLK_DEV_LOOP\ is\ not\ set/CONFIG_BLK_DEV_LOOP=m/ \
/usr/src/linux/.config > conf && mv conf /usr/src/linux/.config &&
cd /usr/src/linux && make modules modules_install && insmod loop
Now that you've enabled the usage of loop devices in your kernel, you can get
on mounting the lfs.disk file:
mount /tmp/lfs.disk /mnt/lfs -o loop
Mount the main partition to "/mnt" in the chroot'ed environment suggesting your
main partition is /dev/hda1, otherwise fill in what is necessary:
mount /dev/hda1 /mnt
You'll have to get the main partition entirely clean from everything that is not
/tmp/lfs.disk.
for dirname in `ls /mnt | sed s/tmp//`; do rm -r $dirname; done &&
for filename in `ls /mnt/tmp | sed s/lfs.disk//`; do rm $filename; done
Now it's clean for copying the LFS system. Everything but the /mnt directory,
to which the device that we are filling with LFS is mounted and the directory
/proc, in which are dynamic files written by the kernel.
for dirname in `ls / | sed s/mnt// | sed s/proc//`; do
cp -a $dirname /mnt; done
Now the LFS is on your primary partition logout of the chroot'ed environment
into the new system. Now you can perform lilo and this stuff.
Keeping in mind that an ISO is an exact image of the CD itself in a file, and linux's devices
are but
extensions to the filesystem, surely we should be able to mount an iso and check it out
before the
more permanent burn?
"All you need to use is the loopback device like this:
mount /home/clive/isos/MyNewImage.iso /mnt/cdrom -o loop=/dev/loop3
0 1 * * * find /tmp -atime +3 -exec ls -l {} \;
This entry tells cron to fire off at 1:00 a.m. every day, execute the find program to check in
the /tmp
directory for any files that haven't been accessed in more than 3 days, and list them by
executing the
ls -l command. The {} tells exec to do this for every file found. The \ just tells exec that its
work is
done.
if the superblock is gone, fetch a duplicate with the e2fsck -f -b /dev/hda1 command.
GOBBLES@LABSLACK:/hacking/gzip$ /bin/gzip `perl -e 'print "A" x 2048'`
Next, tar the contents of the directory using the create (i.e., the "c"
Option). Pipe the output to a tar extract (i.e., the "x" option)
command. The tar extract should be enclosed in parentheses and contain
two parts: 1) the cd part, which positions you in the destination
directory, and 2) the extract part, which extracts the files and
supplies excessive output in the process (due to the verbose, "v",
option).
% tar cBf - * | (cd todir; tar xvpBf -)
12 * * * * find / -type d -name core -exec rm {} \;
One of the best uses of find that I have discovered is its ability to
locate a string when you've no idea where it may be referenced. For
example, if I need to locate and expunge all references to one customer
in a directory before shipping off a tarball of files to another
customer, I might use a command like this:
% find . -type f -exec grep Acme {} \; -print
This proposal was prepared for Acme Corporation of
./prop0701
<TITLE>Acme Corp</TITLE>
./customer-stats/stats1.html
I've found that, by putting the print command at the end, this find
command only lists the names of files that contain the searched for
string.
Since I suspected this was the problem, it was pretty easy to figure
out where the rogue machine was. I simply pinged all the local
machines ('nmap -sP 192.168.1.0/24' will do this quickly) and then
checked the ARP table ('arp -an') for duplicates. I actually used the
following very lame command to show me duplicate entries:
$ arp -an| awk '{print $4}'| sort | uniq -c | grep -v ' 1 '
5 F8:F0:11:15:34:51
88 <incomplete>
Then I simply looked at the IP addresses used by that ethernet address
in 'arp -an' output, ignoring those that were blatantly poisoned (such
as the router) and looked up the remaining address in DNS to see which
machine it was. It was the desktop machine for one of the students in
the lab. I sent all the info I had to the school's IT security folks;
later that day they visited the student, and not to offer him a free
pizza. Of course, our cleanup had only just begun.
IN PRISON...you spend the majority of your time in an 8X10
cell. AT WORK... you spend the majority of your time in a 6X8
cubicle.
IN PRISON...you get three meals a day. AT WORK...you only get
a break for one meal and you pay for it.
IN PRISON...you get time off for good behavior. AT WORK...you
get more work for good behavior.
IN PRISON...the guard locks and unlocks all the doors for you.
AT WORK...you must carry around a security card and open all
the doors for yourself.
IN PRISON...you can watch TV and play games. AT WORK...you get
fired for watching TV and playing games.
IN PRISON...you get your own toilet. AT WORK...you have to
share with some idiot who pees on the seat.
IN PRISON...they allow your family and friends to visit. AT
WORK...you can't even speak to your family.
IN PRISON...all expenses are paid by the taxpayers with no
work required. AT WORK...you get to pay all the expenses to go
to work and then they deduct taxes from your salary to pay for
prisoners.
IN PRISON...you spend most of your life inside bars wanting to
get out. AT WORK...you spend most of your time wanting to get
out and go inside bars.
IN PRISON...you must deal with sadistic wardens. AT
WORK...they are called managers.
( ( _______
)) )) .-"There's always time for a good cup of coffee"-. >====<--.
C|~~| C|~~| `----------------------------------------------------------- ' | = |-'
`---' `---' `----------------------------------------------------------- ' `--------'
Comments? Good luck!
E-Mail:
Home Privacy Policy Terms of Use
© BRENT KEVIN KRKOSSKA