Automate Windows Login
by thinkdez on Apr.16, 2010, under Windows
For most home users they don’t like the inconvenience of having a password at login. Some clear the password to let the system login automatically and this is a security issue. As long as your comfortable with letting anybody who turns your computer on having access to your desktop and files then this procedure will let you automate the login. Keep in mind that if someone gets to your computer and wants to access the system all they have to do is reboot. So if its shared or if its a laptop that you take on the road I highly recommend that you don`t remove your password.
- Open a run dialog (Window key + R or Click start Run)
- Type in control userpasswords2
- Press OK. The User Accounts window will display.
- Uncheck the option “Users must enter a user name and password to use this computer”
- Click “OK”
- You will then be prompted to enter the current password and confirm it.
- After doing so, you will no longer be prompted to enter your password upon login
And with that your next reboot will start without prompting you to login. This will work for Windows XP through Windows 7
Mounting an ISO file under Linux
by thinkdez on Dec.08, 2009, under Unix/Linux
With Windows you typically need a third party program to open an ISO file without burning a CD/DVD. With Linux the mount command will help you to achieve this without any additional software. The simplicity of the command is this:
# mount -o loop disk1.iso /mnt/disk
The loop device allows you to mount a file as a block device.
Logical Volume Manager (LVM)
by thinkdez on Oct.13, 2009, under Unix/Linux
An LVM is a valuable tool if you had multiple disks of various sizes that you wanted to streamline into one or many partition(s). Setting up a RAID would be a much better way to go as you get the redundancy should one of your drives fail. The only problem with a RAID is that you need to have the same size disk for it work or you will be wasting drive space. An LVM has the advantage that you can use various disks of various sizes and put them together as one or many partitions. If you wanted to keep a RAID and have multiple partitions you could build your LVM on top of the RAID which will provide you with redundancy.
This article will only describe setting up an LVM.
There are 3 elements required to create an LVM, 1. Initialize the physical disk for use in an lvm, 2. Group the physical volumes for use in an lvm, 3. Create the logical volume from the volume group. Each of these elements have separate commands which help to accomplish this.
1. pvcreate – initialize the disk/partition for use in and LVM.
2. vgcreate – group disks/partitions into a pseudo physical volume.
3. lvcreate – creates the Logical disk to be mounted.
The first task you need to do is setup the disks using fdisk.
# fdisk /dev/sdb
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-60801, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-60801, default 60801):
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 8e
Command (m for help): p
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x8c4a9b5a
Device Boot Start End Blocks Id System
/dev/sdb1 1 60801 488384001 8e Linux LVM
Command (m for help): w
This step has to be done for all disk/partitions that are to be used in the LVM. Once this is completed we can initialize the physical disk for use with an lvm.
# pvcreate /dev/sdb1
# pvcreate /dev/sdc1
Now the disks are usable in an lvm but they haven’t been associated with each other. To do this we will issue the vgcreate command to associate the disk/partitions to a particular group
# vgcreate mylvmvg /dev/sdb1 /dev/sdc1
mylvmvg is the name of the Volume Group. The associated device names are the disks to be include in the Volume group. We can run a check to see the volume group
# vgscan
Reading all physical volumes. This may take a while...
Found volume group "mylvmvg" using metadata type lvm2
Now we need to create the logical disk
# lvcreate -n mylvmlv -L 400G mylvmvg
The -n option specifies a name for the Logical volume. If not specified the system assigns a default of lvol#. The -L specifies the size of the disk. There are alternate options available which I will describe later in another post. The last option is the name of the Volume group we previously created.
Note: I didn’t use the entire disk as we will be extending the LVM in another post.
Now the disk can be formatted and mounted as you would any other disk. You now have a fully usable LVM. I will be posting a follow-up on LVM’s which will explain how to extend the LVM.
mySQL Password Hell
by thinkdez on Oct.13, 2008, under Database
So the one thing I always fumble and have to go look up is how to reset a password for a mySQL user, be it the root user or just a user for a new database. I use phpmyadmin which is a great tool and helpful provided you have local access to the server but sometimes you just need to use the command line to update the password for a user. The biggest problem with updating via the command line you do not always get a easy to read response as I learned after several attempts to reset the password on a account I had forgotten. It turns out that after updating the password the response Query OK, 0 rows affected is normal. I beat my head a while as I was not aware that due to the nature of the set password statement it would not show that a row was affected.
Enough babbling how do you do it? Well as long as you can login as the root mySQL user then you can reset any user you have with the following command:
mysql> SET PASSWORD for 'username'@'hostname' = PASSWORD("NEW_PASSWORD");
Alternatively you can use the following instructions:
mysql> UPDATE user SET password=PASSWORD("NEW_PASSWORD") WHERE user=”username”;
mysql>FLUSH PRIVILEGES;
Both of the above commands will work however the second option is done by modifying the tables manually where the first option is running a function. Use either method to your preference, just be careful when resetting your root mySQL password.
Now should you have forgotten your root mySQL password do not worry, you can still recover your password. The trick is to restart mySQL and skip the grant tables.
First stop mySQL on your system, then on Unix based systems run #/usr/bin/mysqld_safe --skip-grant-tables &
#mysql -h localhost
mysql>SET PASSWORD for 'root'@'localhost' = PASSWORD("NEW_PASSWORD");
At this point you will want to restart the server and test your login.
So its not that difficult just easy to forget as you will probably reset your password once in a blue moon.
Hello world!
by thinkdez on Oct.13, 2008, under Uncategorized
Welcome to my tech blog. I am starting this blog for a couple of reasons. First of its a great way to share my knowledge with the world. Although this information is already out there its a one stop shop for technological know how, or at least I hope it will be. Second its a great place to keep all those commands, and procedures I use when setting up my own systems and saves me the trouble of searching for that command I used last year.
So who am I?
My name is Desmond and I have been in the tech industry for the last 8 years or so. I have experience in both Microsoft Windows, and Unix/Linux systems. I also have worked in an Mac environment but its been so long that I am not sure if I will have a lot to offer the Mac users out there, sorry. I am focused on Linux as I find it a great OS and not to mention its free!
I hope what I offer here is helpful to those out there reading it. I also want to advise that the instructions that I provide worked for me in my environment. You will need to adjust the commands to suit your needs and I cannot be held responsible for any damage done. I am only providing this information for educational purposes.
Well than I guess that it for the intro. I hope to hear great things from you. Let me know what you think.
