Thursday, April 23, 2009

Resetting OS Passwords! Just a good writeup for those interested. ;)

Windows
Windows is still the most popular operating system, and the method used to discover the login password is the easiest. The program used is called Ophcrack, and it is free. Ophcrack is based on Slackware, and uses rainbow tables to solve passwords up to 14 characters in length. The time required to solve a password? Generally 10 seconds. The expertise needed? None.

Simply download the Ophcrack ISO and burn it to a CD (or load it onto a USB drive via UNetbootin). Insert the CD into a machine you would like to gain access to, then press and hold the power button until the computer shuts down. Turn the computer back on and enter BIOS at startup. Change the boot sequence to CD before HDD, then save and exit.

The computer will restart and Ophcrack will be loaded. Sit back and watch as it does all the work for your. Write down the password it gives you, remove the disc, restart the computer, and log in as if it were you own machine.

Mac
The second most popular operating system, OS X is no safer when it comes to password cracking then Windows.

The easiest method would be to use Ophcrack on this, also, as it works with Mac and Linux in addition to Windows. However, there are other methods that can be used, as demonstrated below.

If the Mac runs OS X 10.4, then you only need the installation CD. Insert it into the computer, reboot. When it starts up, select UTILITIES > RESET PASSWORD. Choose a new password and then use that to log in.

If the Mac runs OS X 10.5, restart the computer and press COMMAND + S. When at the prompt, type:

fsck -fy

mount -uw /

launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist

dscl . -passwd /Users/UserName newpassword

That’s it. Now that the password is reset, you can login.

Linux
Finally, there is Linux, an operating system quickly gaining popularity in mainstream, but not so common you’re likely to come across it. Though Mac and Linux are both based on Unix, it is easier to change the password in Linux than it is OS X.

To change the password, turn on the computer and press the ESC key when GRUB appears. Scroll down and highlight ‘Recovery Mode’ and press the ‘B’ key; this will cause you to enter ‘Single User Mode’.

You’re now at the prompt, and logged in as ‘root’ by default. Type ‘passwd’ and then choose a new password. This will change the root password to whatever you enter. If you’re interested in only gaining access to a single account on the system, however, then type ‘passwd username’ replacing ‘username’ with the login name for the account you would like to alter the password for.

Conclusion
There you have it - that is how simple it is for someone to hack your password. It requires no technical skills, no laborious tasks, only simple words or programs. The moral of the story? Encrypt your data to keep it safe. Don’t use only a password, but actually encryption, such as Blowfish or AES-128. There are a number of programs that can do this - TrueCrypt for Windows, or the native encryption found on Ubuntu, creating a disk image in Mac, etc.

Saturday, April 18, 2009

'08 nissan 350z - nogaro red paint code

the factory paint code for my nogaro red 350z is A41.

...because i have to buy some touch up paint!

Sunday, April 12, 2009

rEFIt - bootloader for the mac.

http://refit.sf.net

The rEFIt Project

rEFIt is a boot menu and maintenance toolkit for EFI-based machines like the Intel Macs. You can use it to boot multiple operating systems easily, including triple-boot setups with Boot Camp. It also provides an easy way to enter and explore the EFI pre-boot environment.

Friday, March 27, 2009

burn a playable dvd from video_ts in Mac OS X

Burn a playable DVD from a VIDEO_TS folder

After searching the forums and trying various things, I still couldn't find a quick, reliable, free method of burning a VIDEO_TS folder to a pure UDF DVD, so that it would play in regular DVD players, as well trigger DVD Player to start up automatically. Anyway, as often is the case, Terminal had the answers. Just type in this command and change the paths to suit:
hdiutil makehybrid -udf -udf-volume-name DVD_NAME \
-o MY_DVD.iso /path/to/VIDEO_TS/parent/folder
Make sure that /path/to/VIDEO_TS/parent/folder is the path to the folder containing the VIDEO_TS folder, not the VIDEO_TS folder itself. Once the .iso file has been created, drag this to Disk Utility and hit the Burn button.

Sunday, January 25, 2009

some things someones father taught them...

Things my father taught me


Date: 2008-04-13, 9:33AM PDT


The measurement of my finger from the tip to the first joint is 1 inch...depth for planting peas.
The measurement to the second joint is 2 inches...depth for corn.
Return borrowed things in better shape than when you borrowed them.
There are two types of trouble...one is the trouble you knowingly walk into, the other is trouble that just happens...it's important to know the difference.
Walk softly but carry a big stick.
if you have to use said stick, make sure who you use it on, doesn't get up.
Grits is good.
Foul language is a sign of a limited vocabulary
Orion, the Big and Little Dippers.
Everyone is a friend until proven otherwise.
Licorice ferns, huckleberries, nettles, sword ferns.
Tabasco won't kill you even if you eat it by the spoonfull.
Don't watch the clock when you're at work.
Fish can see you if you look over the side of the boat.
Fish can hear you if you talk to loud.
Respect the elders.
Never go to bed angry.
That which does not kill you will hurt like the dickens, but it will make you stronger.
Family is the most important thing on earth.
How to play the guitar, spoons, mouth harp, and water filled bottles.
The true meaning of "Self Made Man"
If you don't know something, go to the library and learn it.
The phrases "I don't know", "I forgot", or "I tried (and failed)" are excuses.
There is a difference between an excuse and a reason, know the difference.
Take care of your apperance...even if it is just a t-shirt and jeans.
The world can change everything about you, except your point of view...unless you allow it to.

David L. McDonald
born 1936-passed 2008
precious father
beloved husband
A right good fellow.

Tuesday, November 11, 2008

neopi, oracle on linux...10gr2..and my birthday.

oh, and today is my birthday. yay.

so, i finally got around to writing about this. I succesfully got ora 10gr2 installed on RHEL5. thanks to the help of gathering dependencies by this free product called NEOPI. Its pretty nice...just a kind of automatic dependency generator, and it runs some other checks too, but it helped solve the issues I was running into with the misplaced/mislinked libraries. hopefully that puts the RHEL5 Oracle10gr2 fears to rest...and I can move on.

Thursday, November 6, 2008

Oracle 10gR2 on RHEL5

Preamble

This manual is directed show how to install Oracle database 10g on RedHat Enterprise Linux 5. The article show the process from system administrator point of view ad try to simplicity most of the tasks not related to system administration will in deep explanation of tasks and impacts of them. Be aware RHEL 5 x86 is not supported platform (in this moment) for Oracle 10g so when you ask questions in metalink don't be surprised get no answer. According to the product documentation supported platforms for x96 are RHEL AS/ES 3.4 or later, RHEL 4, SUSE Linux Enterprise Server 9.0SP2 or later and Asianux 1.0 and 2.0. Additionally you can't expect reliability from this system for production environment.

Hardware requirements

From documentation you read Oracle 10g need at least 1 gigabyte of memory, but the absolute minimum is 512 MB. OK, with so little memory you are on the bottom line for required shared memory, but database can start. for testing 768 MB sound's much better. Similar is the situation with swap. Everything will work fine with only 1024 MB of swap.

Software requirements

List of packages you will need for install Oracle 10g on RHEL include

binutils
compat-db
compat-libstdc++
control-center
gcc
gcc-c++
glibc
glibc-common
gnome-libs
libstdc++
libstdc++-devel
make
pdksh (RHEL 5 ships with ksh instead)
sysstat
xscreensaver
setarch
libXp (to start runInstaller)

Preinstalation tasks

Let's create users and groups for installation

# groupadd dba
# groupadd oinstall
# useradd -G dba -d /home/oracle -g oinstall oracle
# passwd oracle

Next create filesystem for oracle files and database. Do not forget to create appropriate changes in /etc/fstab to mount this filesystem on startup. In documentation of product is mentioned to use only RAID10 array(s) and for production is wise to use hardware based arrays, but here we just play and any filesystem and volume will be OK. Transfer files to the machine and extract zip's somewhere. I write files, because i recommend for installation not only Oracle database server, but 10g Release 2 (10.2.0.3) Patch Set 2 ever only for testing and playing. For more info about the the patch set read document 316900.1 and download file p5337014_10203_LINUX.zip from metalink. Now is time to login on the machine as root to set some parameters in linux kernel and operating system

- check if FQHN exist in /etc/hosts
- check the id of oracle user to ensure oinstall is primary group of user and user is member of group dba
- check for existence of user nobody
- check and set if need the parameters for semaphors:
semmsl - 250
semmns - 32000
semopm - 100
semmni – 128

Semaphores explanation

semmsl – maximum number of semaphores per semaphore identifier. Should be increased carefully because very big number will eat memory not used later
semmns - maximum number of semaphores in the system. Size it carefully because of above reason
semopm - Define maximum number of semaphore operations per system call
semmni – maximum number of semaphores per semaphore identifier. Do not increase it over needed limit, because of waste of memory
if you have attached to the server additional hardware read carefully documentation of drivers for this hardware, because for example some drivers for FC controllers need additional semaphors to be set per controller


- check and set if need the parameters for shared memory
shmall 2097152
shmmax Half the size of physical memory (in bytes) or current value if bigger
shmmni 4096

Shared memory explanation

shmall - maximum number of shared memory pages. If you set it to too low value can slowdown any program usng shared memory
shmmax – maximum size of shared memory segment that can be allocated in the memory. For servers with lots of memory can be increased to 80% of memory to avoid shared memory fragmentation
shmmni – maximum number of segments. It's good idea to change it only by vendor recommendation


- check and set if need the parameters for maximum number of file handlers, supported by system
file-max 65536

- check and set if need the parameters for network
ip_local_port_range Minimum:1024 Maximum:65000
rmem_default 1048576
rmem_max 1048576
wmem_default 262144
wmem_max 262144

Network setting explanation

ip_local_port_range – define full range of local ports in Linux, normally upper limit is 32000
rmem_default Default Receive Window
rmem_max Maximum Receive Window
wmem_default Default Send Window
wmem_max Maximum Send Window



So you can add you /etc/sysctl.conf file something like

kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144

and execute

# sysctl -p

Next is time to set some environment variables for oracle user. Do not forget to put the in shell profile for oracle user. They should look's like

ORACLE_BASE=/home/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0
ORACLE_SID=test01

On this point it is very good idea to check the available diskspace in directory where will be installed oracle – you will need 4 GB average for software and database. To start successfully installer it's need to edit /etc/redhat-release and to change release from 5 to 4. Do not forget to return the value back later, otherwise you will be no able to update your server. Next is time to run runInstall. You will need running X server, because interactive installation need graphic display

Actual installation

On the first step we choose advanced installation to have better control over the packages and options to be installed on the server. Later if it's need we can install additional packages almost seamless. Our target is Enterprise Server as more powerful and complex. on the next step Oracle Installer check for prerequisites for installation as physical memory, swap, networking, environment variables, etc. If you get warning about the amount of memory you can skip it without any problem. Next we will install only software without create new database. There is program, named dbca – database configuration assistant which one can help to create new database. Then read the summary screen and go back to change some packages you do not need or other parameter. It's out of scope of this document to discuss the idea and purpose of packages you can find in oracle database. Next we press install and wait a lot, because of very long process of installation. On the bottom part of the screen you can see the path to log file for current installation and you can inspect it if you get some errors or just from curiosity. In on of the stages of installation (almost on the end) you should execute 2 scripts as root user. And at the end we have installed Oracle database 10g. If you have patch mentioned above installation process for patch is similar: runInstaller....

Et voila, we are ready to play and test oracle on our RHEL 5 server :-)

Tuesday, November 4, 2008

tar over ssh to pipe files..

I didn't have enough space on a vm i just built to copy all the data over as a tar and then untar it, so I went on a search...I found this and it worked VERY well:

From: http://www.cyberciti.biz/faq/howto-use-tar-command-through-network-over-ssh-session/

Q. How do I use tar command over secure ssh session?

A. The GNU version of the tar archiving utility (and other old version of tar) can be use through network over ssh session. Do not use telnet command, it is insecure. You can use Unix/Linux pipes to create actives. Following command backups /wwwdata directory to dumpserver.nixcraft.in (IP 192.168.1.201) host over ssh session.

The default first SCSI tape drive under Linux is /dev/st0. You can read more about tape drives naming convention used under Linux here.

# tar zcvf - /wwwdata | ssh root@dumpserver.nixcraft.in "cat > /backup/wwwdata.tar.gz"OR# tar zcvf - /wwwdata | ssh root@192.168.1.201 "cat > /backup/wwwdata.tar.gz"

Output:

tar: Removing leading `/' from member names
/wwwdata/
/wwwdata/n/nixcraft.in/
/wwwdata/c/cyberciti.biz/
....
..
...
Password:

You can also use dd command for clarity purpose:# tar cvzf - /wwwdata | ssh ssh root@192.168.1.201 "dd of=/backup/wwwdata.tar.gz"It is also possible to dump backup to remote tape device:# tar cvzf - /wwwdata | ssh ssh root@192.168.1.201 "cat > /dev/nst0"OR you can use mt to rewind tape and then dump it using cat command:# tar cvzf - /wwwdata | ssh ssh root@192.168.1.201 $(mt -f /dev/nst0 rewind; cat > /dev/nst0)$You can restore tar backup over ssh session: # cd /
# ssh root@192.168.1.201 "cat /backup/wwwdata.tar.gz" | tar zxvf -
If you wish to use above command in cron job or scripts then consider SSH keys to get rid of the passwords.

Friday, October 17, 2008

ubuntu intrepid ibex java needs icedtea

in order to get mozilla working with java, you need to install the icedtea plugin after installing the open java stuff.

Thursday, October 16, 2008

unix and windows: carriage returns with tr/sed/awk

cat -v myfile.csv

...and then you will see them at the end of the line as ^M (Ctrl-M)

delete them using tr like this, but this will only work in the following form if "\r" is recognised as a carriage return character. Some versions of tr and sed do not. So before you try this out you should set up a test file with a few "r"s in it in obvious places to make sure the following command is not just deleting "r"s.

tr -d '\r' <> outfile.csv

If the above command deleted "r"s instead of carriage returns then instead of using '\r' use 'Cntl-v-m'. The Cntl-v works on a few shells to let it know that you are going to enter a special character and the "m" you follow it with indicates a carriage return. "m" as in the "^M" you see at the end of the lines when you use cat -v.

There are other ways of removing these carriage returns. You can use sed to do it but again you have to check is it accepts "\r" as a carriage return by experimenting on a very small test file with a few obvious "r"s in it.

sed 's/\r$//' infile.csv > outfile.csv

On a final note, you might have to convert a Unix file to a DOS/Windows file sometimes. You can do it like this:

awk '{ print $0 "\r"}' unix.txt > dos.txt

---

simple:
tr -d '\015' <> new.file

more simple:
perl -pi -e 's/\015//g' file