Category: Linux

How To Reset Your Root Password Using Grub Single User Mode

How To Reset Your Root Password Using Grub Single User Mode

Today I was confronted by someone who lost their root password, lucky for them they were using grub as their bootloader and it wasn’t password protected. This is the default for Ubuntu, Fedora, and other distros

There are X steps to this process:

Step 1. Get into the Grub Editor
When you boot you’ll probably see a few options in your grub menu. Unless you’re sure what kernel that you want to use, select the kernel at the top of the list and press e.

Step 1.1 Get into the Grub Editor (Part 2)
Hit the down arrow until the line that starts with kernel is selected, then press e again

Step 2. Enable Single User Mode
All that you have to do in order to enable single user mode is add the word “single” to the end of the line. Hit enter to return to the previous screen.

Step 3. Boot into your Single User Environment
With the same kernel selected press b to boot into the your new os.

Now you should be in a nice shiny root prompt. Feel free to do whatever you want here, including typing passwd to change the root passwd.

I’m Okay (and so is my blog)….

I’m Okay (and so is my blog)….

Long story short:

The computer that this blog is on was up for over 220 days, and when I restarted it, things were all messed up.

The only thing that I really wanted to back up was this blog, but I was unable to dump the mysql database because I couldn’t get it (mysql) to start.

I ended up copying the raw database in /var/lib/mysql to a backup directory.

Then I went on this whole crazy journey trying to convert my drupal database to be used with wordpress…… That didn’t work too well.

Then I realized that all along all that I had to do is enable mod rewrite in apache in order for it to work.

So there you have it: how my blog is working, and why I sound a little bit scatterbrained.

More later (hopefully),
Jon Howe

Enabling Samba and SWAT on Ubuntu

Enabling Samba and SWAT on Ubuntu

I recently got an album from AllOfMP3.com on my laptop while I was away from my house, and wanted it on my desktop computer. In the past I’ve used Samba to transfer from Windows to Linux, so that’s what I did this time.

There were a couple of problems though, i didn’t have samba installed or configured because I just switched from Ubuntu Breezy to Ubuntu Dapper. Samba can be a bit of a pain to set up by hand, so that’s why I use SWAT (Samba Web Administration Tool).

SWAT doesn’t work automatically in ubuntu though, in order to get it to work the install the following packages if you’re using inetd (not recommended):


apt-get install samba swat netkit-inetd
sudo update-inetd --enable 'swat'

Otherwise, if you’re using the recommended xinetd use the following fix:

Create a text file called ‘swat’ with the following information in it:


# default: on
# description: SWAT - The Samba Web Administration Toolkit
service vmware-authd
{
disable = no
port = 901
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/sbin/swat
type = unlisted
}

Then restart either (x)inetd and in your browser goto http://localhost:901 to log in.

That should work, if it doesn’t email me at howe dot jon -at- gmail _dot_ com

Install IE6 SP1 In Linux Using Wine and then some…

Install IE6 SP1 In Linux Using Wine and then some…

I’ve recently come across the need to use Internet Explorer in linux, and decided to find a way to do it. It’s possible to just install it by hand using wine, but I wanted an easier way. This led me to WineTools.

With WineTools you can easily install a plethora of windows apps easily and automatically.

On a different note, I set up Gallery2 on this server again due to the fact that I have a nice camera now. Right now there’s just some random stuff, but soon (read: next saturday) I’ll have a lot more pictures due to the fact that I’m going backpacking during the week of the 4th of July at North Manitou Island.

I also found a really cool thing from NetZero called NetZero Voice. It’s use is so that if you for some reason asked me for my number I could give you my NetZero Voice number instead of my cell number.

It has all sorts of cool stuff that you can do with it, like sending a text message to your real cell when you get a voicemail, and listening to your voicemails online as well as on your phone. Best of all, it’s FREE.

My number is 6165281831. Leave me a message!

Later,
Jon Howe

HowTo: Mount Bin/Cue files in Linux

HowTo: Mount Bin/Cue files in Linux

Okay, so I I lied a little bit. I’m not sure how to mount a straight bin/cue file combination in Linux, but I do know that it’s really easy to convert them into an ISO file, and then mount the ISO in debian based linux.

sudo apt-get install bchunk

The syntax from bchunk is as follows:
bchunk [-v] [-p] [-r] [-w] [-s]

So if i wanted to convert image,bin and image.cue into image.iso, I’d run the command:
bchunk image.bin image.cue image.iso

Then to mount the ISO in linux you run the command:
mount -o loop -t iso9660 image.iso /mnt/image, where image.iso is the iso is the image that you want to mount and /mnt/image is the mount directory.

Hopefully you’ll find a use for this like I did. If it doesnt work feel free to leave me an email at howe -dot- jon -at- gmail -dot- com and I’ll respond as quick as I can.

Later,
Jon Howe

Drupal 4.7.0 Released

Drupal 4.7.0 Released

From the Drupal Homepage:

After more than a year of development we are ready to release Drupal 4.7.0 to the world. More than five years, 13 major releases, 30+ servicing firms employing 100+ Drupal professionals, 300+ third party modules, and over 55,000+ Drupal powered sites later, Drupal 4.7.0 is finally here and it rocks!

Needless to say, I’m going to be updating this version very quickly, aka as soon as my laptop starts up. Look for the next post to be from Drupal 4.7.0!

Later,
Jon Howe

How to get Logitech mice to work in Ubuntu

How to get Logitech mice to work in Ubuntu

Most Logitech mice are connected via USB, and I have not tested this with PS/2 mice.

Open xorg.conf

sudo gedit /etc/X11/xorg.conf

Now find the section that says something like:

Section "InputDevice"
Identifier "Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "Emulate3Buttons" "true"
Option "ZAxisMapping" "4 5"
Option "Buttons" "7"
EndSection

and comment it out by putting a # symbol in front of each line. It should look like this:

#Section "InputDevice"
# Identifier "Mouse"
# Driver "mouse"
# Option "CorePointer"
# Option "Device" "/dev/input/mice"
# Option "Protocol" "ImPS/2"
# Option "Emulate3Buttons" "true"
# Option "ZAxisMapping" "4 5"
# Option "Buttons" "7"
#EndSection

Now make some space under or above that section and paste in the following:

Section "InputDevice"
Identifier "Mouse"
Driver "mouse"
Option "Protocol" "evdev"
Option "Dev Name" "Logitech USB-PS/2 Optical Mouse"
Option "Dev Phys" "usb-*/input0"
Option "Device" "/dev/input/event2"
Option "Buttons" "10"
Option "ZAxisMapping" "4 5"
EndSection

Save the file and restart the X server by pressing Ctrl+Alt+Backspace.

Note: If the X server fails to start, use the command “sudo cp /etc/X11/xorg.conf.backup /etc/X11/xorg.conf” to restore your original settings.

After the X server is restarted and your mouse is still working, you have to edit the .Xmodmap file.

sudo gedit ~/.Xmodmap

Paste the line “pointer = 1 2 3 6 7 8 9 10 4 5” without quotes in this file. If there’s already a “pointer” section, overwrite it.

Now run xmodmap to apply the settings:

xmodmap ~/.Xmodmap

Now to get the side buttons working in Nautilus and Firefox. Install xvkbd and xbindkeys with:

sudo apt-get install xvkbd xbindkeys

Create a configuration file for these new program by:

gedit ~/.xbindkeysrc

Paste the following into that file, then save and exit:

"/usr/X11R6/bin/xvkbd -xsendevent -text "[Alt_L][Left]""
m:0x0 + b:6
"/usr/X11R6/bin/xvkbd -xsendevent -text "[Alt_L][Right]""
m:0x0 + b:7

Now add this program to you session by adding it to “System > Preferences > Sessions”. Click on the “Startup Programs” tab and click “Add” and enter “xbindkeys”. This makes sure that everytime you log in, your setting are loaded.

Install the logitech applet (not really an applet by the way) by:

sudo apt-get install checkinstall build-essential libusb-dev
wget http://freshmeat.net/redir/logitech_applet/53319/url_tgz/logitech_applet-0.4test1.tar.gz
tar xvfz logitech_applet-0.4test1.tar.gz
mv ./logitech_applet-0.4test1 ./logitech-applet-0.4test1
cd ./logitech-applet-0.4test1
./configure --prefix=/usr
make
sudo checkinstall

Just hit enter when checkinstall prompts you. Everything should now be installed.

Use the command:

sudo logitech_applet -s 800 -e

This sets you mouse at optimum resolution. You might have to adjust the mouse setting in Gnome as the mouse will be much more accurate now. Go to “System > Preferences > Mouse” and adjust the settings to your liking.

Now to make all this load at boot time. Make a file in /etc/init.d/local to keep local settings.

sudo gedit /etc/init.d/local

Paste this into the file, save, and exit:

echo "Setting up Logitech mouse..."
logitech_applet -s 800 -e

Make that file executable by:

sudo chmod 755 /etc/init.d/local

Now run the following command to make the “local” script run when the system boots:

sudo update-rc.d local defaults

Now you should have a fully working Logitech USB mouse in Ubuntu.

Howto: Set Up Your Own Snort Intrusion Detection System with a Database Backend

Howto: Set Up Your Own Snort Intrusion Detection System with a Database Backend

Okay, truth told, I’m completely bored, so I’m going to write a quick tutorial on how to install and set up the Snort IDS on a Debian Sarge System (although it should work on other distros as well).

Download and Install Snort
apt-get install snort-mysql

Enter values in the following screen, but forget about the part about the database
cd /usr/share/doc/snort-mysql
mysqladmin -u -p create
zcat create_mysql.gz | mysql -u -p

Howto: Get a Movie from a DVD to your Sony Clie (and probably other PDA’s as well)

Howto: Get a Movie from a DVD to your Sony Clie (and probably other PDA’s as well)

I’ll try to make this as simple as possible.

I’m going to assume that you’re using Linux (and that you are not a complete noob at it) for this tutorial. I will assume that you’re using a Sony Clie.

Here’s an overview of what we’re going to do:

  1. Rip dvd using DVD:Rip
  2. Convert ripped movie into a clie compatible format
  3. Download and install TCPMP (free media player)
  4. (optional) Install Memory Stick Pro fix
  5. Copy Movie to the Memory Stick

Step 1: Download and Install Files
apt-get install dvdrip
apt-get install pilot-link
Download TCMP (for palm)
Download all attachments

Step 2: Rip DVD
Encode with the xvid4 codec
Set file size to One CD at 700Mb
The only reason that I have this step is because I like to watch the video in high quality on my desktop

Step 3: Convert ripped DVD to Palm Readable Format
Put the following into a script called vid2palm and make it executable


#!/bin/sh
#Change 480:320 to the size of your PDA screen
#480:320 works for the Sony Clie

nice mencoder $1 -vf scale=480:320 -ovc xvid -xvidencopts bitrate=300 -oac mp3lame -lameopts cbr:br=64 -o $2
So, if dvdrip created the file MyMovie.avi you’d run the command vid2palm MyMovie.avi MyMovie_Palm_Format.avi

Step 4: Install files on your Clie
This can be a little tricky for someone doing it for the first time, but after a couple of times it works great.

The syntax for installing a palm file is:
pilot-xfer /dev/pilot -i [File to be installed]

However, If you just run this command it won’t work. You first need to hit the hotsync button and then quickly run the previous command.

If you do this and the console says to press the hotsync button, just hit cancel on your clie, and terminate the command, and try again. It’s been a bit of hit-and-miss for me.

Files to install on the PDA from the TCPMP Archive:

  • pilot-xfer /dev/pilot -i tcpmp_ffmpeg_plugin.prc
  • pilot-xfer /dev/pilot -i tcpmp_mp3_plugin.prc
  • pilot-xfer /dev/pilot -i tcpmp_mpeg4_plugin.prc
  • pilot-xfer /dev/pilot -i tcpmp.prc
  • As well as the attached tcpmp_aac_plugin.prc
  • If your memory card is a memory stick pro it will not work by default with the clie, so you have to install a fix for it (it’s the MSPRONX_ENUS.PRC one):
    pilot-xfer /dev/pilot -i MSPRONX_ENUS.PRC

    Sound doesn’t work by default on mine either, I had to install the following patch (again, an attachment: MCA2_05_TEST.prc):
    pilot-xfer /dev/pilot -i MCA2_05_TEST.prc

    You need to set up this plugin by going to prefrences and then in the drop down menu select MCA2, and check the button “auto install after reset”. It will restart, then go back to the same area and select “DEFAULT is ON (normal)”.

    Step 5: Moving the finished product to your Memory Stick (pro)
    First, goto MS Import. If you have a newer distro / kde it will mount the flash drive as a local directory. If it doesnt, use the “mount” command to mount it. I assume that you know how to do this (if you don’t try “man mount”).

    Now it’s a bit of a waiting game. Once it looks like it’s done copying unmount the device in linux first, wait a minute, and then disconnect in MS Import.

    Step 6: Play the Movie
    Goto TCPMP, open, and play your movie!

    This is how I did it, after a week or so of trying.

    If you have any questions leave a comment or email me (howe -dot- jon -at- gmail -dot- com.

    Later,
    Jon Howe

    Copyright VirtJunkie.com © 2024