https://hackepedia.org/api.php?action=feedcontributions&user=Hawson&feedformat=atomHackepedia - User contributions [en]2024-03-29T06:49:36ZUser contributionsMediaWiki 1.35.0https://hackepedia.org/?title=Profiles&diff=5701Profiles2020-02-05T01:02:07Z<p>Hawson: </p>
<hr />
<div>All users on a system have the ability to customize their [[environment]] to their taste. This can involve choosing a [[shell]] such as bash, zsh, or tcsh, setting the environment, shell aliases, or running scripts at startup. These tasks are all handled by various "profile scripts".<br />
<br />
A detailed comparison of multiple shells can be found at https://mikemol.github.io/graphviz/refactor/sh/zsh/bash/2018/02/04/graphviz-sh-zsh-bash-refactor.html while a shorter, simpler comparison of basic options between <code>bash</code> and <code>tsch</code> is below.<br />
<br />
There can be a fair amount of confusion as to what scripts are called, and in what order (tcsh is especially bad in this regard).<br />
<br />
The profile scripts used by Bash (version 3) and tcsh (v6.13) look something like this:<br />
<br />
; [[image:bash_profile_scripts.png]]<br />
: [[bash profile image source | Image source]]<br />
<br />
Another way to look at this information:<br />
<br />
{|border=2<br />
! *ENV* <br />
! Interactive Login = Yes <br />
! Interative Login = No<br />
|-<br />
! Login = Yes <br />
| <code>/etc/profile<br />~/.bash_profile</code> <br />
| <code>/etc/profile<br />~/.bash_profile<br />$BASH_ENV</code><br />
|-<br />
! Login = No<br />
| <code>/etc/profile<br/> ~/.bash_profile <br/>~/.bashrc</code><br />
| <code>$BASH_ENV</code><br />
|}<br />
<br />
<br />
----<br />
<br />
<br />
; [[image:tcsh_profile_scripts.png]]<br />
:[[tcsh profile image source | Image source]]</div>Hawsonhttps://hackepedia.org/?title=Profiles&diff=5650Profiles2015-05-12T15:47:05Z<p>Hawson: </p>
<hr />
<div>All users on a system have the ability to customize their [[environment]] to their taste. This can involve choosing a [[shell]] such as bash, zsh, or tcsh, setting the environment, shell aliases, or running scripts at startup. These tasks are all handled by various "profile scripts".<br />
<br />
There can be a fair amount of confusion as to what scripts are called, and in what order (tcsh is especially bad in this regard).<br />
<br />
The profile scripts used by Bash (version 3) and tcsh (v6.13) look something like this:<br />
<br />
; [[image:bash_profile_scripts.png]]<br />
: [[bash profile image source | Image source]]<br />
<br />
Another way to look at this information:<br />
<br />
{|border=2<br />
! *ENV* <br />
! Interactive Login = Yes <br />
! Interative Login = No<br />
|-<br />
! Login = Yes <br />
| <code>/etc/profile<br />~/.bash_profile</code> <br />
| <code>/etc/profile<br />~/.bash_profile<br />$BASH_ENV</code><br />
|-<br />
! Login = No<br />
| <code>/etc/profile<br/> ~/.bash_profile <br/>~/.bashrc</code><br />
| <code>$BASH_ENV</code><br />
|}<br />
<br />
<br />
----<br />
<br />
<br />
; [[image:tcsh_profile_scripts.png]]<br />
:[[tcsh profile image source | Image source]]</div>Hawsonhttps://hackepedia.org/?title=File:Bash_profile_scripts.png&diff=5373File:Bash profile scripts.png2012-01-13T21:37:38Z<p>Hawson: uploaded a new version of &quot;File:Bash profile scripts.png&quot;</p>
<hr />
<div>flowcart of bash profile scripts.</div>Hawsonhttps://hackepedia.org/?title=Pid&diff=4526Pid2010-07-30T13:26:37Z<p>Hawson: /* Random pids */</p>
<hr />
<div>A pid is the [[process]] identification number. Special pids are [[swapper]] (0) and [[init]] (1). <br />
<br />
=== Random pids ===<br />
<br />
[[OpenBSD]] chooses a random pid number when a new [[process]] is [[fork]]ed, other systems choose the next sequentially available number, and when the maximum pid number is reached the number will wrap around back to the beginning. This means that pids are recycled and on a busy system it may not take long for a new process to take the pid of another process that just ended.<br />
<br />
There are patches for other OSes, including Linux have patches for this (http://www.vanheusden.com/Linux/sp/)</div>Hawsonhttps://hackepedia.org/?title=HDD&diff=4452HDD2009-10-26T11:57:56Z<p>Hawson: </p>
<hr />
<div>HDD stands for "hard disk drive", typically where data is stored on computer. As this is a mechanical device, it is one of the more likely devices to fail inside of your computer. For this reason, make SURE you do a [[backup]] of any important data you have.<br />
If you do think your HDD is dying, or are having issues and would like to check, all major HDD vendors offer a diagnostic boot cd image. This means you should download it, and [[burn]] it onto a cd, and boot your computer off it, which will step you through the process of testing your HDD for issues.<br />
<br />
[http://www.maxtor.com/en/support/downloads/powermax.htm Maxtor/Quantum]<br />
<br />
[http://www.maxtor.com/en/support/downloads/scsimax.htm Maxtor/Quantum SCSI]<br />
<br />
[http://www.maxtor.com/en/support/downloads/maxblast3.htm Maxtor's MaxBlast 4 Diagnostic software]<br />
<br />
[http://www.hitachigst.com/hdd/support/download.htm Hitachi/IBM]<br />
<br />
[http://www.fcpa.com/support/hard-drives/software_utilities.html Fujitsu]<br />
<br />
[http://www.seagate.com/support/seatools/ Seagate]<br />
<br />
[http://www.samsung.com/Products/HardDiskDrive/utilities/shdiag.htm Samsung]<br />
<br />
[http://support.wdc.com/download/ Western Digital]<br />
<br />
[http://support.gateway.com/support/supinfo/index.asp?pg=2&file=util.html Gateway]<br />
<br />
<br />
<br />
== Secure deletion ==<br />
<br />
If you have [[shred]] installed, you can use<br />
<br />
# shred -vz -n 50 /dev/hda<br />
<br />
assuming /dev/hda is the disk you'd like to wipe. If you don't have shred installed, you can use trusty [[dd]]:<br />
<br />
# dd if=/dev/random of=/dev/hda<br />
<br />
[http://dban.sourceforge.net/ dban] is a boot floppy, that is also included on the [http://www.ultimatebootcd.com/ Ultimate boot cd]<br />
<br />
[http://www.cs.auckland.ac.nz/~pgut001/pubs/secure_del.html Peter Gutmann's paper on secure deletion of data]<br />
<br />
<br />
== Testing on Linux ==<br />
<br />
To test read speed on /dev/sda:<br />
$ sudo hdparm -tT [[Variables|/dev/sda]]<br />
<br />
To test write speed on /dev/sda (this assumes it's mounted and contains /tmp, and you have one gigabyte of available space!)<br />
$ dd count=1k bs=1M if=/dev/zero of=/tmp/test.img<br />
<br />
Better tests can be obtained using tools written for the purpose.<br />
; ddt : This is a hack of <code>dd</code> that will report timing/bandwidth information written by [http://coraid.com/ Coraid]. It can be found at http://support.coraid.com/support/sr/ddt-8.tgz<br />
: Sample output:<br />
<ol><pre>[root@saturn /scratch]# ddt -c 10240 -b 1k .<br />
* warning: total I/O < total ram - throughput reported may not reflect I/O path.<br />
Writing to ./ddt.29528 ... syncing ... done.<br />
sleeping 10 seconds ... done.<br />
Reading from ./ddt.29528 ... done.<br />
10 MiB KiB/s CPU%<br />
Write 75851 38<br />
Read 1024000 50</pre></ol><br />
<br />
; iozone : This is a wonderfully detailed program, useful for getting a comprehensive test of your IO system. Details at http://www.iozone.org/ (and much too complicated to describe here!)</div>Hawsonhttps://hackepedia.org/?title=Internet&diff=4338Internet2009-04-30T14:11:06Z<p>Hawson: </p>
<hr />
<div>The Internet is a bunch of tubes connected together. There can be many internets but there is only one Internet (with a capital I) that is official.<br />
<br />
Common practice regarding the usage of the Internet<br />
<br />
1) [[Internet:Fighting]]<br />
<br />
2) [[Internet:Help Process]]<br />
<br />
3) [[Internet:Text]]<br />
<br />
<br />
Most commonly you'll use a [[Browser]] to "surf" the world wide web, or use an [[MUA]] to send [[Email]]. If you like to chat with others, you may try an [[IM]] client if you know which protocol your friends use, or the infamous [[IRC | Internet Relay Chat]].</div>Hawsonhttps://hackepedia.org/?title=Encryption&diff=4017Encryption2008-02-05T16:05:31Z<p>Hawson: Changes, linkage, etc</p>
<hr />
<div>== Background== <br />
<br />
Encryption is the art of obfuscating information so that a third party cannot read its contents. The encrypted text in encryption is called ciphertext. In plain text it's called plaintext.<br />
<br />
Meet ''Alice'' and ''Bob''.<br />
<br />
In most cryptography examples, Alice wants to send something to Bob. In our case, Alice likes Bob and wants to write him a loveletter.<br />
<br />
Meet Eve (the person that eavesdrops).<br />
Meet Mallory (the person that likes to destroy things).<br />
<br />
Eve loves gossip, and just wants to read the loveletter. Mallory is actually jealous of Alice, and not only wants to read the letter, but wants to make Bob mad at Alice.<br />
<br />
There are different types of encryption, symmetric and asymetric. Symetric encryption requires a secret key that is well known (or "shared") by everyone reading and writing the message (in our example, Alice and Bob). This is the form of encryption most people are familiar with. If someone else (Eve or Mallory) somehow learns the secret key, that person can read all of the messages encrypted with that key. The biggest weakness in most symetric encryption systems is how the [[key distribution|shared key is distributed]].<br />
<br />
In anymetric encryption, two different keys are used for encryption and decryption, removing many of the problems of key distribution. The most common form of asymetric encryption is known as [[public key]] encryption. If Bob doesn't have the secret key, he and Alice can use public encryption (asymetric) to work out a new key in a secure fashion. Public key encryption is subject to the [[Man in the middle]] attack, whereby Eve or Mallory intercepts the message from Alice to Bob, decrypts (and possibly alters) it, then re-encrypts the message with his ''own'' key, before sending it along to Bob.<br />
<br />
== Symmetric Encryption ==<br />
<br />
There is several private key encryptions such as<br />
<br />
DES<br />
3DES<br />
AES<br />
Blowfish<br />
(and many others)<br />
<br />
Most of these are considered BLOCK ciphers because, as in Blowfish's case you can only encrypt a block of 8 bytes at a time.<br />
<br />
Stream ciphers are opposite and encrypt a bit or byte at a time.<br />
<br />
RC4 - supposedly is a stream cipher.<br />
<br />
Private key or Symmetric encryption needs Alice and Bob to have the <br />
same key, perhaps negotiated last thursday when they had lunch together down at the Plaza, we saw Alice write the key on Bob's napkin.<br />
<br />
<br />
== Asymmetric Encryption ==<br />
<br />
Diffie-Hellman exchange<br />
RSA<br />
<br />
== Further reading ==<br />
<br />
; <u>Applied Cryptography</u> by Bruce Schneier : http://www.schneier.com/book-applied.html Currently ''the'' definative reference (unclassified, at least) on cryptography. The entire book is availabe in PDF form at this location: http://www.cacr.math.uwaterloo.ca/hac/</div>Hawsonhttps://hackepedia.org/?title=Profiles&diff=3961Profiles2008-01-29T17:21:45Z<p>Hawson: </p>
<hr />
<div>All users on a system have the ability to customize their [[environment]] to their taste. This can involve choosing a [[shell]] such as bash, zsh, or tcsh, setting the environment, shell aliases, or running scripts at startup. These tasks are all handled by various "profile scripts".<br />
<br />
There can be a fair amount of confusion as to what scripts are called, and in what order (tcsh is especially bad in this regard).<br />
<br />
The profile scripts used by Bash (version 3) and tcsh (v6.13) look something like this:<br />
<br />
; [[image:bash_profile_scripts.png]]<br />
: [[bash profile image source | Image source]]<br />
<br />
<br />
; [[image:tcsh_profile_scripts.png]]<br />
:[[tcsh profile image source | Image source]]</div>Hawsonhttps://hackepedia.org/?title=Tcsh_profile_image_source&diff=3960Tcsh profile image source2008-01-29T17:21:20Z<p>Hawson: New page: This is the source for the 100px file. It was made in [http://xfig.org/ xfig], just copy/paste the text below into a file, and load it using xfig. <pre...</p>
<hr />
<div>This is the source for the [[Image:Tcsh_profile_scripts.png|100px]] file. It was made in [http://xfig.org/ xfig], just copy/paste the text below into a file, and load it using xfig.<br />
<br />
<pre><br />
#FIG 3.2<br />
Landscape<br />
Center<br />
Inches<br />
Letter<br />
100.00<br />
Single<br />
-2<br />
1200 2<br />
6 2625 3900 4425 4575<br />
3 2 0 1 0 7 50 -1 -1 0.000 0 1 0 3<br />
1 1 1.00 60.00 120.00<br />
4425 3975 3750 4125 3375 4575<br />
0.000 -1.000 0.000<br />
4 1 0 50 -1 1 14 0.0000 4 150 960 3150 4050 Interactive\001<br />
4 1 0 50 -1 1 14 0.0000 4 195 480 3150 4350 Login\001<br />
-6<br />
6 3600 1050 5925 2100<br />
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5<br />
3600 1050 5925 1050 5925 2100 3600 2100 3600 1050<br />
4 0 0 50 -1 2 16 0.0000 4 225 1425 4050 1650 System Login\001<br />
-6<br />
6 3750 8100 5700 8850<br />
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5<br />
3750 8100 5700 8100 5700 8850 3750 8850 3750 8100<br />
4 1 0 50 -1 2 16 0.0000 4 165 1305 4650 8550 User Session\001<br />
-6<br />
6 3900 9600 5700 11850<br />
6 3900 9600 5700 11850<br />
6 3900 11250 5700 11850<br />
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5<br />
3900 11250 5700 11250 5700 11850 3900 11850 3900 11250<br />
4 1 0 50 -1 2 16 0.0000 4 165 1380 4800 11625 Close Session\001<br />
-6<br />
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2<br />
1 1 1.00 60.00 120.00<br />
4725 9900 4725 10275<br />
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2<br />
1 1 1.00 60.00 120.00<br />
4725 10725 4725 11100<br />
4 1 0 50 -1 0 14 0.0000 4 195 1260 4725 9750 /etc/csh.logout\001<br />
4 1 0 50 -1 0 14 0.0000 4 195 750 4725 10575 ~/.logout\001<br />
-6<br />
-6<br />
6 4800 2925 6900 5700<br />
3 2 0 1 0 7 50 -1 -1 0.000 0 1 0 4<br />
1 1 1.00 60.00 120.00<br />
6300 3975 6000 4500 5175 5025 4800 5700<br />
0.000 -1.000 -1.000 0.000<br />
3 2 0 1 0 7 50 -1 -1 0.000 0 1 0 3<br />
1 1 1.00 60.00 120.00<br />
5131 2966 5860 3093 6310 3543<br />
0.000 -1.000 0.000<br />
4 1 0 50 -1 0 14 0.0000 4 180 915 6375 3825 /etc/.cshrc\001<br />
4 1 0 50 -1 1 14 0.0000 4 150 600 6375 3075 Solaris\001<br />
4 1 0 50 -1 1 14 0.0000 4 195 375 6525 3300 only\001<br />
-6<br />
6 6300 9150 6975 9600<br />
4 1 0 50 -1 1 14 0.0000 4 150 600 6600 9300 Solaris\001<br />
4 1 0 50 -1 1 14 0.0000 4 195 375 6750 9525 only\001<br />
-6<br />
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2<br />
1 1 1.00 60.00 120.00<br />
4800 3150 4800 3525<br />
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2<br />
1 1 1.00 60.00 120.00<br />
4800 3975 4800 5700<br />
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2<br />
1 1 1.00 60.00 120.00<br />
4725 6225 4725 7950<br />
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2<br />
1 1 1.00 60.00 120.00<br />
4800 2250 4800 2700<br />
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2<br />
1 1 1.00 60.00 120.00<br />
4725 9000 4725 9375<br />
3 2 0 1 0 7 50 -1 -1 0.000 0 1 0 4<br />
1 1 1.00 60.00 120.00<br />
3450 5025 3750 5325 4500 5325 4800 5625<br />
0.000 -1.000 -1.000 0.000<br />
3 2 0 1 0 7 50 -1 -1 0.000 0 1 0 4<br />
1 1 1.00 60.00 120.00<br />
3438 7258 3750 7500 4425 7575 4725 7950<br />
0.000 -1.000 -1.000 0.000<br />
3 2 0 1 0 7 50 -1 -1 0.000 0 1 0 3<br />
1 1 1.00 60.00 120.00<br />
5175 6075 5550 6225 5700 6600<br />
0.000 -1.000 0.000<br />
3 2 0 1 0 7 50 -1 -1 0.000 0 1 0 4<br />
1 1 1.00 60.00 120.00<br />
5700 7050 5400 7350 4950 7500 4725 7950<br />
0.000 -1.000 -1.000 0.000<br />
3 2 0 1 0 7 50 -1 -1 0.000 0 1 0 3<br />
1 1 1.00 60.00 120.00<br />
4275 6225 3675 6525 3450 6900<br />
0.000 -1.000 0.000<br />
3 2 0 1 0 7 50 -1 -1 0.000 0 1 0 4<br />
1 1 1.00 60.00 120.00<br />
4725 9000 5175 9300 6300 9450 6675 9900<br />
0.000 -1.000 -1.000 0.000<br />
3 2 0 1 0 7 50 -1 -1 0.000 0 1 0 5<br />
1 1 1.00 60.00 120.00<br />
6600 10275 6225 10425 5625 10275 5025 10050 4725 10275<br />
0.000 -1.000 -1.000 -1.000 0.000<br />
4 1 0 50 -1 0 14 0.0000 4 180 1215 4875 3825 /etc/csh.cshrc\001<br />
4 1 0 50 -1 0 14 0.0000 4 195 1140 3375 4875 /etc/csh.login\001<br />
4 1 0 50 -1 0 14 0.0000 4 195 630 3375 7125 ~/.login\001<br />
4 1 0 50 -1 0 14 0.0000 4 180 765 4725 6075 ~/.tcshrc\001<br />
4 0 0 50 -1 2 16 0.0000 4 165 420 4650 3000 tcsh\001<br />
4 1 0 50 -1 0 14 0.0000 4 180 705 5700 6900 ~/.cshrc\001<br />
4 1 0 50 -1 1 14 0.0000 4 195 2175 6975 6300 only if ~/.tcshrcnot found\001<br />
4 1 0 50 -1 1 14 0.0000 4 150 960 3225 6375 Interactive\001<br />
4 1 0 50 -1 1 14 0.0000 4 195 480 3225 6675 Login\001<br />
4 1 0 50 -1 0 14 0.0000 4 195 960 6675 10125 /etc/.logout\001<br />
</pre></div>Hawsonhttps://hackepedia.org/?title=Bash_profile_image_source&diff=3959Bash profile image source2008-01-29T17:20:42Z<p>Hawson: New page: This is the source for the 100px file. It was made in [http://xfig.org/ xfig], just copy/paste the text below into a file, and load it using xfig. <pre...</p>
<hr />
<div>This is the source for the [[Image:Bash_profile_scripts.png|100px]] file. It was made in [http://xfig.org/ xfig], just copy/paste the text below into a file, and load it using xfig.<br />
<br />
<pre><br />
#FIG 3.2<br />
Landscape<br />
Center<br />
Inches<br />
Letter <br />
100.00<br />
Single<br />
-2<br />
1200 2<br />
6 4950 8775 7125 9375<br />
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5<br />
4950 8775 7125 8775 7125 9375 4950 9375 4950 8775<br />
4 0 0 50 -1 0 18 0.0000 4 195 1470 5325 9150 Close session\001<br />
-6<br />
6 3675 4650 5175 5550<br />
4 0 0 50 -1 0 16 0.0000 4 225 1500 3675 4875 ~/.bash_profile\001<br />
4 0 0 50 -1 0 16 0.0000 4 225 1335 3675 5175 ~/.bash_login\001<br />
4 0 0 50 -1 0 16 0.0000 4 225 945 3675 5475 ~/.profile\001<br />
-6<br />
6 3450 5625 5100 7350<br />
6 3450 6225 5100 6750<br />
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5<br />
3450 6225 5100 6225 5100 6750 3450 6750 3450 6225<br />
4 0 0 50 -1 0 16 0.0000 4 165 1260 3675 6600 User Session\001<br />
-6<br />
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 3<br />
1 1 1.00 60.00 120.00<br />
4275 5625 4275 6075 4275 6150<br />
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 3<br />
1 1 1.00 60.00 120.00<br />
4275 6825 4275 7275 4275 7350<br />
-6<br />
6 6975 6225 8625 6750<br />
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5<br />
6975 6225 8625 6225 8625 6750 6975 6750 6975 6225<br />
4 0 0 50 -1 0 16 0.0000 4 165 1260 7200 6600 User Session\001<br />
-6<br />
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5<br />
4575 300 7350 300 7350 1200 4575 1200 4575 300<br />
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2<br />
1 1 1.00 60.00 120.00<br />
5925 1350 5925 1950<br />
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 3<br />
1 1 1.00 60.00 120.00<br />
4275 3975 4275 4425 4275 4500<br />
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 3<br />
1 1 1.00 60.00 120.00<br />
7800 3975 7800 6075 7800 6150<br />
3 2 0 1 0 7 50 -1 -1 0.000 0 1 0 3<br />
1 1 1.00 60.00 120.00<br />
5475 2325 4650 2775 4275 3375<br />
0.000 -1.000 0.000<br />
3 2 0 1 0 7 50 -1 -1 0.000 0 1 0 3<br />
1 1 1.00 60.00 120.00<br />
6502 2367 7327 2817 7702 3417<br />
0.000 -1.000 0.000<br />
3 2 0 1 0 7 50 -1 -1 0.000 0 1 0 3<br />
1 1 1.00 60.00 120.00<br />
4275 7950 4425 8550 4800 8850<br />
0.000 -1.000 0.000<br />
3 2 0 1 0 7 50 -1 -1 0.000 0 1 0 3<br />
1 1 1.00 60.00 120.00<br />
7800 6975 7650 8325 7275 8925<br />
0.000 -1.000 0.000<br />
3 2 0 1 0 7 50 -1 -1 0.000 0 0 0 4<br />
3150 5100 3375 5025 3450 4800 3750 4650<br />
0.000 -1.000 -1.000 0.000<br />
3 2 0 1 0 7 50 -1 -1 0.000 0 0 0 4<br />
3159 5103 3384 5178 3459 5403 3759 5553<br />
0.000 -1.000 -1.000 0.000<br />
4 0 0 50 -1 0 18 0.0000 4 255 1515 5250 825 System Login\001<br />
4 0 0 50 -1 0 16 0.0000 4 225 1110 3750 3750 /etc/profile\001<br />
4 0 0 50 -1 0 18 0.0000 4 195 510 5700 2250 bash\001<br />
4 0 0 50 -1 0 16 0.0000 4 225 585 3975 2775 Login\001<br />
4 0 0 50 -1 0 16 0.0000 4 165 1050 3975 2475 Interactive\001<br />
4 0 0 50 -1 0 16 0.0000 4 225 1455 3675 7725 ~/.bash_logout\001<br />
4 0 0 50 -1 0 16 0.0000 4 165 1050 7125 2475 Interactive\001<br />
4 0 0 50 -1 0 16 0.0000 4 195 900 7275 3750 ~/.bashrc\001<br />
4 0 0 50 -1 0 16 0.0000 4 225 1005 7350 2775 Non-login\001<br />
4 0 0 50 -1 0 13 1.5708 4 150 1500 3000 5925 First match wins!\001<br />
</pre></div>Hawsonhttps://hackepedia.org/?title=Removing:Fingerprints&diff=3905Removing:Fingerprints2007-11-15T13:49:05Z<p>Hawson: </p>
<hr />
<div>A scar makes a fingerprint more unique.<br />
<br />
None of these have yet been tested by the editors:<br />
<br />
* burning off the skin<br />
* razor blades or surgical scalpel to remove the layers<br />
* chemical burn using purified hydrogen peroxide<br />
* create a blister, peel it, rinse and repeat<br />
* sandpaper<br />
* carve out portions of his fingerprint patterns and pour sulfuric or boric acid in the depressions<br />
<br />
<br />
'''NOTE:''' Not having any fingerprints at all is very uncommon, and places you into a very small group of people, and removing your fingerprints is probably going to make law enforcement officials ''more'' suspicious of you, rather than less. Depending on the method used, it is still likely that your fingers will leave oil-based markings of some form; they just won't look like traditional "fingerprints."</div>Hawsonhttps://hackepedia.org/?title=Manual&diff=3853Manual2007-09-21T13:33:30Z<p>Hawson: Reverted edits by Mr8M9x (Talk); changed back to last version by Franks</p>
<hr />
<div>Simple example to type at your [[shell]] prompt:<br />
$ man 1 intro<br />
This brings up the man page for intro(1). You can use your spacebar to go down a page, and "q" for quit.<br />
<br />
<br />
Most UNIX systems have online manual pages. <br />
<br />
MAN(1) OpenBSD Reference Manual MAN(1)<br />
NAME<br />
man - display the on-line manual pages<br />
SYNOPSIS<br />
man [-achw] [-C file] [-M path] [-m path] [-S subsection] [-s section]<br />
[section] name [...]<br />
man -f command<br />
man -k keyword<br />
DESCRIPTION<br />
<br />
<br />
The types of manpages have sections which they are grouped in. Here is the manual page layout of [[BSD]]:<br />
<br />
<br />
;Section 1 : General commands (tools and utilities)<br />
; Section 2 : System calls and error numbers<br />
; Section 3 : Library functions, especially for C and Tk<br />
; Section 4 : Special files and hardware support<br />
; Section 5 : File formats, especially configuration files<br />
; Section 6 : Games<br />
; Section 7 : Miscellaneous information pages<br />
; Section 8 : System maintenance and operation commands<br />
; Section 9 : Kernel internals<br />
<br />
<br />
When someone tells you to run "man 6 tetris", that means that you should read the tetris manpage found in section 6 of the manpages. Sometimes the same manpage name exists, but in different sections. One example is the fstat manpage it exists in sections 1 and 2. The lower number sections take precedence over higher numbered sections. Thus, to see the manpage for fstat in section 2 you would type:<br />
$ man 2 fstat<br />
<br />
Similarely functions, [[syscall]]s or commands are sometimes mentioned with the section of manpages in brackets behind them like so: '''fstat(2)''', you'll see this mentioned a lot in this wiki.<br />
<br />
<br />
=== Creating windex ===<br />
<br />
If you're looking for a man page and get the following:<br />
# man -k snoop<br />
/usr/share/man/windex: No such file or directory<br />
<br />
It means you have yet to create your Index:<br />
# [[variables|/usr/bin/catman]] -w <br />
#<br />
<br />
=== Searching for Manual Pages ===<br />
<br />
It is possible to do a keyword search in the manpage system.<br />
<br />
$ man -k filesystem<br />
OpenBSD::Vstat (3p) - virtual filesystem for pkg_add(1) simulations<br />
dump (8) - filesystem backup<br />
fstab (5) - static information about the filesystems<br />
...<br />
<br />
Another command synonymous to man -k is apropos:<br />
<br />
$ apropos archiver<br />
tar (1) - tape archiver<br />
<br />
Do notice that the section of the manpage is displayed in the keyword search, this is to ease viewing the particular manpage. <br />
<br />
<code>$MANPATH</code> is used, unless something else is explicitly specified.<br />
<br />
=== Location of Manual Pages ===<br />
<br />
In [[BSD]] the default manual pages are located in /usr/share/man. This can be changed with the MANPATH [[environment variable]]:<br />
<br />
$ export MANPATH=/usr/local/man<br />
$ man ls<br />
man: no entry for ls in the manual. <br />
$ unset MANPATH<br />
$ man ls<br />
LS(1) OpenBSD Reference Manual LS(1)<br />
...<br />
<br />
Another manpage section can be added on to the current MANPATH:<br />
<br />
$ export MANPATH=/usr/share/man:/usr/local/man<br />
<br />
<br />
== Searching in a man page ==<br />
<br />
Often you will want to search a man page you are viewing for a particular keyword. You can preceed this search word with a "/". If I wanted to see what mediaopt(ions) my sis [[NIC]] has I could do <br />
<br />
/mediaopt<br />
<br />
while reading the sis(4) manpage I have on my system. If the first result is not what I want, I don't have to type the full search word after the first time, I can simply use<br />
<br />
/<br />
<br />
which is to "find another instance".</div>Hawsonhttps://hackepedia.org/?title=Cryptography&diff=3852Cryptography2007-09-21T13:33:26Z<p>Hawson: Reverted edits by IoqNk6 (Talk); changed back to last version by Hawson</p>
<hr />
<div>Cryptography is the method for distorting plain text so that it is unreadable by someone other than the intended recipient. For example, someone that is using a packet [[sniffer]] to listen in on network communication. Only if this third party knows the secret key to the ciphertext will they break the encryption and be able to see the plaintext. We highly recommend anyone using plain text protocols these days to use their free, open source, encrypted equivalents.<br />
<br />
=== Cryptography found in UNIX ===<br />
----<br />
<br />
=== One way hashing ===<br />
UNIX programmers implemented a [[One way hash]] of [[DES]] to "encrypt" [[password]]s as part of the crypt(3) function. It was impossible to decrypt these [[password]]s since they were a modified version of DES, so in order to know if someone had the right [[password]] the plain text would be encrypted and the result compared with the hash of the password database. If they matched, a user would be granted access. As computers became faster so did the speed at which DES would be cracked. An amd64 3500+ running [[OpenBSD]] using the systems crypt(3) functions can hash 121,000 [[password]]s in 1 second in 2005. So a slower hash algorithm was needed and one that could take more than 8 characters for the [[password]]s. Many Operating Systems have implemented [[MD5]] hashing which does 1880 crypts per second on the aforementioned OpenBSD system. OpenBSD went even further and designed an interesting hash of [[blowfish]] that has a variable setting for rounds that blowfish will encrypt the hash with the string "OrpheanBeholderScryDoubt" 64 times per round. The result is that with 12 rounds, a crypt will do 2 passwords in 1 second.<br />
<br />
[[One way hash]]ing wasn't confined to just passwords. With the [[md5]] and [[SHA]], as well as the [[rmd160]] commands one can make a cryptographic hash sum (or fingerprint) of a file or text in the system. For example, if you want to ensure a file or directory has not been altered, you can print the checksum onto read-only media (i.e. paper/burn onto a cd). Whenever you run the checksum program against the same file or directory, you should get the same results unless something has been altered. If this topic interests you, [http://sourceforge.net/projects/tripwire/ tripwire] is popular software you'll want to read more about.<br />
<br />
=== Symmetric cryptography ===<br />
<br />
True private key cryptography was also present with the [[bdes]] and the [[openssl]] commands which could encrypt files with a variety of ciphers. Some well known ciphers are [[DES]], [[AES]], [[blowfish]], [[CAST128]] and [[Arcfour]]. Many ciphers are imported through the openssl library.<br />
<br />
<br />
<br />
=== Public Key cryptography ===<br />
<br />
Also called assymetric cryptography. It uses 2 or more keys, usually one that's private and one that's public which is publically known. Ciphers include Diffie Hellman ([[DH]]), and [[RSA]]. [[GPG]] a program to encrypt mail on the application [[OSI]] layer uses this.<br />
<br />
<br />
<br />
=== Symmetric / Assymmetric Hybrids ===<br />
<br />
This method is used in [[OSI]] session layer communication. A public-key exchange takes place to agree on a [[session key]] which is [[random]] and also a Symmetric encryption and all data following will be encrypted. This is used extensively in [[ssh]] and most [[SSL]] enabled software.<br />
<br />
<br />
<br />
=== Cheap cryptography ===<br />
<br />
Rotational Ciphers based on the alphabet are CHEAP. Often used by Usenet trolls who think that the people they troll don't have a clue what they are talking about.<br />
<br />
$ echo OrpheanBeholderScryDoubt | /usr/games/rot13<br />
BecurnaOrubyqreFpelQbhog<br />
<br />
[[rot13]] is probably good to keep data safe from your 7 year old sister.<br />
<br />
Another type of cryptography is the XOR method. XOR used as a [[One time pad]] is potentially secure. Here is an example of a typical XOR encryption the [[xortext.c]] program is also available:<br />
<br />
$ cat /etc/passwd | ./xortext blah | hexdump -C | head<br />
00000000 10 03 0e 1c 58 46 5b 58 58 5c 5b 2b 0a 0d 13 04 |....XF[XX\[+....|<br />
00000010 0b 09 41 4e 4e 40 4d 52 4d 1e 0e 07 16 56 4e 0a |..ANN@MRM....VN.|<br />
00000020 0b 02 4e 1b 0a 66 05 09 07 01 0e 06 58 46 5b 59 |..N..f......XF[Y|<br />
00000030 58 5d 5b 3c 0a 09 41 0c 07 1a 08 04 42 04 08 05 |X][<..A.....B...|<br />
00000040 11 09 0d 0e 58 43 13 07 0d 18 5b 47 11 0e 08 06 |....XC....[G....|<br />
00000050 4d 02 0e 04 0d 0b 08 06 68 03 11 0d 10 0d 15 07 |M.......h.......|<br />
00000060 10 56 4b 52 50 56 54 52 31 15 12 1c 07 01 41 4e |.VKRPVTR1.....AN|<br />
00000070 58 43 0e 18 07 1e 00 1c 0d 1e 5b 47 11 0e 08 06 |XC........[G....|<br />
00000080 4d 02 0e 04 0d 0b 08 06 68 0e 08 06 58 46 5b 5b |M.......h...XF[[|<br />
00000090 58 5b 5b 2a 0b 02 00 1a 0b 09 12 48 21 03 0c 05 |X[[*.......H!...|<br />
<br />
Surprisingly some companies employ XOR cryptography in their products as a secruity mechanism.</div>Hawsonhttps://hackepedia.org/?title=Dsp&diff=3851Dsp2007-09-21T13:33:15Z<p>Hawson: Reverted edits by SycZek (Talk); changed back to last version by Hawson</p>
<hr />
<div>== device creation ==<br />
<br />
To create your /dev/dsp in linux if it doesn't exist:<br />
<br />
$ grep snd_pcm_oss /proc/modules<br />
$<br />
<br />
not found.. so we'll add it:<br />
<br />
# modprobe snd_pcm_oss <br />
# grep snd_pcm_oss /proc/modules<br />
snd_pcm_oss 54528 0 - Live 0xf04a2000 <br />
snd_mixer_oss 20032 1 snd_pcm_oss, Live 0xf048b000<br />
snd_pcm 95016 3 snd_pcm_oss,snd_intel8x0,snd_ac97_codec, Live 0xf01dd000<br />
snd 58980 8 <br />
snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_intel8x0,snd_ac97_codec,snd_pcm,snd_timer, Live 0xf01b1000<br />
<br />
okay it's there now. The drivers will be different based on your soundcard. Now to make it take affect next reboot, we will add it to /etc/modules<br />
<br />
# echo snd_pcm_oss >> /etc/modules<br />
<br />
$ id<br />
uid=1000(franks) gid=1000(franks) groups=20(dialout),24(cdrom),25(floppy),29(audio),1000(franks)<br />
<br />
As you can see, I am in the group "audio". If you don't see yourself in that group, ask your sysadmin to add you to the audio group in /etc/group:<br />
$ grep audio /etc/group<br />
audio:x:29:franks,asterisk<br />
<br />
shows that franks and asterisk are the two users in the audio group on this system. The users are comma delimited.<br />
<br />
Finally, make sure that your volume and pcm are turned up in your mixer software, such as aumix.<br />
<br />
Now give it a try! <br />
<br />
[http://sourceforge.net/projects/mpg123 mpg123] is a [[CLI]] audio client.<br />
[http://www.gnome.org/projects/rhythmbox/ rhythmbox] is a [[GUI]] audio client.<br />
<br />
== dsp already in use ==<br />
<br />
<br />
Sometimes you will have two applications trying to access your audio device. <br />
The culprit can be discovered with lsof assuming your audio device is /dev/dsp like it is on BSD:<br />
<br />
$ lsof | grep dsp<br />
firefox-b 14905 frank 1w VCHR 30,3 0t0 38 /dev/dsp0.0<br />
firefox-b 14905 frank 1w VCHR 30,3 0t0 38 /dev/dsp0.0<br />
firefox-b 14905 frank 1w VCHR 30,3 0t0 38 /dev/dsp0.0<br />
firefox-b 14905 frank 1w VCHR 30,3 0t0 38 /dev/dsp0.0<br />
<br />
as you can see, one of the websites I am viewing with firefox has claimed access to my dsp first. I must now close that tab in firefox, and restart xmms, and all is well.<br />
<br />
<br />
== Stop embedded audio in Firefox ==<br />
<br />
vi ~/.mozilla/firefox/[[variables|0wt4rci4.default]]/chrome/userContent.css<br />
<br />
and add these lines (creating the file if it doesn't already exist)<br />
<br />
/* block embedded sounds */<br />
embed[src*=.mid] { display: none !important }<br />
embed[src*=.mp2] { display: none !important }<br />
embed[src*=.mp3] { display: none !important }<br />
embed[src*=.mp4] { display: none !important }<br />
embed[src*=.wav] { display: none !important }<br />
embed[src*=.wma] { display: none !important }<br />
<br />
== Stop embedded audio in flash ==<br />
<br />
Not a highly recommended hack, but I opened <br />
<br />
vi ~/.mozilla/plugins/libflashplayer.so<br />
<br />
and did a <br />
<br />
/dsp<br />
<br />
which found /dev/dsp which I replaced with /dev/xxx in order to stop flash from accessing my /dev/dsp, as it never released it properly.<br />
<br />
<br />
Once you have audio working, you may want to try listening to an online streaming radio station such as our recommend [[Unixhelp:Audio|streaming stations]].</div>Hawsonhttps://hackepedia.org/?title=File:Tcsh_profile_scripts.png&diff=3822File:Tcsh profile scripts.png2007-08-03T16:52:06Z<p>Hawson: Depiction of the mess that is tcsh login scripts.</p>
<hr />
<div>Depiction of the mess that is tcsh login scripts.</div>Hawsonhttps://hackepedia.org/?title=Profiles&diff=3821Profiles2007-08-03T16:51:21Z<p>Hawson: Added tcsh link</p>
<hr />
<div>All users on a system have the ability to customize their [[environment]] to their taste. This can involve choosing a [[shell]] such as bash, zsh, or tcsh, setting the environment, shell aliases, or running scripts at startup. These tasks are all handled by various "profile scripts".<br />
<br />
There can be a fair amount of confusion as to what scripts are called, and in what order (tcsh is especially bad in this regard).<br />
<br />
The profile scripts used by Bash (version 3) and tcsh (v6.13) look something like this:<br />
<br />
[[image:bash_profile_scripts.png]] [[image:tcsh_profile_scripts.png]]</div>Hawsonhttps://hackepedia.org/?title=Profiles&diff=3820Profiles2007-08-03T14:57:13Z<p>Hawson: </p>
<hr />
<div>All users on a system have the ability to customize their [[environment]] to their taste. This can involve choosing a [[shell]] such as bash, zsh, or tcsh, setting the environment, shell aliases, or running scripts at startup. These tasks are all handled by various "profile scripts".<br />
<br />
There can be a fair amount of confusion as to what scripts are called, and in what order (tcsh is especially bad in this regard).<br />
<br />
The profile scripts used by Bash (version 3) looks something like this:<br />
<br />
[[image:bash_profile_scripts.png]]</div>Hawsonhttps://hackepedia.org/?title=Credit&diff=3810Credit2007-07-17T22:19:30Z<p>Hawson: </p>
<hr />
<div>In North America, you are entitled to request your credit report once every 12 months via snail mail. We highly recommend you do this once a year. Not only to provide visibility to what creditors see about you, but it will also provide insight if you've been a victim of identity fraud.<br />
<br />
In the US, you are entitled to one report per year, ''per credit company''. If possible, stagger your requests about every four months throughout the year.<br />
<br />
== Canada ==<br />
<br />
[http://www.equifax.com/EFX_Canada/consumer_information_centre/docs/request_report_form_e.pdf Equifax Request Form][[(pdf)]]<br />
<br />
[http://www.transunion.ca/docs/personal/Consumer%20Disclosure%20Request%20Form%20_en.pdf TransUnion Request Form][[(pdf)]]<br />
<br />
== US of A ==<br />
<br />
http://www.freecreditreport.com/ Despite the slightly suspicious name, this is a valid site. They will try to get you to purchase "additional" information and services, but this is '''not''' required to get a credit report.</div>Hawsonhttps://hackepedia.org/?title=Ports&diff=3793Ports2007-07-16T13:55:40Z<p>Hawson: Reverted edits by NhzSg4 (Talk); changed back to last version by Hawson</p>
<hr />
<div>Ports are identifiers of protocols that work on the transport layer (layer 4) of the [[OSI]] model. [[TCP]] and [[UDP]] are transport layer protocols that have ports. In [[TCP]] and [[UDP]] a port is represented by a 16 bit unsigned integer. Thus, the possible port range is 0 through 65535. Port 0 is illegal and no service resides on it.<br />
<br />
Say you want to know what is running on port 80 of your machine. The first hint would be to look in the file /etc/services as well as [http://www.iana.org/assignments/port-numbers IANAs list] to get an idea of what typically runs on that port. <br />
<br />
http 80/tcp www www-http #World Wide Web HTTP<br />
http 80/udp www www-http #World Wide Web HTTP<br />
<br />
looks like it's the port typically used for the www. Now we can try netstat to actually see what is listening,<br />
not just what should be there.<br />
<br />
# netstat -an | grep LISTEN<br />
httpd 30161 root 17u IPv4 5106 TCP *:http (LISTEN)<br />
<br />
however I prefer the flexibility of lsof which I install on all of my machines. <br />
<br />
# lsof -i:80<br />
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME<br />
httpd 447 root 17u IPv4 0xc15f6534 0t0 TCP www.example.com:http (LISTEN)<br />
httpd 73819 www 17u IPv4 0xc15f6534 0t0 TCP www.example.com:http (LISTEN)<br />
<br />
will show you exactly what is listening on this port, in this case "httpd". I will now look up the [[manual]] for httpd which tells me this is Apache on this particular server.<br />
<br />
This will give you a unique alphabetical summary listing of the applications currently listening on a port on your system:<br />
# lsof -i | awk '{print $1}' | sort -u<br />
<br />
If you want to see ports on your machine are open to the general public, which is often how computers are broken into, you can try Yashy's [http://crypto.yashy.com/nmap.php self port scan]. You don't want to see any ports open, or listening, unless you've intentionally started that process for the public to connect to.<br />
<br />
For every open port you find, you must determine if that service actually needs to run. If so, check if it actually needs to be available remotely, instead of only on the local machine. <br />
<br />
For example, if you're running mysql, you may see port 3306 listening. If mysql is on the same machine as your webserver, which is what you're using it for, you should configure mysqld to only listen on 127.0.0.1 (localhost), and not on your external IP address. <br />
You might see you have port 143 (imap) enabled which is only for machines on your 192.168.* network. If this is the case, configure your imapd to only listen on your 192.168.* interface, not the public facing one. The only ports you should see open to the public, are applications you intend for the public to access. <br />
<br />
See the "Ending a process" part of the [[process]] page for help in ending an unwanted process.<br />
<br />
Worse case scenario you have an application listening externally that you don't want the public to access (I can't think of a possible situation for this, but I write this just in case), make sure you have it blocked by your [[firewall]]<br />
<br />
<br />
<br />
== Solaris 10 ==<br />
<br />
# lsof -i<br />
<br />
to see what you have running. All ports are now controlled out of:<br />
<br />
# svcs<br />
<br />
which will give you a long list of services running ("online") or not. You may want to [[pipe]] this output through [[less]].<br />
<br />
When I did "lsof -i" I saw that rpcbind was running which I don't want, so I found the svcs name by running:<br />
<br />
# svcs | grep rpc<br />
online 23:43:56 svc:/network/rpc/bind:default<br />
uninitialized 23:43:44 svc:/network/rpc/gss:default<br />
<br />
and several more uninitialized services. I only want to stop the online one:<br />
<br />
# svcadm disable svc:/network/rpc/bind:default<br />
<br />
and back to a prompt I go. I run "lsof -i" once more to confirm it's stopped, and it is. Both the svcs and svcadm [[Manual]] are worth reading if you're using them for the first time.<br />
<br />
== Linux (Red Hat and spawn) ==<br />
<br />
# chkconfig --list| grep on<br />
<br />
will show a list of all services that are enabled, and at which [[runlevels]]. Workstations by default use of runlevel 5 (multiuser, with networking and X). Servers typically are found in runlevel 3 (multiuser, with networking), but sometimes 5 as well.<br />
<br />
Disabling services is simple. For example, to shut down httpd:<br />
<br />
# service httpd off<br />
# chkconfig --level 345 httpd off<br />
<br />
The first command shuts down the running webserver, while the second alters the boot configuration so it will not start automatically next time the system is rebooted.<br />
<br />
== FreeBSD ==<br />
<br />
To see all listening sockets using TCP/IPv4:<br />
<br />
$ sockstat -4l<br />
<br />
To see all connected sockets using IPv4 or IPv6:<br />
<br />
# sockstat -c</div>Hawsonhttps://hackepedia.org/?title=Cider&diff=3792Cider2007-07-16T13:55:37Z<p>Hawson: Reverted edits by MfcC17 (Talk); changed back to last version by Hawson</p>
<hr />
<div>Any fruit juice will ferment over time if left to the elements. This thought process, as well as an email thread on the [https://secure.neap.net/mailman/listinfo/brewers Members of Barleyment] mailing list, led to my attempt to make my own cider.<br />
<br />
'''Apple Juice''':<br />
You need to use real apple juice. Ideally, the juice should contain nothing other than apples. <br />
<br />
'''Yeast''':<br />
Adding yeast instigates the fermentation process. The yeasts I've used thus far with varied success:<br />
* [http://www.honeycreek.us/yeast.htm#CGoldLabel EC1118] (Intended for Cider and Champagne)<br />
* [http://www.honeycreek.us/yeast.htm#EBlueonWhite K1-V1116] (Wine, Mead)<br />
* Coopers (Beer)<br />
* Nottingham (Beer)<br />
You can buy yeast from any place that makes or sells wine or beer making equipment, or somewhere such as a "U-Brew" where they make wine or beer on premises. It should be under $1 for a packet of yeast that is good for 19L<br />
<br />
<br />
'''Cost''':<br />
<br />
~$5cdn for 3.86L (1 gallon) juice x 4 (You can try it with one bottle, I just use 4 usually so I can try multiple yeasts to taste test the difference)<br />
<br />
~$1cdn for yeast (good for all 4 bottles of juice)<br />
<br />
~$22cdn total for 15.44L (4 gallons) of homemade cider.<br />
<br />
<br />
'''Process:'''<br />
#Open the bottles of Apple Juice<br />
#Open a yeast packet, and pour in 1/4 of the package in each bottle (Assuming a typical package, which is meant for approx 20L of liquid)<br />
#Place the lid back on the juice, but do NOT seal it -- it needs to breathe. Alternatively, you could place tinfoil loosely over the opening. Ideally, you will have a bunghole airlock that fits the opening. While you want it to breathe, you don't want particles getting in and affecting your active yeast.<br />
#Check it daily until you see the "activity" settle. Somewhere between 4 and 12 days is the average for most yeasts. In our experience, it has always been ready in less than 6 days.<br />
#You don't need to bottle or keg it, Enjoy!<br />
<br />
<br />
'''Carbonation:'''<br />
If you want it carbonated, we prefer not to, just seal the lid tight on the 5th night for 24 hours. The next day it's now carbonated as well.<br />
<br />
<br />
'''Results:'''<br />
The EC1118 was very sweet, typical to a hard cider you would purchase. The Coopers was average, with a slightly rounded taste. The K1-V1116 was hollow with a sharp finish. The Nottinngham contained a slight complexity and depth, and was my personal favourite from the batch used in this example. I have since purchased more apple juice and will master this craft :)<br />
<br />
<br />
I have a [[hydrometer]] for making beer, so I [[hydrometer|verify original gravity]] (OG) with the apple juice before adding the yeast, so I can predict the alcohol by volume. <br />
<br />
----<br />
'''External References:'''<br />
<br />
[http://www.bodensatz.com/staticpages/index.php?page=cider Bodensatz cider page]</div>Hawsonhttps://hackepedia.org/?title=Unixhelp:Audio&diff=3791Unixhelp:Audio2007-07-16T13:55:34Z<p>Hawson: Reverted edits by WgyFky (Talk); changed back to last version by Hawson</p>
<hr />
<div>While it's an ecclectic EFnet [[IRC]] channel, some of the favourite sites for streaming music are:<br />
<br />
* [http://di.fm Trance/Techno/Beats] - tchang, cyberfrg <br />
* [http://www.radioparadise.com/ Rock] - Hawson<br />
* [http://www.afterhoursdjs.org/ Progressive/Acid Jazz] - Yashy<br />
* [http://stream1.jungletrain.net:8000 Jungle] - staaka<br />
* [http://www.club977.com 80s] - Yashy<br />
* [http://soma.fm underground/alternative] - RndPkt<br />
* [http://etn.fm trance] - cstone<br />
* [http://www.spiderpower.co.uk synthpop/industrial/80s newwave/uk punk] - cstone<br />
* [http://smoothbeats.com rap/urban/hiphop] - cstone<br />
* [http://www.fromthetop.org From the Top] - Classical music performed by ''very'' talented kids - Hawson<br />
* [http://pooshack.fscker.com:8000 loon's poo shack radio] - sun/wed 8p-12mid CDT/CST - loon<br />
<br />
----<br />
Sometimes, you don't want music, but something else:<br />
<br />
* [http://www.npr.org/programs/waitwait/ Wait, wait, don't tell me!] - Very funny "news quiz" radio show from WBEZ in Chicago. - Hawson<br />
* [http://www.midnightspecial.org/ Midnight Special] - Folk music with a sense of humor - Hawson<br />
* [http://www.ckln.fm CKLN 88.1] Toronto radio station with mandate to represent those with no voice in mainstream media (homosexuals, transgenders, 1 communist, various cultures, conservatives) - pbug<br />
<br />
----<br />
Other musical suggestions:<br />
* [http://flecktones.com/ Bela Fleck and the Flecktones]</div>Hawsonhttps://hackepedia.org/?title=Patching&diff=3790Patching2007-07-16T13:55:29Z<p>Hawson: Reverted edits by QkeZ75 (Talk); changed back to last version by Hawson</p>
<hr />
<div>There are very few Operating Systems that have an adequate patching process for applications. The only two [[UBO]]s we recommend to someone who is too busy to track all of their installed applications is [[FreeBSD]] and [http://www.debian.org Debian GNU/Linux]. Apparently you can do this with [[RedhatDependencies|RedHat]] and its offspring, but I've heard about a lot of issues with "dependancy hell."<br />
<br />
It should be noted that "dependancy hell" is usually because the SysAdmin has installed packages from different distributions. For example, installing SuSE packages on a RedHat system is <i>asking</i> for trouble. Packages built for a specific RedHat version almost always work, as do packages rebuilt from .src.rpm files. (RedHat and other RPM-based systems are quite a bit nicer once you learn to roll your own RPM .spec files)<br />
<br />
<br />
== [[Debian]] ==<br />
<br />
Using [[Debian]] [[GNU]]/[[Linux]] or any of the [[ubuntu]] variants, it's as simple as <br />
apt-get update<br />
apt-get dist-upgrade<br />
and all of your installed applications will now be up to date. You can modify where you get your updates from the /etc/apt/sources.list file.<br />
<br />
== [[FreeBSD]] ==<br />
I've created two shell scripts which I've named update, and upgrade.<br />
You will need [http://www.freshports.org/sysutils/portsnap portsnap], [http://www.freshports.org/security/portaudit portaudit] and [http://www.freshports.org/sysutils/portupgrade portupgrade] installed to use these:<br />
<br />
#!/bin/sh<br />
# update<br />
/usr/local/sbin/portsnap fetch && /usr/local/sbin/portsnap update && pkg_version -v -l < #EOF<br />
<br />
<br />
#!/bin/sh<br />
# upgrade<br />
portaudit -F && portaudit<br />
portupgrade -a<br />
#EOF<br />
<br />
<br />
== [[OpenBSD]] ==<br />
<br />
In OpenBSD patching the operating system can be done in a few<br />
different ways. 1. OpenBSD offers a CVS tree that allows updating at any time to any revision including the latest changes made up to the minute. 2. OpenBSD allows snapshot updates which are install packages and can be installed with the install floppy or CD. 3. The OpenBSD ports can be updated with the pkg_add -u option.<br />
<br />
* With CVS you'd set the CVSROOT and CVS_RSH environment variable, go to the /usr/src tree and type cvs update -PAd (and -r for any revisions other than HEAD), then 'make build' to create userland and then cd /usr/src/arch/{ARCHITECTURE}/config and configure the kernel (GENERIC), then cd ../compile/GENERIC and make dep && make and after that cp /bsd /bsd.old; cp bsd /bsd and reboot. Userland and kernel "must" be built together as changes to structures can 'desync' programs that read out of kernel memory (various stats, vmstat, pstat, iostat, top)<br />
<br />
* With snapshot updates I usually download the entire architectures that I require and burn them to CD with mkisofs and cdrecord, the el-torito bootsector is written with the "CD" image found. When including multiple-boot platforms such as macppc I use mkhybrid instead of mkisofs. Once the CD is completed one can always restore binaries from it at any time. Anyhow one then boots the CD and when the OpenBSD installer boots it offers you 3 choices at the beginning: (I)nstall, (U)pgrade and (S)hell. I chose 'U' for upgrade and the process is straight forward and usually just a bunch of 'yes' answers for questions asked by the installer. After that reboot into the updated/patched operating system (after removing the CD). It's always wise to have made a 'final' backup of the previous system before (just plain common sense).<br />
<br />
* Updating packages with pkg_add(1) seems to work alright for me I set my PKG_PATH environment variable to the place (ftp server) where the packages are held and cd /var/db/pkg and then type pkg_add -u *, this seemed to work almost flawless last time I did this. It's good to also set PKG_CACHE to /usr/ports/packages/{ARCHITECTURE}/all, that way all the packages that are pulled from somewhere remote get copied there as well. Alternativly you can also cvs update the ports tree and build the new port yourself, make it a package and then use pkg_add -u to install the new package.<br />
<br />
== [[Windows]] ==<br />
Use internet explorer to go to [http://update.microsoft.com. Microsoft update]. Let it scan your computer and install all of the high-priority/recommended updates. If you have an issue installing a patch, say for example KB913580, take a look for the log file in C:\Windows for patchname.log. i.e. <br />
<br />
C:\WINDOWS\KB913580.log<br />
<br />
open the file in notepad.exe, at the bottom of the file you will hopefully find a searchable error message or error code.</div>Hawsonhttps://hackepedia.org/?title=Dsp&diff=3789Dsp2007-07-16T13:55:22Z<p>Hawson: Reverted edits by SycZek (Talk); changed back to last version by Hawson</p>
<hr />
<div>== device creation ==<br />
<br />
To create your /dev/dsp in linux if it doesn't exist:<br />
<br />
$ grep snd_pcm_oss /proc/modules<br />
$<br />
<br />
not found.. so we'll add it:<br />
<br />
# modprobe snd_pcm_oss <br />
# grep snd_pcm_oss /proc/modules<br />
snd_pcm_oss 54528 0 - Live 0xf04a2000 <br />
snd_mixer_oss 20032 1 snd_pcm_oss, Live 0xf048b000<br />
snd_pcm 95016 3 snd_pcm_oss,snd_intel8x0,snd_ac97_codec, Live 0xf01dd000<br />
snd 58980 8 <br />
snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_intel8x0,snd_ac97_codec,snd_pcm,snd_timer, Live 0xf01b1000<br />
<br />
okay it's there now. The drivers will be different based on your soundcard. Now to make it take affect next reboot, we will add it to /etc/modules<br />
<br />
# echo snd_pcm_oss >> /etc/modules<br />
<br />
$ id<br />
uid=1000(franks) gid=1000(franks) groups=20(dialout),24(cdrom),25(floppy),29(audio),1000(franks)<br />
<br />
As you can see, I am in the group "audio". If you don't see yourself in that group, ask your sysadmin to add you to the audio group in /etc/group:<br />
$ grep audio /etc/group<br />
audio:x:29:franks,asterisk<br />
<br />
shows that franks and asterisk are the two users in the audio group on this system. The users are comma delimited.<br />
<br />
Finally, make sure that your volume and pcm are turned up in your mixer software, such as aumix.<br />
<br />
Now give it a try! <br />
<br />
[http://sourceforge.net/projects/mpg123 mpg123] is a [[CLI]] audio client.<br />
[http://www.gnome.org/projects/rhythmbox/ rhythmbox] is a [[GUI]] audio client.<br />
<br />
== dsp already in use ==<br />
<br />
<br />
Sometimes you will have two applications trying to access your audio device. <br />
The culprit can be discovered with lsof assuming your audio device is /dev/dsp like it is on BSD:<br />
<br />
$ lsof | grep dsp<br />
firefox-b 14905 frank 1w VCHR 30,3 0t0 38 /dev/dsp0.0<br />
firefox-b 14905 frank 1w VCHR 30,3 0t0 38 /dev/dsp0.0<br />
firefox-b 14905 frank 1w VCHR 30,3 0t0 38 /dev/dsp0.0<br />
firefox-b 14905 frank 1w VCHR 30,3 0t0 38 /dev/dsp0.0<br />
<br />
as you can see, one of the websites I am viewing with firefox has claimed access to my dsp first. I must now close that tab in firefox, and restart xmms, and all is well.<br />
<br />
<br />
== Stop embedded audio in Firefox ==<br />
<br />
vi ~/.mozilla/firefox/[[variables|0wt4rci4.default]]/chrome/userContent.css<br />
<br />
and add these lines (creating the file if it doesn't already exist)<br />
<br />
/* block embedded sounds */<br />
embed[src*=.mid] { display: none !important }<br />
embed[src*=.mp2] { display: none !important }<br />
embed[src*=.mp3] { display: none !important }<br />
embed[src*=.mp4] { display: none !important }<br />
embed[src*=.wav] { display: none !important }<br />
embed[src*=.wma] { display: none !important }<br />
<br />
== Stop embedded audio in flash ==<br />
<br />
Not a highly recommended hack, but I opened <br />
<br />
vi ~/.mozilla/plugins/libflashplayer.so<br />
<br />
and did a <br />
<br />
/dsp<br />
<br />
which found /dev/dsp which I replaced with /dev/xxx in order to stop flash from accessing my /dev/dsp, as it never released it properly.<br />
<br />
<br />
Once you have audio working, you may want to try listening to an online streaming radio station such as our recommend [[Unixhelp:Audio|streaming stations]].</div>Hawsonhttps://hackepedia.org/?title=Windows&diff=3788Windows2007-07-16T13:55:20Z<p>Hawson: Reverted edits by IdeXs0 (Talk); changed back to last version by Hawson</p>
<hr />
<div>While we understand most people use Microsoft Windows[tm] simply because of their marketing and popularity, we highly recommend and prefer [[UBO]]s, of which there are dozens of completely [[free]] operating systems which are usually more stable and secure. We will only recommend [[free]] software for Windows on this page. If you're using Microsoft Windows, here are a few recommended steps to take immediately upon reading this, if you have not already done so. <br />
<br />
# Install a [[Windows#Firewalls|Firewall]]. This will close all your [[ports]] from being accessible from the public internet.<br />
# Install [[antivirus]] software. <br />
# Install both [[Windows#Anti-spyware|anti-spyware]] as well as [[Windows#Cleaners|a cleaner]] and run these regularly. <br />
# Install another browser for surfing the internet such as [http://www.mozilla.org/products/firefox/ Mozilla Firefox] or [http://www.opera.com Opera] as Internet Explorer has a long history of security incidents.<br />
<br />
<br />
== Firewalls ==<br />
<br />
This is our technical explanation of [[Firewall|how a firewall works]].<br />
<br />
<br />
[http://www.comodogroup.com/products/free_products.html Comodo] Easier to install than ZoneAlarm.<br />
<br />
[http://www.zonealarm.com ZoneAlarm] Installation is lengthy for the new computer user. <br />
<br />
<br />
There is also the default [http://www.microsoft.com/windowsxp/using/security/internet/sp2_wfintro.mspx Windows firewall]. This is only applicable if you aren't using one of the firewalls listed above:<br />
<br />
# Click Start and then click Control Panel.<br />
# In the control panel, click Security Center.<br />
# Click Windows Firewall.<br />
# Turn it on if it is off.<br />
<br />
== Anti-spyware ==<br />
<br />
If you have the disk space, it won't hurt to have both of these as they may find some that the other won't.<br />
<br />
[http://www.safer-networking.org/ Spybot - Search and Destroy] <br />
<br />
[http://www.lavasoftusa.com/software/adaware/ AdAware SE Personal]<br />
<br />
== Cleaners ==<br />
<br />
You use a cleaner to clean temporary files, caches, unused registry entries, your recycle bin, clipboard etc. This is handy for freeing up wasted hard disk drive ([[HDD]]) space. Only one of the following is necessary, your choice. We recommend you run it at a scheduled interval, such as monthly. <br />
<br />
[http://www.filehippo.com/download_ccleaner/ CCleaner]<br />
Free, donate if you like it. <br />
You will probably want to uncheck "Add Yahoo! toolbar within IE" during the install options.<br />
Other than that, no other configuration necessary, run it. <br />
<br />
[http://zappit.net/ Zappit]<br />
Freeware.<br />
This has a "Safe mode" (easy), as well as an advanced option to remove any of the defaults or create your own. <br />
<br />
[http://www.buttuglysoftware.com/ CleanCache]<br />
Free, donate if you like it.<br />
This tool requires knowledge of what you want to clean exactly via user input. Also, it does not given an indicator of how much [[HDD]] space you have cleaned up unlike the others.<br />
<br />
== Quarterly Maintenance ==<br />
<br />
# [[Patching|Patch]] your computer.<br />
# Run a [[Windows#Cleaner|cleaner]] <br />
# In Control Panel, go to "Add/Remove New Software" and go through the list, removing any applications that you don't know what they do, or if you haven't used them in the past 3 months.<br />
# Run your [[Windows#Anti-Spyware|anti-spyware]] software<br />
<br />
== PowerToys ==<br />
<br />
PowerToys gives you access to system settings that are not exposed in the Windows XP default user interface, including mouse settings, Explorer settings, taskbar settings, and more. If you're not sure which to try, start with '''TweakUI'''.<br />
<br />
<br />
[http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx WindowsXP Powertoys]<br />
<br />
== Office tools ==<br />
<br />
Some free alternatives to Microsoft Office:<br />
<br />
[http://www.openoffice.org/ OpenOffice]<br />
<br />
[http://www.sun.com/software/star/staroffice/index.jsp StarOffice]</div>Hawsonhttps://hackepedia.org/?title=Satellites&diff=3787Satellites2007-07-16T13:53:54Z<p>Hawson: </p>
<hr />
<div>[http://www.heavens-above.com/ Heavens Above] lists the orbits for most satellites. Look up the orbits visible from your area. <br />
<br />
[http://www.wired.com/wired/archive/14.02/spy.html Wired article on Amateur satellite tracking]<br />
<br />
If you're going to try out satellite tracking, I would recommend you start with a LEO (low earth orbiting) or the ISS (International Space station) which are easier, and work your way out further upon success.<br />
<br />
== Nations with satellite launching capability ==<br />
<br />
*Canada<br />
*USA<br />
*France<br />
*Britain<br />
*Soviet Union<br />
*Israel<br />
*South Africa<br />
*Australia<br />
*China<br />
*India<br />
*Pakistan<br />
*North Korea<br />
*Japan<br />
*Switzerland<br />
*Egypt<br />
*Brazil<br />
*Cuba<br />
*Iran<br />
*Myanmar (Burma)<br />
*Ethiopia<br />
<br />
<br />
== Watching ==<br />
<br />
Some satellites ("birds" in slang) are visible with the human eye, and some may require binoculars. Make sure you have a good idea of its orbit, and time in your sky, so you can train your eye to follow the general path for when it actually does become visible.<br />
<br />
== Listening ==<br />
<br />
Find the downlink frequency for the amateur radio satellite you're tracking, and adjust it accordingly on your frequency scanner/radio. A directional antenna is preferred, however the standard "rubber ducky" (resistor) antenna may work.<br />
<br />
[http://www.amsat.org/amsat-new/satellites/status.php Amsat satellite status] which should list downlink frequency<br />
<br />
== Transmitting ==<br />
<br />
If you have a radio with a directional [[Yagi-Uda]] high-gain antenna, and an [[amateur radio]] license for the uplink frequency, you can try to point your antenna in that direction. You have to be quick to transmit off a satellite, as usually the passes go by quite quickly.<br />
<br />
[http://www.amsat.org/amsat-new/satellites/status.php Amsat satellite status] which should list uplink frequency<br />
<br />
== Software ==<br />
<br />
[http://www.satobs.org/orbsoft.html List of satellite prediction software]<br />
<br />
<br />
[http://www.amsat.org/amsat/keps/menu.html Amsat Keplerian elements for amateur radio satellites]. Keps are used in satellite prediction software to predict satellites current passes. You will most likely want to download this data on a regular basis to ensure you're as accurate as possible almost most satellites do have static orbits.</div>Hawsonhttps://hackepedia.org/?title=Cryptography&diff=3786Cryptography2007-07-16T13:53:47Z<p>Hawson: Reverted edits by IoqNk6 (Talk); changed back to last version by Hawson</p>
<hr />
<div>Cryptography is the method for distorting plain text so that it is unreadable by someone other than the intended recipient. For example, someone that is using a packet [[sniffer]] to listen in on network communication. Only if this third party knows the secret key to the ciphertext will they break the encryption and be able to see the plaintext. We highly recommend anyone using plain text protocols these days to use their free, open source, encrypted equivalents.<br />
<br />
=== Cryptography found in UNIX ===<br />
----<br />
<br />
=== One way hashing ===<br />
UNIX programmers implemented a [[One way hash]] of [[DES]] to "encrypt" [[password]]s as part of the crypt(3) function. It was impossible to decrypt these [[password]]s since they were a modified version of DES, so in order to know if someone had the right [[password]] the plain text would be encrypted and the result compared with the hash of the password database. If they matched, a user would be granted access. As computers became faster so did the speed at which DES would be cracked. An amd64 3500+ running [[OpenBSD]] using the systems crypt(3) functions can hash 121,000 [[password]]s in 1 second in 2005. So a slower hash algorithm was needed and one that could take more than 8 characters for the [[password]]s. Many Operating Systems have implemented [[MD5]] hashing which does 1880 crypts per second on the aforementioned OpenBSD system. OpenBSD went even further and designed an interesting hash of [[blowfish]] that has a variable setting for rounds that blowfish will encrypt the hash with the string "OrpheanBeholderScryDoubt" 64 times per round. The result is that with 12 rounds, a crypt will do 2 passwords in 1 second.<br />
<br />
[[One way hash]]ing wasn't confined to just passwords. With the [[md5]] and [[SHA]], as well as the [[rmd160]] commands one can make a cryptographic hash sum (or fingerprint) of a file or text in the system. For example, if you want to ensure a file or directory has not been altered, you can print the checksum onto read-only media (i.e. paper/burn onto a cd). Whenever you run the checksum program against the same file or directory, you should get the same results unless something has been altered. If this topic interests you, [http://sourceforge.net/projects/tripwire/ tripwire] is popular software you'll want to read more about.<br />
<br />
=== Symmetric cryptography ===<br />
<br />
True private key cryptography was also present with the [[bdes]] and the [[openssl]] commands which could encrypt files with a variety of ciphers. Some well known ciphers are [[DES]], [[AES]], [[blowfish]], [[CAST128]] and [[Arcfour]]. Many ciphers are imported through the openssl library.<br />
<br />
<br />
<br />
=== Public Key cryptography ===<br />
<br />
Also called assymetric cryptography. It uses 2 or more keys, usually one that's private and one that's public which is publically known. Ciphers include Diffie Hellman ([[DH]]), and [[RSA]]. [[GPG]] a program to encrypt mail on the application [[OSI]] layer uses this.<br />
<br />
<br />
<br />
=== Symmetric / Assymmetric Hybrids ===<br />
<br />
This method is used in [[OSI]] session layer communication. A public-key exchange takes place to agree on a [[session key]] which is [[random]] and also a Symmetric encryption and all data following will be encrypted. This is used extensively in [[ssh]] and most [[SSL]] enabled software.<br />
<br />
<br />
<br />
=== Cheap cryptography ===<br />
<br />
Rotational Ciphers based on the alphabet are CHEAP. Often used by Usenet trolls who think that the people they troll don't have a clue what they are talking about.<br />
<br />
$ echo OrpheanBeholderScryDoubt | /usr/games/rot13<br />
BecurnaOrubyqreFpelQbhog<br />
<br />
[[rot13]] is probably good to keep data safe from your 7 year old sister.<br />
<br />
Another type of cryptography is the XOR method. XOR used as a [[One time pad]] is potentially secure. Here is an example of a typical XOR encryption the [[xortext.c]] program is also available:<br />
<br />
$ cat /etc/passwd | ./xortext blah | hexdump -C | head<br />
00000000 10 03 0e 1c 58 46 5b 58 58 5c 5b 2b 0a 0d 13 04 |....XF[XX\[+....|<br />
00000010 0b 09 41 4e 4e 40 4d 52 4d 1e 0e 07 16 56 4e 0a |..ANN@MRM....VN.|<br />
00000020 0b 02 4e 1b 0a 66 05 09 07 01 0e 06 58 46 5b 59 |..N..f......XF[Y|<br />
00000030 58 5d 5b 3c 0a 09 41 0c 07 1a 08 04 42 04 08 05 |X][<..A.....B...|<br />
00000040 11 09 0d 0e 58 43 13 07 0d 18 5b 47 11 0e 08 06 |....XC....[G....|<br />
00000050 4d 02 0e 04 0d 0b 08 06 68 03 11 0d 10 0d 15 07 |M.......h.......|<br />
00000060 10 56 4b 52 50 56 54 52 31 15 12 1c 07 01 41 4e |.VKRPVTR1.....AN|<br />
00000070 58 43 0e 18 07 1e 00 1c 0d 1e 5b 47 11 0e 08 06 |XC........[G....|<br />
00000080 4d 02 0e 04 0d 0b 08 06 68 0e 08 06 58 46 5b 5b |M.......h...XF[[|<br />
00000090 58 5b 5b 2a 0b 02 00 1a 0b 09 12 48 21 03 0c 05 |X[[*.......H!...|<br />
<br />
Surprisingly some companies employ XOR cryptography in their products as a secruity mechanism.</div>Hawsonhttps://hackepedia.org/?title=Ports&diff=3771Ports2007-07-13T18:49:32Z<p>Hawson: Reverted edits by NhzSg4 (Talk); changed back to last version by Hawson</p>
<hr />
<div>Ports are identifiers of protocols that work on the transport layer (layer 4) of the [[OSI]] model. [[TCP]] and [[UDP]] are transport layer protocols that have ports. In [[TCP]] and [[UDP]] a port is represented by a 16 bit unsigned integer. Thus, the possible port range is 0 through 65535. Port 0 is illegal and no service resides on it.<br />
<br />
Say you want to know what is running on port 80 of your machine. The first hint would be to look in the file /etc/services as well as [http://www.iana.org/assignments/port-numbers IANAs list] to get an idea of what typically runs on that port. <br />
<br />
http 80/tcp www www-http #World Wide Web HTTP<br />
http 80/udp www www-http #World Wide Web HTTP<br />
<br />
looks like it's the port typically used for the www. Now we can try netstat to actually see what is listening,<br />
not just what should be there.<br />
<br />
# netstat -an | grep LISTEN<br />
httpd 30161 root 17u IPv4 5106 TCP *:http (LISTEN)<br />
<br />
however I prefer the flexibility of lsof which I install on all of my machines. <br />
<br />
# lsof -i:80<br />
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME<br />
httpd 447 root 17u IPv4 0xc15f6534 0t0 TCP www.example.com:http (LISTEN)<br />
httpd 73819 www 17u IPv4 0xc15f6534 0t0 TCP www.example.com:http (LISTEN)<br />
<br />
will show you exactly what is listening on this port, in this case "httpd". I will now look up the [[manual]] for httpd which tells me this is Apache on this particular server.<br />
<br />
This will give you a unique alphabetical summary listing of the applications currently listening on a port on your system:<br />
# lsof -i | awk '{print $1}' | sort -u<br />
<br />
If you want to see ports on your machine are open to the general public, which is often how computers are broken into, you can try Yashy's [http://crypto.yashy.com/nmap.php self port scan]. You don't want to see any ports open, or listening, unless you've intentionally started that process for the public to connect to.<br />
<br />
For every open port you find, you must determine if that service actually needs to run. If so, check if it actually needs to be available remotely, instead of only on the local machine. <br />
<br />
For example, if you're running mysql, you may see port 3306 listening. If mysql is on the same machine as your webserver, which is what you're using it for, you should configure mysqld to only listen on 127.0.0.1 (localhost), and not on your external IP address. <br />
You might see you have port 143 (imap) enabled which is only for machines on your 192.168.* network. If this is the case, configure your imapd to only listen on your 192.168.* interface, not the public facing one. The only ports you should see open to the public, are applications you intend for the public to access. <br />
<br />
See the "Ending a process" part of the [[process]] page for help in ending an unwanted process.<br />
<br />
Worse case scenario you have an application listening externally that you don't want the public to access (I can't think of a possible situation for this, but I write this just in case), make sure you have it blocked by your [[firewall]]<br />
<br />
<br />
<br />
== Solaris 10 ==<br />
<br />
# lsof -i<br />
<br />
to see what you have running. All ports are now controlled out of:<br />
<br />
# svcs<br />
<br />
which will give you a long list of services running ("online") or not. You may want to [[pipe]] this output through [[less]].<br />
<br />
When I did "lsof -i" I saw that rpcbind was running which I don't want, so I found the svcs name by running:<br />
<br />
# svcs | grep rpc<br />
online 23:43:56 svc:/network/rpc/bind:default<br />
uninitialized 23:43:44 svc:/network/rpc/gss:default<br />
<br />
and several more uninitialized services. I only want to stop the online one:<br />
<br />
# svcadm disable svc:/network/rpc/bind:default<br />
<br />
and back to a prompt I go. I run "lsof -i" once more to confirm it's stopped, and it is. Both the svcs and svcadm [[Manual]] are worth reading if you're using them for the first time.<br />
<br />
== Linux (Red Hat and spawn) ==<br />
<br />
# chkconfig --list| grep on<br />
<br />
will show a list of all services that are enabled, and at which [[runlevels]]. Workstations by default use of runlevel 5 (multiuser, with networking and X). Servers typically are found in runlevel 3 (multiuser, with networking), but sometimes 5 as well.<br />
<br />
Disabling services is simple. For example, to shut down httpd:<br />
<br />
# service httpd off<br />
# chkconfig --level 345 httpd off<br />
<br />
The first command shuts down the running webserver, while the second alters the boot configuration so it will not start automatically next time the system is rebooted.<br />
<br />
== FreeBSD ==<br />
<br />
To see all listening sockets using TCP/IPv4:<br />
<br />
$ sockstat -4l<br />
<br />
To see all connected sockets using IPv4 or IPv6:<br />
<br />
# sockstat -c</div>Hawsonhttps://hackepedia.org/?title=Patching&diff=3770Patching2007-07-13T18:49:14Z<p>Hawson: Reverted edits by QkeZ75 (Talk); changed back to last version by Hawson</p>
<hr />
<div>There are very few Operating Systems that have an adequate patching process for applications. The only two [[UBO]]s we recommend to someone who is too busy to track all of their installed applications is [[FreeBSD]] and [http://www.debian.org Debian GNU/Linux]. Apparently you can do this with [[RedhatDependencies|RedHat]] and its offspring, but I've heard about a lot of issues with "dependancy hell."<br />
<br />
It should be noted that "dependancy hell" is usually because the SysAdmin has installed packages from different distributions. For example, installing SuSE packages on a RedHat system is <i>asking</i> for trouble. Packages built for a specific RedHat version almost always work, as do packages rebuilt from .src.rpm files. (RedHat and other RPM-based systems are quite a bit nicer once you learn to roll your own RPM .spec files)<br />
<br />
<br />
== [[Debian]] ==<br />
<br />
Using [[Debian]] [[GNU]]/[[Linux]] or any of the [[ubuntu]] variants, it's as simple as <br />
apt-get update<br />
apt-get dist-upgrade<br />
and all of your installed applications will now be up to date. You can modify where you get your updates from the /etc/apt/sources.list file.<br />
<br />
== [[FreeBSD]] ==<br />
I've created two shell scripts which I've named update, and upgrade.<br />
You will need [http://www.freshports.org/sysutils/portsnap portsnap], [http://www.freshports.org/security/portaudit portaudit] and [http://www.freshports.org/sysutils/portupgrade portupgrade] installed to use these:<br />
<br />
#!/bin/sh<br />
# update<br />
/usr/local/sbin/portsnap fetch && /usr/local/sbin/portsnap update && pkg_version -v -l < #EOF<br />
<br />
<br />
#!/bin/sh<br />
# upgrade<br />
portaudit -F && portaudit<br />
portupgrade -a<br />
#EOF<br />
<br />
<br />
== [[OpenBSD]] ==<br />
<br />
In OpenBSD patching the operating system can be done in a few<br />
different ways. 1. OpenBSD offers a CVS tree that allows updating at any time to any revision including the latest changes made up to the minute. 2. OpenBSD allows snapshot updates which are install packages and can be installed with the install floppy or CD. 3. The OpenBSD ports can be updated with the pkg_add -u option.<br />
<br />
* With CVS you'd set the CVSROOT and CVS_RSH environment variable, go to the /usr/src tree and type cvs update -PAd (and -r for any revisions other than HEAD), then 'make build' to create userland and then cd /usr/src/arch/{ARCHITECTURE}/config and configure the kernel (GENERIC), then cd ../compile/GENERIC and make dep && make and after that cp /bsd /bsd.old; cp bsd /bsd and reboot. Userland and kernel "must" be built together as changes to structures can 'desync' programs that read out of kernel memory (various stats, vmstat, pstat, iostat, top)<br />
<br />
* With snapshot updates I usually download the entire architectures that I require and burn them to CD with mkisofs and cdrecord, the el-torito bootsector is written with the "CD" image found. When including multiple-boot platforms such as macppc I use mkhybrid instead of mkisofs. Once the CD is completed one can always restore binaries from it at any time. Anyhow one then boots the CD and when the OpenBSD installer boots it offers you 3 choices at the beginning: (I)nstall, (U)pgrade and (S)hell. I chose 'U' for upgrade and the process is straight forward and usually just a bunch of 'yes' answers for questions asked by the installer. After that reboot into the updated/patched operating system (after removing the CD). It's always wise to have made a 'final' backup of the previous system before (just plain common sense).<br />
<br />
* Updating packages with pkg_add(1) seems to work alright for me I set my PKG_PATH environment variable to the place (ftp server) where the packages are held and cd /var/db/pkg and then type pkg_add -u *, this seemed to work almost flawless last time I did this. It's good to also set PKG_CACHE to /usr/ports/packages/{ARCHITECTURE}/all, that way all the packages that are pulled from somewhere remote get copied there as well. Alternativly you can also cvs update the ports tree and build the new port yourself, make it a package and then use pkg_add -u to install the new package.<br />
<br />
== [[Windows]] ==<br />
Use internet explorer to go to [http://update.microsoft.com. Microsoft update]. Let it scan your computer and install all of the high-priority/recommended updates. If you have an issue installing a patch, say for example KB913580, take a look for the log file in C:\Windows for patchname.log. i.e. <br />
<br />
C:\WINDOWS\KB913580.log<br />
<br />
open the file in notepad.exe, at the bottom of the file you will hopefully find a searchable error message or error code.</div>Hawsonhttps://hackepedia.org/?title=Email&diff=3769Email2007-07-13T18:49:07Z<p>Hawson: Reverted edits by AtoSo4 (Talk); changed back to last version by Hawson</p>
<hr />
<div>If you've been sent an email forward, especially the kind with some type of warning, it's worth it to try and find the email at [http://www.snopes.com snopes.com]. For example, I just got an email forward warning about glade plugins burning down a house. When I searched snopes for "glade", I found this link:<br />
<br />
http://www.snopes.com/toxins/glade.asp<br />
This email has been going around the internet for over a year and never been verified as a hoax or not. Things like this will happen all the time, usually from compeition (febreeze for example makes a spray can), or just someone playing a prank and seeing how many people it will get forwarded to. <br />
It's worth just browsing through the website too, lots of funny stories that are fake, and real:<br />
http://www.snopes.com/snopes.asp<br />
<br />
[[Procmail]] is the most powerful, as well as complex, email processor there is today. You should also be aware of how to treat email [[Abuse]].<br />
<br />
== Behind the scenes ==<br />
<br />
The original [[RFC]] that covers email is [[http://www.faqs.org/rfcs/rfc821.html RFC821]].<br />
<br />
Email is sent over [[ports|port]] 25. To test this out, find the name of your local SMTP server. We'll assume in this example that your mail server is mail.example.com and your email address is me@example.com, trying to send an email to your friend root@127.0.0.1:<br />
<br />
<pre><br />
$ telnet mail.example.com 25<br />
Trying 10.0.0.1...<br />
Connected to mail.example.com.<br />
Escape character is '^]'.<br />
220 mail.example.com NO UCE ESMTP<br />
EHLO example.com<br />
250-mail.example.com<br />
250-PIPELINING<br />
250-SIZE 1024000<br />
250-ETRN<br />
250-STARTTLS<br />
250 8BITMIME<br />
MAIL FROM: <me@example.com><br />
250 Ok<br />
RCPT TO: <root@127.0.0.1><br />
250 Ok<br />
DATA<br />
354 End data with <CR><LF>.<CR><LF><br />
<br />
This is a test message<br />
<br />
.<br />
250 Ok: queued as 25CED619F<br />
</pre><br />
<br />
If you tried this, you should get an email shortly. Now you know what happens with your email client (Mail User Agent) behind the scenes when you send an email. Now try to be sneaky and change the MAIL FROM: header to a fake email address and see what happens.<br />
<br />
== General Etiquette ==<br />
<br />
* If your communication is solely text based, make sure you're using proper spelling and grammer as perception is everything. <br />
* Reread your email and see if there is anything you can take out, keep it short and to the point. <br />
* Draft your messages in plain text. Avoid rtf (rich text format) and [[HTML]] in emails.<br />
You will be respected a lot more by your reader(s) if you follow these guidelines.<br />
<br />
== Replying ==<br />
<br />
* cut out any text from the previous email that is not relevant to your reply <br />
* do not top post (reply underneath the text you're directly replying to)<br />
* any lines starting with a ">" are from the previous person, so make sure anything new you type is not prefixed with > or the next reader will ignore it thinking it was from the previous email<br />
<br />
== Signatures ==<br />
<br />
Email signatures are usually prefixed with a --[[\n]] and shouldn't be any more then 4 lines long. For example:<br />
<br />
--<br />
Al Queda<br />
Minister of Conspiracy<br />
Bastard, Ontario, Canada<br />
1(613)555-1212<br />
<br />
<br />
== Blocking Spam ==<br />
<br />
If you administer an [[MTA]], our recommended solution is [[spamd]]</div>Hawsonhttps://hackepedia.org/?title=Process&diff=3768Process2007-07-13T18:49:04Z<p>Hawson: Reverted edits by ReeO7r (Talk); changed back to last version by Franks</p>
<hr />
<div>A process is a program running in a UNIX system. It communicates with the rest of the system or network by means of [[syscall]]s, [[descriptors]] or [[shared memory]]. A process is in [[protected memory]] also called [[virtual memory]] because address locations are translated by the [[kernel]] from the real physical addresses. A process cannot read the memory of another process owned by another user unless both processes share that memory which needs to be set up by both. Interfaces for reading the memory of another process of the same [[uid]] are [[ptrace]] and the /proc [[filesystem]]. <br />
<br />
A process is created by the [[fork]] [[syscall]] by a parent process. The new process is also called the child. After fork the child retains all memory and [[descriptors]] of its parent.<br />
<br />
A typical process is composed of [[text]], initialized data, uninitialized data ([[bss]]), [[heap]] and [[stack]]. Because of [[paging]] a process' text does not need to be loaded completely into memory but is loaded in chunks called pages when it tries to access an area that hasn't been paged in yet (this causes a [[page fault]] to indicate to the kernel that more data is needed). This is called demand paging. When memory pages aren't being used they can be paged out to [[swap]] to make room for more memory that other processes may require. When a threshold is reached and processes aren't active for longer periods of time they can be entirely swapped out to disk. This is rather slow and often avoided when possible. Processes can be signal'ed to stop execution, continue execution and to exit including leaving a [[core]] file for later analysis. <br />
<br />
Each process has a unique [[pid]] to identify it and a [[ppid]] to identify its parent. Other properties about a process are explained in struct proc in /usr/include/sys/proc.h.<br />
<br />
<br />
To show all processes in [[BSD]] type:<br />
<br />
$ ps -auwx<br />
<br />
To show all processes in [[SYSV]] type:<br />
<br />
$ ps -ef<br />
<br />
When a process dies it will not be cleaned up completely by the kernel but be set into a [[zombie]] state, the [[ppid|parent pid]] will be signaled with a SIGCHLD [[signal]] and it is expected to [[wait]](2) on the zombie child. As soon as this is complete the kernel will clean the process table completely from the [[zombie]] process. [[Orphan]]ed processes that become [[zombie]]s are waited on by [[init]].<br />
<br />
<br />
<br />
=== Ending a Process ===<br />
<br />
A user can end a process by killing it. By default the TERM (15) signal is sent. It is wise to send a TERM signal to a process so that it can trap this signal and do possible safe shutdown's of open files or databases. When it is absolutely necessary to immediately kill a process the KILL (9) signal is used, the process terminates immediately without being able to safely shut anything off. Sometimes a process is "in-disk" (state D in a ps listing) meaning it is awaiting i/o from the kernel. In this state a process cannot be killed at all and it may be wedged forever until the next boot of the system.<br />
<br />
The latest way to do this is with the pkill command:<br />
<br />
$ pkill [[Variables|process]]<br />
<br />
You will have to have proper [[permission]] to kill this process. You can optionally include a [[signal]] with pkill.<br />
<br />
The traditional command to do this is kill(1), which takes the [[pid]] as an argument and optionally the [[signal]] which is supposed to be sent to the process. <br />
<br />
$ kill 324<br />
$ kill -TERM 324<br />
$ kill -KILL 324<br />
<br />
Here is a list of [[signal]]s.<br />
<br />
=== Tracing a Process in BSD ===<br />
<br />
[[BSD]] has the [[ktrace]] command. With it a processes [[syscall]]s can be traced. By default ktrace writes the file "ktrace.out". To switch off tracing a simple "ktrace -C" is used. To view the contents of the tracefile you would use [[kdump]]. When you need to trace the child of a process the "-i" flag to ktrace is probably best.<br />
<br />
12926 ls CALL stat(0x469b6170,0x7f7fffff7490)<br />
12926 ls NAMI "."<br />
12926 ls RET stat 0<br />
12926 ls CALL open(0x528916,0,0)<br />
12926 ls NAMI "."<br />
12926 ls RET open 3<br />
12926 ls CALL fchdir(0x3)<br />
12926 ls RET fchdir 0<br />
12926 ls CALL open(0x528916,0,0)<br />
12926 ls NAMI "."<br />
12926 ls RET open 4<br />
12926 ls CALL open(0x423e5000,0x4,0)<br />
12926 ls NAMI "."<br />
12926 ls RET open 6<br />
12926 ls CALL fstat(0x6,0x7f7fffff7440)<br />
12926 ls RET fstat 0<br />
<br />
Above is a snippet of a traced [[ls]].<br />
<br />
It is possible to see what processes are traced with the [[fstat]] command where a "tr" flag is displayed with the inode of the trace file.<br />
<br />
$ fstat | grep mplayer<br />
...<br />
pbug mplayer 11555 wd /usr 8016513 drwx------ r 8192<br />
pbug mplayer 11555 tr /usr 8016941 -rw------- rw 1273886<br />
...<br />
<br />
<br />
=== Debugging a process that's running ===<br />
<br />
[[gdb]] allows one to attach to a process. The process should be compiled with debugging symbols (-g flag). The debugger attaches to the process like so:<br />
<br />
$ gdb program 1234<br />
<br />
Where program is the program that's running (ie. /bin/ls) and 1234 is the [[pid]] of the process. As soon as you attach the processes execution stops and isn't resumed until you quit, step through or continue (after perhaps setting a few breakpoints).</div>Hawsonhttps://hackepedia.org/?title=Cider&diff=3767Cider2007-07-13T18:48:46Z<p>Hawson: Reverted edits by MfcC17 (Talk); changed back to last version by Hawson</p>
<hr />
<div>Any fruit juice will ferment over time if left to the elements. This thought process, as well as an email thread on the [https://secure.neap.net/mailman/listinfo/brewers Members of Barleyment] mailing list, led to my attempt to make my own cider.<br />
<br />
'''Apple Juice''':<br />
You need to use real apple juice. Ideally, the juice should contain nothing other than apples. <br />
<br />
'''Yeast''':<br />
Adding yeast instigates the fermentation process. The yeasts I've used thus far with varied success:<br />
* [http://www.honeycreek.us/yeast.htm#CGoldLabel EC1118] (Intended for Cider and Champagne)<br />
* [http://www.honeycreek.us/yeast.htm#EBlueonWhite K1-V1116] (Wine, Mead)<br />
* Coopers (Beer)<br />
* Nottingham (Beer)<br />
You can buy yeast from any place that makes or sells wine or beer making equipment, or somewhere such as a "U-Brew" where they make wine or beer on premises. It should be under $1 for a packet of yeast that is good for 19L<br />
<br />
<br />
'''Cost''':<br />
<br />
~$5cdn for 3.86L (1 gallon) juice x 4 (You can try it with one bottle, I just use 4 usually so I can try multiple yeasts to taste test the difference)<br />
<br />
~$1cdn for yeast (good for all 4 bottles of juice)<br />
<br />
~$22cdn total for 15.44L (4 gallons) of homemade cider.<br />
<br />
<br />
'''Process:'''<br />
#Open the bottles of Apple Juice<br />
#Open a yeast packet, and pour in 1/4 of the package in each bottle (Assuming a typical package, which is meant for approx 20L of liquid)<br />
#Place the lid back on the juice, but do NOT seal it -- it needs to breathe. Alternatively, you could place tinfoil loosely over the opening. Ideally, you will have a bunghole airlock that fits the opening. While you want it to breathe, you don't want particles getting in and affecting your active yeast.<br />
#Check it daily until you see the "activity" settle. Somewhere between 4 and 12 days is the average for most yeasts. In our experience, it has always been ready in less than 6 days.<br />
#You don't need to bottle or keg it, Enjoy!<br />
<br />
<br />
'''Carbonation:'''<br />
If you want it carbonated, we prefer not to, just seal the lid tight on the 5th night for 24 hours. The next day it's now carbonated as well.<br />
<br />
<br />
'''Results:'''<br />
The EC1118 was very sweet, typical to a hard cider you would purchase. The Coopers was average, with a slightly rounded taste. The K1-V1116 was hollow with a sharp finish. The Nottinngham contained a slight complexity and depth, and was my personal favourite from the batch used in this example. I have since purchased more apple juice and will master this craft :)<br />
<br />
<br />
I have a [[hydrometer]] for making beer, so I [[hydrometer|verify original gravity]] (OG) with the apple juice before adding the yeast, so I can predict the alcohol by volume. <br />
<br />
----<br />
'''External References:'''<br />
<br />
[http://www.bodensatz.com/staticpages/index.php?page=cider Bodensatz cider page]</div>Hawsonhttps://hackepedia.org/?title=Unixhelp:Audio&diff=3766Unixhelp:Audio2007-07-13T18:48:30Z<p>Hawson: Reverted edits by WgyFky (Talk); changed back to last version by Hawson</p>
<hr />
<div>While it's an ecclectic EFnet [[IRC]] channel, some of the favourite sites for streaming music are:<br />
<br />
* [http://di.fm Trance/Techno/Beats] - tchang, cyberfrg <br />
* [http://www.radioparadise.com/ Rock] - Hawson<br />
* [http://www.afterhoursdjs.org/ Progressive/Acid Jazz] - Yashy<br />
* [http://stream1.jungletrain.net:8000 Jungle] - staaka<br />
* [http://www.club977.com 80s] - Yashy<br />
* [http://soma.fm underground/alternative] - RndPkt<br />
* [http://etn.fm trance] - cstone<br />
* [http://www.spiderpower.co.uk synthpop/industrial/80s newwave/uk punk] - cstone<br />
* [http://smoothbeats.com rap/urban/hiphop] - cstone<br />
* [http://www.fromthetop.org From the Top] - Classical music performed by ''very'' talented kids - Hawson<br />
* [http://pooshack.fscker.com:8000 loon's poo shack radio] - sun/wed 8p-12mid CDT/CST - loon<br />
<br />
----<br />
Sometimes, you don't want music, but something else:<br />
<br />
* [http://www.npr.org/programs/waitwait/ Wait, wait, don't tell me!] - Very funny "news quiz" radio show from WBEZ in Chicago. - Hawson<br />
* [http://www.midnightspecial.org/ Midnight Special] - Folk music with a sense of humor - Hawson<br />
* [http://www.ckln.fm CKLN 88.1] Toronto radio station with mandate to represent those with no voice in mainstream media (homosexuals, transgenders, 1 communist, various cultures, conservatives) - pbug<br />
<br />
----<br />
Other musical suggestions:<br />
* [http://flecktones.com/ Bela Fleck and the Flecktones]</div>Hawsonhttps://hackepedia.org/?title=Hackepedia:About&diff=3742Hackepedia:About2007-07-05T16:26:51Z<p>Hawson: Protected "Hackepedia:About": spam target [edit=sysop:move=sysop]</p>
<hr />
<div>You can email hackepedia @ this domain if you have a pressing issue. <br />
<br />
Anyone can contribute to content of this website. Sign up for a free account and you can start contributing today.</div>Hawsonhttps://hackepedia.org/?title=Windows&diff=3741Windows2007-07-05T16:26:31Z<p>Hawson: Reverted edits by IdeXs0 (Talk); changed back to last version by Hawson</p>
<hr />
<div>While we understand most people use Microsoft Windows[tm] simply because of their marketing and popularity, we highly recommend and prefer [[UBO]]s, of which there are dozens of completely [[free]] operating systems which are usually more stable and secure. We will only recommend [[free]] software for Windows on this page. If you're using Microsoft Windows, here are a few recommended steps to take immediately upon reading this, if you have not already done so. <br />
<br />
# Install a [[Windows#Firewalls|Firewall]]. This will close all your [[ports]] from being accessible from the public internet.<br />
# Install [[antivirus]] software. <br />
# Install both [[Windows#Anti-spyware|anti-spyware]] as well as [[Windows#Cleaners|a cleaner]] and run these regularly. <br />
# Install another browser for surfing the internet such as [http://www.mozilla.org/products/firefox/ Mozilla Firefox] or [http://www.opera.com Opera] as Internet Explorer has a long history of security incidents.<br />
<br />
<br />
== Firewalls ==<br />
<br />
This is our technical explanation of [[Firewall|how a firewall works]].<br />
<br />
<br />
[http://www.comodogroup.com/products/free_products.html Comodo] Easier to install than ZoneAlarm.<br />
<br />
[http://www.zonealarm.com ZoneAlarm] Installation is lengthy for the new computer user. <br />
<br />
<br />
There is also the default [http://www.microsoft.com/windowsxp/using/security/internet/sp2_wfintro.mspx Windows firewall]. This is only applicable if you aren't using one of the firewalls listed above:<br />
<br />
# Click Start and then click Control Panel.<br />
# In the control panel, click Security Center.<br />
# Click Windows Firewall.<br />
# Turn it on if it is off.<br />
<br />
== Anti-spyware ==<br />
<br />
If you have the disk space, it won't hurt to have both of these as they may find some that the other won't.<br />
<br />
[http://www.safer-networking.org/ Spybot - Search and Destroy] <br />
<br />
[http://www.lavasoftusa.com/software/adaware/ AdAware SE Personal]<br />
<br />
== Cleaners ==<br />
<br />
You use a cleaner to clean temporary files, caches, unused registry entries, your recycle bin, clipboard etc. This is handy for freeing up wasted hard disk drive ([[HDD]]) space. Only one of the following is necessary, your choice. We recommend you run it at a scheduled interval, such as monthly. <br />
<br />
[http://www.filehippo.com/download_ccleaner/ CCleaner]<br />
Free, donate if you like it. <br />
You will probably want to uncheck "Add Yahoo! toolbar within IE" during the install options.<br />
Other than that, no other configuration necessary, run it. <br />
<br />
[http://zappit.net/ Zappit]<br />
Freeware.<br />
This has a "Safe mode" (easy), as well as an advanced option to remove any of the defaults or create your own. <br />
<br />
[http://www.buttuglysoftware.com/ CleanCache]<br />
Free, donate if you like it.<br />
This tool requires knowledge of what you want to clean exactly via user input. Also, it does not given an indicator of how much [[HDD]] space you have cleaned up unlike the others.<br />
<br />
== Quarterly Maintenance ==<br />
<br />
# [[Patching|Patch]] your computer.<br />
# Run a [[Windows#Cleaner|cleaner]] <br />
# In Control Panel, go to "Add/Remove New Software" and go through the list, removing any applications that you don't know what they do, or if you haven't used them in the past 3 months.<br />
# Run your [[Windows#Anti-Spyware|anti-spyware]] software<br />
<br />
== PowerToys ==<br />
<br />
PowerToys gives you access to system settings that are not exposed in the Windows XP default user interface, including mouse settings, Explorer settings, taskbar settings, and more. If you're not sure which to try, start with '''TweakUI'''.<br />
<br />
<br />
[http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx WindowsXP Powertoys]<br />
<br />
== Office tools ==<br />
<br />
Some free alternatives to Microsoft Office:<br />
<br />
[http://www.openoffice.org/ OpenOffice]<br />
<br />
[http://www.sun.com/software/star/staroffice/index.jsp StarOffice]</div>Hawsonhttps://hackepedia.org/?title=Hackepedia:About&diff=3740Hackepedia:About2007-07-05T16:26:10Z<p>Hawson: Reverted edits by AfpPpi (Talk); changed back to last version by Hawson</p>
<hr />
<div>You can email hackepedia @ this domain if you have a pressing issue. <br />
<br />
Anyone can contribute to content of this website. Sign up for a free account and you can start contributing today.</div>Hawsonhttps://hackepedia.org/?title=Cryptography&diff=3739Cryptography2007-07-05T16:26:00Z<p>Hawson: Reverted edits by IoqNk6 (Talk); changed back to last version by Franks</p>
<hr />
<div>Cryptography is the method for distorting plain text so that it is unreadable by someone other than the intended recipient. For example, someone that is using a packet [[sniffer]] to listen in on network communication. Only if this third party knows the secret key to the ciphertext will they break the encryption and be able to see the plaintext. We highly recommend anyone using plain text protocols these days to use their free, open source, encrypted equivalents.<br />
<br />
=== Cryptography found in UNIX ===<br />
----<br />
<br />
=== One way hashing ===<br />
UNIX programmers implemented a [[One way hash]] of [[DES]] to "encrypt" [[password]]s as part of the crypt(3) function. It was impossible to decrypt these [[password]]s since they were a modified version of DES, so in order to know if someone had the right [[password]] the plain text would be encrypted and the result compared with the hash of the password database. If they matched, a user would be granted access. As computers became faster so did the speed at which DES would be cracked. An amd64 3500+ running [[OpenBSD]] using the systems crypt(3) functions can hash 121,000 [[password]]s in 1 second in 2005. So a slower hash algorithm was needed and one that could take more than 8 characters for the [[password]]s. Many Operating Systems have implemented [[MD5]] hashing which does 1880 crypts per second on the aforementioned OpenBSD system. OpenBSD went even further and designed an interesting hash of [[blowfish]] that has a variable setting for rounds that blowfish will encrypt the hash with the string "OrpheanBeholderScryDoubt" 64 times per round. The result is that with 12 rounds, a crypt will do 2 passwords in 1 second.<br />
<br />
[[One way hash]]ing wasn't confined to just passwords. With the [[md5]] and [[SHA]], as well as the [[rmd160]] commands one can make a cryptographic hash sum (or fingerprint) of a file or text in the system. For example, if you want to ensure a file or directory has not been altered, you can print the checksum onto read-only media (i.e. paper/burn onto a cd). Whenever you run the checksum program against the same file or directory, you should get the same results unless something has been altered. If this topic interests you, [http://sourceforge.net/projects/tripwire/ tripwire] is popular software you'll want to read more about.<br />
<br />
=== Symmetric cryptography ===<br />
<br />
True private key cryptography was also present with the [[bdes]] and the [[openssl]] commands which could encrypt files with a variety of ciphers. Some well known ciphers are [[DES]], [[AES]], [[blowfish]], [[CAST128]] and [[Arcfour]]. Many ciphers are imported through the openssl library.<br />
<br />
<br />
<br />
=== Public Key cryptography ===<br />
<br />
Also called assymetric cryptography. It uses 2 or more keys, usually one that's private and one that's public which is publically known. Ciphers include Diffie Hellman ([[DH]]), and [[RSA]]. [[GPG]] a program to encrypt mail on the application [[OSI]] layer uses this.<br />
<br />
<br />
<br />
=== Symmetric / Assymmetric Hybrids ===<br />
<br />
This method is used in [[OSI]] session layer communication. A public-key exchange takes place to agree on a [[session key]] which is [[random]] and also a Symmetric encryption and all data following will be encrypted. This is used extensively in [[ssh]] and most [[SSL]] enabled software.<br />
<br />
<br />
<br />
=== Cheap cryptography ===<br />
<br />
Rotational Ciphers based on the alphabet are CHEAP. Often used by Usenet trolls who think that the people they troll don't have a clue what they are talking about.<br />
<br />
$ echo OrpheanBeholderScryDoubt | /usr/games/rot13<br />
BecurnaOrubyqreFpelQbhog<br />
<br />
[[rot13]] is probably good to keep data safe from your 7 year old sister.<br />
<br />
Another type of cryptography is the XOR method. XOR used as a [[One time pad]] is potentially secure. Here is an example of a typical XOR encryption the [[xortext.c]] program is also available:<br />
<br />
$ cat /etc/passwd | ./xortext blah | hexdump -C | head<br />
00000000 10 03 0e 1c 58 46 5b 58 58 5c 5b 2b 0a 0d 13 04 |....XF[XX\[+....|<br />
00000010 0b 09 41 4e 4e 40 4d 52 4d 1e 0e 07 16 56 4e 0a |..ANN@MRM....VN.|<br />
00000020 0b 02 4e 1b 0a 66 05 09 07 01 0e 06 58 46 5b 59 |..N..f......XF[Y|<br />
00000030 58 5d 5b 3c 0a 09 41 0c 07 1a 08 04 42 04 08 05 |X][<..A.....B...|<br />
00000040 11 09 0d 0e 58 43 13 07 0d 18 5b 47 11 0e 08 06 |....XC....[G....|<br />
00000050 4d 02 0e 04 0d 0b 08 06 68 03 11 0d 10 0d 15 07 |M.......h.......|<br />
00000060 10 56 4b 52 50 56 54 52 31 15 12 1c 07 01 41 4e |.VKRPVTR1.....AN|<br />
00000070 58 43 0e 18 07 1e 00 1c 0d 1e 5b 47 11 0e 08 06 |XC........[G....|<br />
00000080 4d 02 0e 04 0d 0b 08 06 68 0e 08 06 58 46 5b 5b |M.......h...XF[[|<br />
00000090 58 5b 5b 2a 0b 02 00 1a 0b 09 12 48 21 03 0c 05 |X[[*.......H!...|<br />
<br />
Surprisingly some companies employ XOR cryptography in their products as a secruity mechanism.</div>Hawsonhttps://hackepedia.org/?title=Cider&diff=3738Cider2007-07-05T16:25:18Z<p>Hawson: Reverted edits by MfcC17 (Talk); changed back to last version by Franks</p>
<hr />
<div>Any fruit juice will ferment over time if left to the elements. This thought process, as well as an email thread on the [https://secure.neap.net/mailman/listinfo/brewers Members of Barleyment] mailing list, led to my attempt to make my own cider.<br />
<br />
'''Apple Juice''':<br />
You need to use real apple juice. Ideally, the juice should contain nothing other than apples. <br />
<br />
'''Yeast''':<br />
Adding yeast instigates the fermentation process. The yeasts I've used thus far with varied success:<br />
* [http://www.honeycreek.us/yeast.htm#CGoldLabel EC1118] (Intended for Cider and Champagne)<br />
* [http://www.honeycreek.us/yeast.htm#EBlueonWhite K1-V1116] (Wine, Mead)<br />
* Coopers (Beer)<br />
* Nottingham (Beer)<br />
You can buy yeast from any place that makes or sells wine or beer making equipment, or somewhere such as a "U-Brew" where they make wine or beer on premises. It should be under $1 for a packet of yeast that is good for 19L<br />
<br />
<br />
'''Cost''':<br />
<br />
~$5cdn for 3.86L (1 gallon) juice x 4 (You can try it with one bottle, I just use 4 usually so I can try multiple yeasts to taste test the difference)<br />
<br />
~$1cdn for yeast (good for all 4 bottles of juice)<br />
<br />
~$22cdn total for 15.44L (4 gallons) of homemade cider.<br />
<br />
<br />
'''Process:'''<br />
#Open the bottles of Apple Juice<br />
#Open a yeast packet, and pour in 1/4 of the package in each bottle (Assuming a typical package, which is meant for approx 20L of liquid)<br />
#Place the lid back on the juice, but do NOT seal it -- it needs to breathe. Alternatively, you could place tinfoil loosely over the opening. Ideally, you will have a bunghole airlock that fits the opening. While you want it to breathe, you don't want particles getting in and affecting your active yeast.<br />
#Check it daily until you see the "activity" settle. Somewhere between 4 and 12 days is the average for most yeasts. In our experience, it has always been ready in less than 6 days.<br />
#You don't need to bottle or keg it, Enjoy!<br />
<br />
<br />
'''Carbonation:'''<br />
If you want it carbonated, we prefer not to, just seal the lid tight on the 5th night for 24 hours. The next day it's now carbonated as well.<br />
<br />
<br />
'''Results:'''<br />
The EC1118 was very sweet, typical to a hard cider you would purchase. The Coopers was average, with a slightly rounded taste. The K1-V1116 was hollow with a sharp finish. The Nottinngham contained a slight complexity and depth, and was my personal favourite from the batch used in this example. I have since purchased more apple juice and will master this craft :)<br />
<br />
<br />
I have a [[hydrometer]] for making beer, so I [[hydrometer|verify original gravity]] (OG) with the apple juice before adding the yeast, so I can predict the alcohol by volume. <br />
<br />
----<br />
'''External References:'''<br />
<br />
[http://www.bodensatz.com/staticpages/index.php?page=cider Bodensatz cider page]</div>Hawsonhttps://hackepedia.org/?title=Hackepedia:About&diff=3728Hackepedia:About2007-07-02T20:29:49Z<p>Hawson: Replacing page with 'You can email hackepedia @ this domain if you have a pressing issue.
Anyone can contribute to content of this website. Sign up for a free account and you can start contributi...'</p>
<hr />
<div>You can email hackepedia @ this domain if you have a pressing issue. <br />
<br />
Anyone can contribute to content of this website. Sign up for a free account and you can start contributing today.</div>Hawsonhttps://hackepedia.org/?title=Unixhelp:Audio&diff=3727Unixhelp:Audio2007-07-02T20:29:40Z<p>Hawson: </p>
<hr />
<div>While it's an ecclectic EFnet [[IRC]] channel, some of the favourite sites for streaming music are:<br />
<br />
* [http://di.fm Trance/Techno/Beats] - tchang, cyberfrg <br />
* [http://www.radioparadise.com/ Rock] - Hawson<br />
* [http://www.afterhoursdjs.org/ Progressive/Acid Jazz] - Yashy<br />
* [http://stream1.jungletrain.net:8000 Jungle] - staaka<br />
* [http://www.club977.com 80s] - Yashy<br />
* [http://soma.fm underground/alternative] - RndPkt<br />
* [http://etn.fm trance] - cstone<br />
* [http://www.spiderpower.co.uk synthpop/industrial/80s newwave/uk punk] - cstone<br />
* [http://smoothbeats.com rap/urban/hiphop] - cstone<br />
* [http://www.fromthetop.org From the Top] - Classical music performed by ''very'' talented kids - Hawson<br />
* [http://pooshack.fscker.com:8000 loon's poo shack radio] - sun/wed 8p-12mid CDT/CST - loon<br />
<br />
----<br />
Sometimes, you don't want music, but something else:<br />
<br />
* [http://www.npr.org/programs/waitwait/ Wait, wait, don't tell me!] - Very funny "news quiz" radio show from WBEZ in Chicago. - Hawson<br />
* [http://www.midnightspecial.org/ Midnight Special] - Folk music with a sense of humor - Hawson<br />
* [http://www.ckln.fm CKLN 88.1] Toronto radio station with mandate to represent those with no voice in mainstream media (homosexuals, transgenders, 1 communist, various cultures, conservatives) - pbug<br />
<br />
----<br />
Other musical suggestions:<br />
* [http://flecktones.com/ Bela Fleck and the Flecktones]</div>Hawsonhttps://hackepedia.org/?title=Dsp&diff=3726Dsp2007-07-02T20:29:15Z<p>Hawson: </p>
<hr />
<div>== device creation ==<br />
<br />
To create your /dev/dsp in linux if it doesn't exist:<br />
<br />
$ grep snd_pcm_oss /proc/modules<br />
$<br />
<br />
not found.. so we'll add it:<br />
<br />
# modprobe snd_pcm_oss <br />
# grep snd_pcm_oss /proc/modules<br />
snd_pcm_oss 54528 0 - Live 0xf04a2000 <br />
snd_mixer_oss 20032 1 snd_pcm_oss, Live 0xf048b000<br />
snd_pcm 95016 3 snd_pcm_oss,snd_intel8x0,snd_ac97_codec, Live 0xf01dd000<br />
snd 58980 8 <br />
snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_intel8x0,snd_ac97_codec,snd_pcm,snd_timer, Live 0xf01b1000<br />
<br />
okay it's there now. The drivers will be different based on your soundcard. Now to make it take affect next reboot, we will add it to /etc/modules<br />
<br />
# echo snd_pcm_oss >> /etc/modules<br />
<br />
$ id<br />
uid=1000(franks) gid=1000(franks) groups=20(dialout),24(cdrom),25(floppy),29(audio),1000(franks)<br />
<br />
As you can see, I am in the group "audio". If you don't see yourself in that group, ask your sysadmin to add you to the audio group in /etc/group:<br />
$ grep audio /etc/group<br />
audio:x:29:franks,asterisk<br />
<br />
shows that franks and asterisk are the two users in the audio group on this system. The users are comma delimited.<br />
<br />
Finally, make sure that your volume and pcm are turned up in your mixer software, such as aumix.<br />
<br />
Now give it a try! <br />
<br />
[http://sourceforge.net/projects/mpg123 mpg123] is a [[CLI]] audio client.<br />
[http://www.gnome.org/projects/rhythmbox/ rhythmbox] is a [[GUI]] audio client.<br />
<br />
== dsp already in use ==<br />
<br />
<br />
Sometimes you will have two applications trying to access your audio device. <br />
The culprit can be discovered with lsof assuming your audio device is /dev/dsp like it is on BSD:<br />
<br />
$ lsof | grep dsp<br />
firefox-b 14905 frank 1w VCHR 30,3 0t0 38 /dev/dsp0.0<br />
firefox-b 14905 frank 1w VCHR 30,3 0t0 38 /dev/dsp0.0<br />
firefox-b 14905 frank 1w VCHR 30,3 0t0 38 /dev/dsp0.0<br />
firefox-b 14905 frank 1w VCHR 30,3 0t0 38 /dev/dsp0.0<br />
<br />
as you can see, one of the websites I am viewing with firefox has claimed access to my dsp first. I must now close that tab in firefox, and restart xmms, and all is well.<br />
<br />
<br />
== Stop embedded audio in Firefox ==<br />
<br />
vi ~/.mozilla/firefox/[[variables|0wt4rci4.default]]/chrome/userContent.css<br />
<br />
and add these lines (creating the file if it doesn't already exist)<br />
<br />
/* block embedded sounds */<br />
embed[src*=.mid] { display: none !important }<br />
embed[src*=.mp2] { display: none !important }<br />
embed[src*=.mp3] { display: none !important }<br />
embed[src*=.mp4] { display: none !important }<br />
embed[src*=.wav] { display: none !important }<br />
embed[src*=.wma] { display: none !important }<br />
<br />
== Stop embedded audio in flash ==<br />
<br />
Not a highly recommended hack, but I opened <br />
<br />
vi ~/.mozilla/plugins/libflashplayer.so<br />
<br />
and did a <br />
<br />
/dsp<br />
<br />
which found /dev/dsp which I replaced with /dev/xxx in order to stop flash from accessing my /dev/dsp, as it never released it properly.<br />
<br />
<br />
Once you have audio working, you may want to try listening to an online streaming radio station such as our recommend [[Unixhelp:Audio|streaming stations]].</div>Hawsonhttps://hackepedia.org/?title=Ports&diff=3725Ports2007-07-02T20:29:07Z<p>Hawson: </p>
<hr />
<div>Ports are identifiers of protocols that work on the transport layer (layer 4) of the [[OSI]] model. [[TCP]] and [[UDP]] are transport layer protocols that have ports. In [[TCP]] and [[UDP]] a port is represented by a 16 bit unsigned integer. Thus, the possible port range is 0 through 65535. Port 0 is illegal and no service resides on it.<br />
<br />
Say you want to know what is running on port 80 of your machine. The first hint would be to look in the file /etc/services as well as [http://www.iana.org/assignments/port-numbers IANAs list] to get an idea of what typically runs on that port. <br />
<br />
http 80/tcp www www-http #World Wide Web HTTP<br />
http 80/udp www www-http #World Wide Web HTTP<br />
<br />
looks like it's the port typically used for the www. Now we can try netstat to actually see what is listening,<br />
not just what should be there.<br />
<br />
# netstat -an | grep LISTEN<br />
httpd 30161 root 17u IPv4 5106 TCP *:http (LISTEN)<br />
<br />
however I prefer the flexibility of lsof which I install on all of my machines. <br />
<br />
# lsof -i:80<br />
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME<br />
httpd 447 root 17u IPv4 0xc15f6534 0t0 TCP www.example.com:http (LISTEN)<br />
httpd 73819 www 17u IPv4 0xc15f6534 0t0 TCP www.example.com:http (LISTEN)<br />
<br />
will show you exactly what is listening on this port, in this case "httpd". I will now look up the [[manual]] for httpd which tells me this is Apache on this particular server.<br />
<br />
This will give you a unique alphabetical summary listing of the applications currently listening on a port on your system:<br />
# lsof -i | awk '{print $1}' | sort -u<br />
<br />
If you want to see ports on your machine are open to the general public, which is often how computers are broken into, you can try Yashy's [http://crypto.yashy.com/nmap.php self port scan]. You don't want to see any ports open, or listening, unless you've intentionally started that process for the public to connect to.<br />
<br />
For every open port you find, you must determine if that service actually needs to run. If so, check if it actually needs to be available remotely, instead of only on the local machine. <br />
<br />
For example, if you're running mysql, you may see port 3306 listening. If mysql is on the same machine as your webserver, which is what you're using it for, you should configure mysqld to only listen on 127.0.0.1 (localhost), and not on your external IP address. <br />
You might see you have port 143 (imap) enabled which is only for machines on your 192.168.* network. If this is the case, configure your imapd to only listen on your 192.168.* interface, not the public facing one. The only ports you should see open to the public, are applications you intend for the public to access. <br />
<br />
See the "Ending a process" part of the [[process]] page for help in ending an unwanted process.<br />
<br />
Worse case scenario you have an application listening externally that you don't want the public to access (I can't think of a possible situation for this, but I write this just in case), make sure you have it blocked by your [[firewall]]<br />
<br />
<br />
<br />
== Solaris 10 ==<br />
<br />
# lsof -i<br />
<br />
to see what you have running. All ports are now controlled out of:<br />
<br />
# svcs<br />
<br />
which will give you a long list of services running ("online") or not. You may want to [[pipe]] this output through [[less]].<br />
<br />
When I did "lsof -i" I saw that rpcbind was running which I don't want, so I found the svcs name by running:<br />
<br />
# svcs | grep rpc<br />
online 23:43:56 svc:/network/rpc/bind:default<br />
uninitialized 23:43:44 svc:/network/rpc/gss:default<br />
<br />
and several more uninitialized services. I only want to stop the online one:<br />
<br />
# svcadm disable svc:/network/rpc/bind:default<br />
<br />
and back to a prompt I go. I run "lsof -i" once more to confirm it's stopped, and it is. Both the svcs and svcadm [[Manual]] are worth reading if you're using them for the first time.<br />
<br />
== Linux (Red Hat and spawn) ==<br />
<br />
# chkconfig --list| grep on<br />
<br />
will show a list of all services that are enabled, and at which [[runlevels]]. Workstations by default use of runlevel 5 (multiuser, with networking and X). Servers typically are found in runlevel 3 (multiuser, with networking), but sometimes 5 as well.<br />
<br />
Disabling services is simple. For example, to shut down httpd:<br />
<br />
# service httpd off<br />
# chkconfig --level 345 httpd off<br />
<br />
The first command shuts down the running webserver, while the second alters the boot configuration so it will not start automatically next time the system is rebooted.<br />
<br />
== FreeBSD ==<br />
<br />
To see all listening sockets using TCP/IPv4:<br />
<br />
$ sockstat -4l<br />
<br />
To see all connected sockets using IPv4 or IPv6:<br />
<br />
# sockstat -c</div>Hawsonhttps://hackepedia.org/?title=Email&diff=3724Email2007-07-02T20:27:08Z<p>Hawson: </p>
<hr />
<div>If you've been sent an email forward, especially the kind with some type of warning, it's worth it to try and find the email at [http://www.snopes.com snopes.com]. For example, I just got an email forward warning about glade plugins burning down a house. When I searched snopes for "glade", I found this link:<br />
<br />
http://www.snopes.com/toxins/glade.asp<br />
This email has been going around the internet for over a year and never been verified as a hoax or not. Things like this will happen all the time, usually from compeition (febreeze for example makes a spray can), or just someone playing a prank and seeing how many people it will get forwarded to. <br />
It's worth just browsing through the website too, lots of funny stories that are fake, and real:<br />
http://www.snopes.com/snopes.asp<br />
<br />
[[Procmail]] is the most powerful, as well as complex, email processor there is today. You should also be aware of how to treat email [[Abuse]].<br />
<br />
== Behind the scenes ==<br />
<br />
The original [[RFC]] that covers email is [[http://www.faqs.org/rfcs/rfc821.html RFC821]].<br />
<br />
Email is sent over [[ports|port]] 25. To test this out, find the name of your local SMTP server. We'll assume in this example that your mail server is mail.example.com and your email address is me@example.com, trying to send an email to your friend root@127.0.0.1:<br />
<br />
<pre><br />
$ telnet mail.example.com 25<br />
Trying 10.0.0.1...<br />
Connected to mail.example.com.<br />
Escape character is '^]'.<br />
220 mail.example.com NO UCE ESMTP<br />
EHLO example.com<br />
250-mail.example.com<br />
250-PIPELINING<br />
250-SIZE 1024000<br />
250-ETRN<br />
250-STARTTLS<br />
250 8BITMIME<br />
MAIL FROM: <me@example.com><br />
250 Ok<br />
RCPT TO: <root@127.0.0.1><br />
250 Ok<br />
DATA<br />
354 End data with <CR><LF>.<CR><LF><br />
<br />
This is a test message<br />
<br />
.<br />
250 Ok: queued as 25CED619F<br />
</pre><br />
<br />
If you tried this, you should get an email shortly. Now you know what happens with your email client (Mail User Agent) behind the scenes when you send an email. Now try to be sneaky and change the MAIL FROM: header to a fake email address and see what happens.<br />
<br />
== General Etiquette ==<br />
<br />
* If your communication is solely text based, make sure you're using proper spelling and grammer as perception is everything. <br />
* Reread your email and see if there is anything you can take out, keep it short and to the point. <br />
* Draft your messages in plain text. Avoid rtf (rich text format) and [[HTML]] in emails.<br />
You will be respected a lot more by your reader(s) if you follow these guidelines.<br />
<br />
== Replying ==<br />
<br />
* cut out any text from the previous email that is not relevant to your reply <br />
* do not top post (reply underneath the text you're directly replying to)<br />
* any lines starting with a ">" are from the previous person, so make sure anything new you type is not prefixed with > or the next reader will ignore it thinking it was from the previous email<br />
<br />
== Signatures ==<br />
<br />
Email signatures are usually prefixed with a --[[\n]] and shouldn't be any more then 4 lines long. For example:<br />
<br />
--<br />
Al Queda<br />
Minister of Conspiracy<br />
Bastard, Ontario, Canada<br />
1(613)555-1212<br />
<br />
<br />
== Blocking Spam ==<br />
<br />
If you administer an [[MTA]], our recommended solution is [[spamd]]</div>Hawsonhttps://hackepedia.org/?title=Windows&diff=3713Windows2007-06-29T18:32:25Z<p>Hawson: Reverted edits by IdeXs0 (Talk); changed back to last version by Franks</p>
<hr />
<div>While we understand most people use Microsoft Windows[tm] simply because of their marketing and popularity, we highly recommend and prefer [[UBO]]s, of which there are dozens of completely [[free]] operating systems which are usually more stable and secure. We will only recommend [[free]] software for Windows on this page. If you're using Microsoft Windows, here are a few recommended steps to take immediately upon reading this, if you have not already done so. <br />
<br />
# Install a [[Windows#Firewalls|Firewall]]. This will close all your [[ports]] from being accessible from the public internet.<br />
# Install [[antivirus]] software. <br />
# Install both [[Windows#Anti-spyware|anti-spyware]] as well as [[Windows#Cleaners|a cleaner]] and run these regularly. <br />
# Install another browser for surfing the internet such as [http://www.mozilla.org/products/firefox/ Mozilla Firefox] or [http://www.opera.com Opera] as Internet Explorer has a long history of security incidents.<br />
<br />
<br />
== Firewalls ==<br />
<br />
This is our technical explanation of [[Firewall|how a firewall works]].<br />
<br />
<br />
[http://www.comodogroup.com/products/free_products.html Comodo] Easier to install than ZoneAlarm.<br />
<br />
[http://www.zonealarm.com ZoneAlarm] Installation is lengthy for the new computer user. <br />
<br />
<br />
There is also the default [http://www.microsoft.com/windowsxp/using/security/internet/sp2_wfintro.mspx Windows firewall]. This is only applicable if you aren't using one of the firewalls listed above:<br />
<br />
# Click Start and then click Control Panel.<br />
# In the control panel, click Security Center.<br />
# Click Windows Firewall.<br />
# Turn it on if it is off.<br />
<br />
== Anti-spyware ==<br />
<br />
If you have the disk space, it won't hurt to have both of these as they may find some that the other won't.<br />
<br />
[http://www.safer-networking.org/ Spybot - Search and Destroy] <br />
<br />
[http://www.lavasoftusa.com/software/adaware/ AdAware SE Personal]<br />
<br />
== Cleaners ==<br />
<br />
You use a cleaner to clean temporary files, caches, unused registry entries, your recycle bin, clipboard etc. This is handy for freeing up wasted hard disk drive ([[HDD]]) space. Only one of the following is necessary, your choice. We recommend you run it at a scheduled interval, such as monthly. <br />
<br />
[http://www.filehippo.com/download_ccleaner/ CCleaner]<br />
Free, donate if you like it. <br />
You will probably want to uncheck "Add Yahoo! toolbar within IE" during the install options.<br />
Other than that, no other configuration necessary, run it. <br />
<br />
[http://zappit.net/ Zappit]<br />
Freeware.<br />
This has a "Safe mode" (easy), as well as an advanced option to remove any of the defaults or create your own. <br />
<br />
[http://www.buttuglysoftware.com/ CleanCache]<br />
Free, donate if you like it.<br />
This tool requires knowledge of what you want to clean exactly via user input. Also, it does not given an indicator of how much [[HDD]] space you have cleaned up unlike the others.<br />
<br />
== Quarterly Maintenance ==<br />
<br />
# [[Patching|Patch]] your computer.<br />
# Run a [[Windows#Cleaner|cleaner]] <br />
# In Control Panel, go to "Add/Remove New Software" and go through the list, removing any applications that you don't know what they do, or if you haven't used them in the past 3 months.<br />
# Run your [[Windows#Anti-Spyware|anti-spyware]] software<br />
<br />
== PowerToys ==<br />
<br />
PowerToys gives you access to system settings that are not exposed in the Windows XP default user interface, including mouse settings, Explorer settings, taskbar settings, and more. If you're not sure which to try, start with '''TweakUI'''.<br />
<br />
<br />
[http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx WindowsXP Powertoys]<br />
<br />
== Office tools ==<br />
<br />
Some free alternatives to Microsoft Office:<br />
<br />
[http://www.openoffice.org/ OpenOffice]<br />
<br />
[http://www.sun.com/software/star/staroffice/index.jsp StarOffice]</div>Hawsonhttps://hackepedia.org/?title=Patching&diff=3712Patching2007-06-29T18:32:18Z<p>Hawson: Reverted edits by QkeZ75 (Talk); changed back to last version by Hawson</p>
<hr />
<div>There are very few Operating Systems that have an adequate patching process for applications. The only two [[UBO]]s we recommend to someone who is too busy to track all of their installed applications is [[FreeBSD]] and [http://www.debian.org Debian GNU/Linux]. Apparently you can do this with [[RedhatDependencies|RedHat]] and its offspring, but I've heard about a lot of issues with "dependancy hell."<br />
<br />
It should be noted that "dependancy hell" is usually because the SysAdmin has installed packages from different distributions. For example, installing SuSE packages on a RedHat system is <i>asking</i> for trouble. Packages built for a specific RedHat version almost always work, as do packages rebuilt from .src.rpm files. (RedHat and other RPM-based systems are quite a bit nicer once you learn to roll your own RPM .spec files)<br />
<br />
<br />
== [[Debian]] ==<br />
<br />
Using [[Debian]] [[GNU]]/[[Linux]] or any of the [[ubuntu]] variants, it's as simple as <br />
apt-get update<br />
apt-get dist-upgrade<br />
and all of your installed applications will now be up to date. You can modify where you get your updates from the /etc/apt/sources.list file.<br />
<br />
== [[FreeBSD]] ==<br />
I've created two shell scripts which I've named update, and upgrade.<br />
You will need [http://www.freshports.org/sysutils/portsnap portsnap], [http://www.freshports.org/security/portaudit portaudit] and [http://www.freshports.org/sysutils/portupgrade portupgrade] installed to use these:<br />
<br />
#!/bin/sh<br />
# update<br />
/usr/local/sbin/portsnap fetch && /usr/local/sbin/portsnap update && pkg_version -v -l < #EOF<br />
<br />
<br />
#!/bin/sh<br />
# upgrade<br />
portaudit -F && portaudit<br />
portupgrade -a<br />
#EOF<br />
<br />
<br />
== [[OpenBSD]] ==<br />
<br />
In OpenBSD patching the operating system can be done in a few<br />
different ways. 1. OpenBSD offers a CVS tree that allows updating at any time to any revision including the latest changes made up to the minute. 2. OpenBSD allows snapshot updates which are install packages and can be installed with the install floppy or CD. 3. The OpenBSD ports can be updated with the pkg_add -u option.<br />
<br />
* With CVS you'd set the CVSROOT and CVS_RSH environment variable, go to the /usr/src tree and type cvs update -PAd (and -r for any revisions other than HEAD), then 'make build' to create userland and then cd /usr/src/arch/{ARCHITECTURE}/config and configure the kernel (GENERIC), then cd ../compile/GENERIC and make dep && make and after that cp /bsd /bsd.old; cp bsd /bsd and reboot. Userland and kernel "must" be built together as changes to structures can 'desync' programs that read out of kernel memory (various stats, vmstat, pstat, iostat, top)<br />
<br />
* With snapshot updates I usually download the entire architectures that I require and burn them to CD with mkisofs and cdrecord, the el-torito bootsector is written with the "CD" image found. When including multiple-boot platforms such as macppc I use mkhybrid instead of mkisofs. Once the CD is completed one can always restore binaries from it at any time. Anyhow one then boots the CD and when the OpenBSD installer boots it offers you 3 choices at the beginning: (I)nstall, (U)pgrade and (S)hell. I chose 'U' for upgrade and the process is straight forward and usually just a bunch of 'yes' answers for questions asked by the installer. After that reboot into the updated/patched operating system (after removing the CD). It's always wise to have made a 'final' backup of the previous system before (just plain common sense).<br />
<br />
* Updating packages with pkg_add(1) seems to work alright for me I set my PKG_PATH environment variable to the place (ftp server) where the packages are held and cd /var/db/pkg and then type pkg_add -u *, this seemed to work almost flawless last time I did this. It's good to also set PKG_CACHE to /usr/ports/packages/{ARCHITECTURE}/all, that way all the packages that are pulled from somewhere remote get copied there as well. Alternativly you can also cvs update the ports tree and build the new port yourself, make it a package and then use pkg_add -u to install the new package.<br />
<br />
== [[Windows]] ==<br />
Use internet explorer to go to [http://update.microsoft.com. Microsoft update]. Let it scan your computer and install all of the high-priority/recommended updates. If you have an issue installing a patch, say for example KB913580, take a look for the log file in C:\Windows for patchname.log. i.e. <br />
<br />
C:\WINDOWS\KB913580.log<br />
<br />
open the file in notepad.exe, at the bottom of the file you will hopefully find a searchable error message or error code.</div>Hawsonhttps://hackepedia.org/?title=Hackepedia:About&diff=3711Hackepedia:About2007-06-29T18:32:15Z<p>Hawson: Reverted edits by AfpPpi (Talk); changed back to last version by Franks</p>
<hr />
<div>You can email hackepedia @ this domain if you have a pressing issue. <br />
<br />
Anyone can contribute to content of this website. Sign up for a free account and you can start contributing today.</div>Hawsonhttps://hackepedia.org/?title=Ports&diff=3710Ports2007-06-29T18:31:56Z<p>Hawson: Reverted edits by NhzSg4 (Talk); changed back to last version by Franks</p>
<hr />
<div>Ports are identifiers of protocols that work on the transport layer (layer 4) of the [[OSI]] model. [[TCP]] and [[UDP]] are transport layer protocols that have ports. In [[TCP]] and [[UDP]] a port is represented by a 16 bit unsigned integer. Thus, the possible port range is 0 through 65535. Port 0 is illegal and no service resides on it.<br />
<br />
Say you want to know what is running on port 80 of your machine. The first hint would be to look in the file /etc/services as well as [http://www.iana.org/assignments/port-numbers IANAs list] to get an idea of what typically runs on that port. <br />
<br />
http 80/tcp www www-http #World Wide Web HTTP<br />
http 80/udp www www-http #World Wide Web HTTP<br />
<br />
looks like it's the port typically used for the www. Now we can try netstat to actually see what is listening,<br />
not just what should be there.<br />
<br />
# netstat -an | grep LISTEN<br />
httpd 30161 root 17u IPv4 5106 TCP *:http (LISTEN)<br />
<br />
however I prefer the flexibility of lsof which I install on all of my machines. <br />
<br />
# lsof -i:80<br />
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME<br />
httpd 447 root 17u IPv4 0xc15f6534 0t0 TCP www.example.com:http (LISTEN)<br />
httpd 73819 www 17u IPv4 0xc15f6534 0t0 TCP www.example.com:http (LISTEN)<br />
<br />
will show you exactly what is listening on this port, in this case "httpd". I will now look up the [[manual]] for httpd which tells me this is Apache on this particular server.<br />
<br />
This will give you a unique alphabetical summary listing of the applications currently listening on a port on your system:<br />
# lsof -i | awk '{print $1}' | sort -u<br />
<br />
If you want to see ports on your machine are open to the general public, which is often how computers are broken into, you can try Yashy's [http://crypto.yashy.com/nmap.php self port scan]. You don't want to see any ports open, or listening, unless you've intentionally started that process for the public to connect to.<br />
<br />
For every open port you find, you must determine if that service actually needs to run. If so, check if it actually needs to be available remotely, instead of only on the local machine. <br />
<br />
For example, if you're running mysql, you may see port 3306 listening. If mysql is on the same machine as your webserver, which is what you're using it for, you should configure mysqld to only listen on 127.0.0.1 (localhost), and not on your external IP address. <br />
You might see you have port 143 (imap) enabled which is only for machines on your 192.168.* network. If this is the case, configure your imapd to only listen on your 192.168.* interface, not the public facing one. The only ports you should see open to the public, are applications you intend for the public to access. <br />
<br />
See the "Ending a process" part of the [[process]] page for help in ending an unwanted process.<br />
<br />
Worse case scenario you have an application listening externally that you don't want the public to access (I can't think of a possible situation for this, but I write this just in case), make sure you have it blocked by your [[firewall]]<br />
<br />
<br />
<br />
== Solaris 10 ==<br />
<br />
# lsof -i<br />
<br />
to see what you have running. All ports are now controlled out of:<br />
<br />
# svcs<br />
<br />
which will give you a long list of services running ("online") or not. You may want to [[pipe]] this output through [[less]].<br />
<br />
When I did "lsof -i" I saw that rpcbind was running which I don't want, so I found the svcs name by running:<br />
<br />
# svcs | grep rpc<br />
online 23:43:56 svc:/network/rpc/bind:default<br />
uninitialized 23:43:44 svc:/network/rpc/gss:default<br />
<br />
and several more uninitialized services. I only want to stop the online one:<br />
<br />
# svcadm disable svc:/network/rpc/bind:default<br />
<br />
and back to a prompt I go. I run "lsof -i" once more to confirm it's stopped, and it is. Both the svcs and svcadm [[Manual]] are worth reading if you're using them for the first time.<br />
<br />
== Linux (Red Hat and spawn) ==<br />
<br />
# chkconfig --list| grep on<br />
<br />
will show a list of all services that are enabled, and at which [[runlevels]]. Workstations by default use of runlevel 5 (multiuser, with networking and X). Servers typically are found in runlevel 3 (multiuser, with networking), but sometimes 5 as well.<br />
<br />
Disabling services is simple. For example, to shut down httpd:<br />
<br />
# service httpd off<br />
# chkconfig --level 345 httpd off<br />
<br />
The first command shuts down the running webserver, while the second alters the boot configuration so it will not start automatically next time the system is rebooted.<br />
<br />
== FreeBSD ==<br />
<br />
To see all listening sockets using TCP/IPv4:<br />
<br />
$ sockstat -4l<br />
<br />
To see all connected sockets using IPv4 or IPv6:<br />
<br />
# sockstat -c</div>Hawsonhttps://hackepedia.org/?title=Satellites&diff=3697Satellites2007-06-18T19:29:33Z<p>Hawson: Reverted edits by ZavZ62 (Talk); changed back to last version by Pbug</p>
<hr />
<div>[http://www.heavens-above.com/ Heavens Above] lists the orbits for most satellites. Look up the orbits visible from your area. <br />
<br />
[http://www.wired.com/wired/archive/14.02/spy.html Wired article on Amateur satellite tracking]<br />
<br />
If you're going to try out satellite tracking, I would recommend you start with a LEO (low earth orbiting) or the ISS (International Space station) which are easier, and work your way out further upon success.<br />
<br />
== Nations with satellite launching capability ==<br />
<br />
*Canada<br />
*USA<br />
*France<br />
*Britain<br />
*Soviet Union<br />
*Israel<br />
*South Africa<br />
*Australia<br />
*China<br />
*India<br />
*Pakistan<br />
*North Korea<br />
*Japan<br />
*Switzerland<br />
*Egypt<br />
*Brazil<br />
*Cuba<br />
*Iran<br />
*Myanmar (Burma)<br />
*Ethiopia<br />
<br />
<br />
== Watching ==<br />
<br />
Some satellites ("birds" in slang) are visible with the human eye, and some may require binoculars. Make sure you have a good idea of its orbit, and time in your sky, so you can train your eye to follow the general path for when it actually does become visible.<br />
<br />
== Listening ==<br />
<br />
Find the downlink frequency for the amateur radio satellite you're tracking, and adjust it accordingly on your frequency scanner/radio. A directional antenna is preferred, however the standard "rubber ducky" (resistor) antenna may work.<br />
<br />
[http://www.amsat.org/amsat-new/satellites/status.php Amsat satellite status] which should list downlink frequency<br />
<br />
== Transmitting ==<br />
<br />
If you have a radio with a directional [[Yagi-Uda]] high-gain antenna, and an [[amateur radio]] license for the uplink frequency, you can try to point your antenna in that direction. You have to be quick to transmit off a satellite, as usually the passes go by quite quickly.<br />
<br />
[http://www.amsat.org/amsat-new/satellites/status.php Amsat satellite status] which should list uplink frequency<br />
<br />
== Software ==<br />
<br />
[http://www.satobs.org/orbsoft.html List of satellite prediction software]<br />
<br />
<br />
[http://www.amsat.org/amsat/keps/menu.html Amsat Keplerian elements for amateur radio satellites]. Keps are used in satellite prediction software to predict satellites current passes. You will most likely want to download this data on a regular basis to ensure you're as accurate as possible almost most satellites do have static orbits.</div>Hawsonhttps://hackepedia.org/?title=Patching&diff=3696Patching2007-06-18T19:29:27Z<p>Hawson: Reverted edits by QkeZ75 (Talk); changed back to last version by Franks</p>
<hr />
<div>There are very few Operating Systems that have an adequate patching process for applications. The only two [[UBO]]s we recommend to someone who is too busy to track all of their installed applications is [[FreeBSD]] and [http://www.debian.org Debian GNU/Linux]. Apparently you can do this with [[RedhatDependencies|RedHat]] and its offspring, but I've heard about a lot of issues with "dependancy hell."<br />
<br />
It should be noted that "dependancy hell" is usually because the SysAdmin has installed packages from different distributions. For example, installing SuSE packages on a RedHat system is <i>asking</i> for trouble. Packages built for a specific RedHat version almost always work, as do packages rebuilt from .src.rpm files. (RedHat and other RPM-based systems are quite a bit nicer once you learn to roll your own RPM .spec files)<br />
<br />
<br />
== [[Debian]] ==<br />
<br />
Using [[Debian]] [[GNU]]/[[Linux]] or any of the [[ubuntu]] variants, it's as simple as <br />
apt-get update<br />
apt-get dist-upgrade<br />
and all of your installed applications will now be up to date. You can modify where you get your updates from the /etc/apt/sources.list file.<br />
<br />
== [[FreeBSD]] ==<br />
I've created two shell scripts which I've named update, and upgrade.<br />
You will need [http://www.freshports.org/sysutils/portsnap portsnap], [http://www.freshports.org/security/portaudit portaudit] and [http://www.freshports.org/sysutils/portupgrade portupgrade] installed to use these:<br />
<br />
#!/bin/sh<br />
# update<br />
/usr/local/sbin/portsnap fetch && /usr/local/sbin/portsnap update && pkg_version -v -l < #EOF<br />
<br />
<br />
#!/bin/sh<br />
# upgrade<br />
portaudit -F && portaudit<br />
portupgrade -a<br />
#EOF<br />
<br />
<br />
== [[OpenBSD]] ==<br />
<br />
In OpenBSD patching the operating system can be done in a few<br />
different ways. 1. OpenBSD offers a CVS tree that allows updating at any time to any revision including the latest changes made up to the minute. 2. OpenBSD allows snapshot updates which are install packages and can be installed with the install floppy or CD. 3. The OpenBSD ports can be updated with the pkg_add -u option.<br />
<br />
* With CVS you'd set the CVSROOT and CVS_RSH environment variable, go to the /usr/src tree and type cvs update -PAd (and -r for any revisions other than HEAD), then 'make build' to create userland and then cd /usr/src/arch/{ARCHITECTURE}/config and configure the kernel (GENERIC), then cd ../compile/GENERIC and make dep && make and after that cp /bsd /bsd.old; cp bsd /bsd and reboot. Userland and kernel "must" be built together as changes to structures can 'desync' programs that read out of kernel memory (various stats, vmstat, pstat, iostat, top)<br />
<br />
* With snapshot updates I usually download the entire architectures that I require and burn them to CD with mkisofs and cdrecord, the el-torito bootsector is written with the "CD" image found. When including multiple-boot platforms such as macppc I use mkhybrid instead of mkisofs. Once the CD is completed one can always restore binaries from it at any time. Anyhow one then boots the CD and when the OpenBSD installer boots it offers you 3 choices at the beginning: (I)nstall, (U)pgrade and (S)hell. I chose 'U' for upgrade and the process is straight forward and usually just a bunch of 'yes' answers for questions asked by the installer. After that reboot into the updated/patched operating system (after removing the CD). It's always wise to have made a 'final' backup of the previous system before (just plain common sense).<br />
<br />
* Updating packages with pkg_add(1) seems to work alright for me I set my PKG_PATH environment variable to the place (ftp server) where the packages are held and cd /var/db/pkg and then type pkg_add -u *, this seemed to work almost flawless last time I did this. It's good to also set PKG_CACHE to /usr/ports/packages/{ARCHITECTURE}/all, that way all the packages that are pulled from somewhere remote get copied there as well. Alternativly you can also cvs update the ports tree and build the new port yourself, make it a package and then use pkg_add -u to install the new package.<br />
<br />
== [[Windows]] ==<br />
Use internet explorer to go to [http://update.microsoft.com. Microsoft update]. Let it scan your computer and install all of the high-priority/recommended updates. If you have an issue installing a patch, say for example KB913580, take a look for the log file in C:\Windows for patchname.log. i.e. <br />
<br />
C:\WINDOWS\KB913580.log<br />
<br />
open the file in notepad.exe, at the bottom of the file you will hopefully find a searchable error message or error code.</div>Hawsonhttps://hackepedia.org/?title=Unixhelp:Audio&diff=3695Unixhelp:Audio2007-06-18T19:29:08Z<p>Hawson: </p>
<hr />
<div>While it's an ecclectic EFnet [[IRC]] channel, some of the favourite sites for streaming music are:<br />
<br />
* [http://di.fm Trance/Techno/Beats] - tchang, cyberfrg <br />
* [http://www.radioparadise.com/ Rock] - Hawson<br />
* [http://www.afterhoursdjs.org/ Progressive/Acid Jazz] - Yashy<br />
* [http://stream1.jungletrain.net:8000 Jungle] - staaka<br />
* [http://www.club977.com 80s] - Yashy<br />
* [http://soma.fm underground/alternative] - RndPkt<br />
* [http://etn.fm trance] - cstone<br />
* [http://www.spiderpower.co.uk synthpop/industrial/80s newwave/uk punk] - cstone<br />
* [http://smoothbeats.com rap/urban/hiphop] - cstone<br />
* [http://www.fromthetop.org From the Top] - Classical music performed by ''very'' talented kids - Hawson<br />
* [http://pooshack.fscker.com:8000 loon's poo shack radio] - sun/wed 8p-12mid CDT/CST - loon<br />
<br />
----<br />
Sometimes, you don't want music, but something else:<br />
<br />
* [http://www.npr.org/programs/waitwait/ Wait, wait, don't tell me!] - Very funny "news quiz" radio show from WBEZ in Chicago. - Hawson<br />
* [http://www.midnightspecial.org/ Midnight Special] - Folk music with a sense of humor - Hawson<br />
* [http://www.ckln.fm CKLN 88.1] Toronto radio station with mandate to represent those with no voice in mainstream media (homosexuals, transgenders, 1 communist, various cultures, conservatives) - pbug<br />
<br />
----<br />
Other musical suggestions:<br />
* [http://flecktones.com/ Bela Fleck and the Flecktones]</div>Hawsonhttps://hackepedia.org/?title=Socket&diff=3694Socket2007-06-18T19:28:05Z<p>Hawson: Reverted edits by BfoKmu (Talk); changed back to last version by Franks</p>
<hr />
<div>Sockets are an API for [[IPC]] or network communication with a [[process]]. For IPC Unix domain sockets are used, for network communication INET sockets are preferred. INET sockets work on [[OSI]] layer 3 and above. Lower layer access is provided by [[bpf]] the Berkeley packet filter. Sockets provide [[descriptors]] to a process with which data or control data can be exchanged with the kernel.<br />
<br />
<br />
<br />
=== Unix domain sockets ===<br />
<br />
When a Unix domain socket is set up it is bound to the local systems filesystem. The path it can be bound to is limited to 103 characters (see ''/usr/include/sys/un.h'') instead of the filesystem limit of 1023 characters. This means that a socket should be set up close to the [[root]] perhaps in /tmp (as [[sshd]] does). Unix domain sockets make preferred [[IPC]] in [[OpenBSD]] because of the availability of the [[getpeereid]] syscall which allows a [[daemon]] to check the credentials of who is connecting to the socket. A socket in the [[filesystem]] looks like this:<br />
<br />
$ ls -l /tmp/ssh*<br />
total 0<br />
srwxr-xr-x 1 pbug wheel 0 Oct 8 11:27 agent.1327<br />
<br />
notice the 's' indicating that this file is a socket.<br />
<br />
<br />
<br />
=== INET sockets ===<br />
<br />
In order to communicate with the [[Internet]] a program can communicate with it via the [[Kernel]] which has a built-in [[internet stack]]. Common protocols that one can talk via sockets are [[TCP]] and [[UDP]] as well as [[ICMP]] which is grouped into the raw mode of sockets. When a program is a TCP server the common sequence of [[syscall]]s are socket(2), bind(2), listen(2), and accept(2). When a program is a TCP client the common sequence of [[syscall]]s are socket(2), connect(2). [[TCP]] and [[UDP]] sockets have [[ports]] to identify them. On a system one can use [[netstat]] to see this. In UNIX only [[root]] can bind to ports less than 1024 the rest is available for all users. This is shown here as an example:<br />
<br />
$ id<br />
uid=1000(pbug) gid=1000(pbug) groups=1000(pbug), 0(wheel), 5(operator) <br />
$ nc -l 1023<br />
nc: Permission denied<br />
$ nc -l 1024<br />
^C<br />
$ <br />
<br />
<br />
When a server is listening on a certain port it's difficult to regulate who connects to this port. Early implementations messed with [[TCP Wrappers]] which allowed one to set up a simple whitelist or blacklist of who can connect. This didn't cover UDP though and it was still required that the program accepted the connection before closing it. This means that someone could stealth scan a port and know that it was listening. [[Firewall]]s allowed finer control and aren't as revealing over open ports. [[BSD]] has ipfw, ipfw2, ipf and pf as firewalls.<br />
<br />
<br />
$ fstat | grep traceroute<br />
pbug traceroute 18184 wd /usr 6310091 drwxr-xr-x r 2048<br />
pbug traceroute 18184 0 / 84995 crw--w---- rw ttyp1<br />
pbug traceroute 18184 1 / 84995 crw--w---- rw ttyp1<br />
pbug traceroute 18184 2 / 84995 crw--w---- rw ttyp1<br />
pbug traceroute 18184 3* internet raw icmp 0xfffffe800f85d678<br />
pbug traceroute 18184 4* internet raw reserved 0xfffffe801bc73688<br />
<br />
<br />
Raw sockets are restricted to the superuser ([[root]]) only. When writing to raw sockets you can manipulate the [[IP]] header which you cannot do with simple [[TCP]] or [[UDP]] sockets ([[setsockopt]] are an exception but require superuser ([[root]]) permissions). The [[traceroute]] program uses raw sockets in a UNIX system. It is possible to read from raw sockets, ie. if you specified a specific protocol you can read any packets that arrive for that protocol. In [[BSD]] and if the protocol is [[ICMP]] the ICMP types echo request (8), timestamp request (13) and address mask request (17) are not passed from the [[kernel]] to the socket. Similarely [[TCP]] and [[UDP]] protocols are not passed to a raw socket, these must use stream or dgram sockets or be read from the [[OSI]] datalink layer (see [[bpf]]).<br />
<br />
<br />
=== Divert sockets ===<br />
<br />
[[FreeBSD]] has a way to read/manipulate/write [[OSI]] layer 3 packets which have been diverted from the [[ipfw]] software. This type of socket is limited to [[FreeBSD]].<br />
<br />
<br />
=== Packet sockets ===<br />
<br />
[[Linux]] has a way to read [[OSI]] layer 2 frames by means of SO_PACKET sockets. This is limited only to Linux.<br />
<br />
<br />
=== How do I see Internet traffic ===<br />
<br />
A packet [[sniffer]] is a tool that allows one to see packets carried through the [[network interface]] of a host computer.</div>Hawson