Ubuntu root

Posted on January 20, 2012 by GoogleThem.
Categories: Linux tips and tricks.

sudo command (you must do this every time you issue a command)

OR:

Create an Ubuntu root account with password easily.

This post also shows how to create a linux cd root password.

Apache httpd.conf – ServerSignature Off ServerTokens Prod

Posted on September 4, 2011 by GoogleThem.
Categories: Linux tips and tricks.

To supress apache returning information about itself in the response headers add these 2 lines to httpd.conf:

ServerSignature Off
ServerTokens Prod

This can be done with WHM without editing the httpd.conf file:
Main >> Service Configuration >> Apache Configuration

Unpredictable drive errors

Posted on May 12, 2011 by GoogleThem.
Categories: Linux tips and tricks, Windows Tips.

from my favorite disk imaging program support website, a very helpful guide to fixing disk read or write errors due to glitchy items like bad IDE cables: http://www.terabyteunlimited.com/kb/article.php?id=152

Image Validation Fails with Image Stream Corrupt or Byte-for-Byte Validation Failure Message

This problem can be caused by overclocking, overheating, a hardware problem, or a BIOS or firmware bug or configuration issue.

To determine if the mainboard, memory, or CPU is at fault:

  • Download and run either the Microsoft Windows Memory Diagnostic or memtest86 (or try both of them).
    • If you use the Windows Memory Diagnostic, run the extended tests overnight.
    • If you use memtest86, run all seven of the default tests and allow it to run overnight.

If the memory diagnostic does not report any errors, check the following:

  • Run chkdsk /f on both the source drive and the drive holding the backup image. Important: Only run chkdsk if the memory diagnostic did not report any errors. Running chkdsk on a system with bad memory can result in data corruption.

    Start a Command Prompt and then run chkdsk x: /f where x: is the drive to check.
    For example: chkdsk c: /f

    Note: If running Windows Vista or Windows 7, you must run chkdsk from an Administrator Command Prompt.

  • If the problem is occurring when saving images to an optical drive, try burning at a slower speed and/or updating the drive’s firmware, if possible. Also, please refer to the article Message “Unable to read from file” when Performing Image Validation or Restore, if applicable.
  • If you are overclocking, revert your settings to the defaults and determine if the problem goes away.
  • If you are using a non-standard, third-party system BIOS or device firmware, switch to the latest final version of the manufacturer-supported BIOS or firmware, reset all BIOS settings to the defaults (referred to as a “clearing the CMOS” procedure by some mainboard manufacturers) and determine if the problem goes away.
  • If you have recently flashed to a different version of your system BIOS or the firmware of the controller to which your drive is connected (even if you the version used is a manufacturer-supported version), try reverting to the BIOS or firmware version you were using before (or the latest version) and determine if the problem goes away.
  • If you are having the problem with an IDE drive and you are using an IDE cable that is greater than 18 inches in length, replace the cable with one that is 18 inches or shorter in length.
  • Switch to an 80-conductor IDE cable.
  • If you have an IDE drive that is set to master (and/or is the only device on the IDE cable) ensure that it is connected to the end of the IDE cable.
  • If you are using a USB drive, please see the following KB article:
    Troubleshooting USB Drive Connection and Performance Issues



  • Ensure that your system, including any applicable drives, are not running at temperatures that exceed the manufacturer specifications.  If any temperatures are high, addtional case fans may be needed.
  • The drive may have weak sectors.  Try a thorough test with a utility provided by the drive manufacturer, with SpinRite, or with a similar utility.


If none of the above helps, the problem may be due to weak sectors on the drive surface. If the issue you are having involves a hard drive, download and run the hard drive manufacturer’s diagnostic utility or a third-party utility designed to scan and repair hard disk surfaces. Below are links to some major hard drive manufacturer’s home pages:

ExcelStor
Fujitsu
Hitachi
Seagate/Maxtor
Samsung
Seagate
Sony
Toshiba
Western Digital

If you still have not narrowed down the problem, try adjusting the system BIOS parameters below, for the drive(s) with which you are experiencing the problem. These settings, if available, are typically found under “Integrated Peripherals” or in the “Drive Configuration” section.

  • Disable “Block mode”
  • Disable “32-bit access”
  • Switch to a different PIO mode
  • Switch to a lower UDMA mode, if using UDMA

Linux root password for live session

Posted on May 9, 2011 by GoogleThem.
Categories: Linux tips and tricks.

When there is no root password for a live session in linux you can type:

sudo passwd root

Then enter a new unix password

Then type su as normal to gain root access.
su

Another way: in Debian there is no root user only type
#sudo su -

If you need root access in Ubuntu then it’s different, there is no actual root, with Ubuntu you need to do sudo, this line shows you how.

ubuntu error splicing file permission denied

Posted on December 27, 2010 by GoogleThem.
Categories: Linux tips and tricks, Windows Tips.

If you have the error on a linux system: “error splicing file permission denied” while trying to move, copy or delete a file, most likely you are trying to copy a windows encrypted file. It will not show as encrypted in linux and the permissions will look exactly as your others that do copy properly.

The best way to take care of this is to boot into windows that encrypted the file in the first place, and right click “properties”, then uncheck “encrypted”. The files will decrypt if you logged in the windows that originally encrypted it.

I had accidentally done this and the only way I noticed was the file copy error in Ubuntu, then when booting to windows, the particular folder full of files were all in green text instead of black. If they were in blue, that would mean that they are compressed.


Ubuntu Live CD root password and live session password for default user Ubuntu

Posted on December 11, 2009 by GoogleThem.
Categories: Linux tips and tricks.
sudo passwd ubuntu

Then create your password, you will need to already be in Terminal ;-)

To create a usable root user’s account on a live cd, you can set the root password then su. This has not been possible in previous versions of Ubuntu as their user model made you remember to sudo before each command requiring root access.

sudo passwd root

It’s easier just to sudo command for one time use, instead of creating a root user to su to.

As of Ubuntu 9.10, I haven’t been able to login with “demo” or “Ubuntu” as the password for live session username “Ubuntu”.

If you are running most other types of linux like Debian, Red Hat, Mepis, Suse and others, they have an actual root user with an account.

It is easier to gain root access permanently, for these other flavors of Linux click here to learn how.

If you’ve forgot your root password and need to reset it, Make Magazine has a nice writeup here:

HOWTO – reset a lost Ubuntu password

My Linux Tips

Posted on January 5, 2009 by GoogleThem.
Categories: Linux tips and tricks.

To see if you’re running Nvidia or ATI Radeon drivers in Linux:
glxgears -printfps to see framerate (Mepis 6.5)

To edit or change xorg.conf, your video card and video driver settings in linux:

Drop to CTRL-ALT-F1 if you have to.
First I backup /etc/X11/xorg.conf to xorg-backup.conf then edit the file to usually drop to a lower resolution which is the one listed for 24 bit depth.
If you really cannot deal with that, you can take your chances with the tool:
sudo dpkg-reconfigure xserver-xorg

Dialup not working with KDE, (Mepis) using kpppd?
If your prompt says “The pppd daemon died unexpectedly!”

I solved it by going to /etc/ppp/peers/kppp options.txt and replacing #noauth with noauth (ie Delete the #) and all is now good. Hope this helps others

If you still cannot connect, you can try these:
1) open etc/ppp/peers/kppp-options and remove the # in front
of noauth if it is there.
2) open etc/ppp/pap-secrets and make sure your isp username
and password are there, again with no # in front of the line.
3) open etc/ppp/peers/provider and first make sure the correct
modem is listed, mine is on com port 2 so my line reads
/dev/ttyS1. Then this is the biggie because this line was very
wrong on mine. The chat script line should read :
connect “/usr/sbin/chat -v -f /etc/ppp/peers/provider”
That should do it.
By the way when putting settings in kppp (click configure button)
i used PAP and CR/LF and CRTSCTS and 115200 and /dev/ttyS1(which in
my case is com port 2).

Also do not use lock and if you really have to, change everything logged in as root.

Linux Command Line – quick list

Posted on December 19, 2008 by GoogleThem.
Categories: Linux tips and tricks.

Linux Commands:

ls - list contents of a directory sudo - "substitute user" (grants administrator rights)
sudo -i – login as superuser or admin or root
cd - change directory
aptitude - APT package management system (update, install, remove, search)
clear - clear screen
chmod - change file access permissions
chown - change file and group ownership
cp - copy


du -h - size of directory, h for human readable kbytes

grep - search (used as a pipe most often)

  • ex: cat example.php | grep -i cookie

ifconfig - shows IP address and other info about all interfaces including ethernet and wireless (may need /sbin/ifconfig if you are not logged in as root)

mv - move
rm - remove
cat - concatenate files (dump to screen)

  • ex: cat example.php | grep -i cookie

nano - basic text editor
vi - advanced text editor
fdisk - partition table manipulator (fdisk for windows and linux are different, their commands are unique to each platform!)

  • ex: fdisk -l (list all drives)

df - disk free (remaining / used disk space) (df reports space used)
users - users currently logged in
useradd - add a user
usermod - modify existing user
uname - show system data (try uname -a)
mount - mount a file system, cd or removable drive

netstat -tpe (-t show only TCP connections, -p show PID/name, -e extra info)
umount – un-mount a file system, cd or removable drive

top - show current running processes
touch - create new, empty, filereboot - reboot your system

shutdown - shutdown your system
passwd - change user password
ping - ping a network device or location (ping google.com)
more - show output one screen at a time
exit - logout of the terminal
eject - eject a cdrom or removable device

tar cvzf foo.tgz cps100
will tar the directory cps100 (and its files/subdirectories) into a tar file named foo.tgz.

To tar all .cc and .h files into a tar file named foo.tgz use:
tar cvzf foo.tgz *.cc *.h

find . -iname ‘filetofind.htm’

In Linux to create a playlist with all the *.mp3, *.wav, *.ogg and *.wma in the current folder (and all subfolders) use the command:

find . -iname '*' -print | sed -n -E -e 's/.*mp3/&/p' -e 's/.*wav/&/p' -e 's/.*ogg/&/p' -e 's/.*wma/&/p' > playlist.m3u

or this one:

find . -iregex '.*\.\(mp3\|wav\|ogg\|wma\)' -print > playlist.m3u

Linux Backup MBR – Master Boot Record

Posted on November 25, 2008 by GoogleThem.
Categories: Linux tips and tricks.

Backup and Restore Hard drive partitions and MBR.

This does the partition map only, not the actual partition data. To do entire drives or partitions use dd to backup and restore entire hard drives or clone drive.

* To backup use:
sudo dd if=/dev/hda of=mbr.backup bs=512 count=1
* To restore use:
sudo dd of=/dev/hda if=mbr.backup bs=512 count=1

Caution the MBR contains the partition table (the first four primary entries) it will break things if you changed the partition since the backup.

If you do not want to restore the partition table you should use sudo dd of=/dev/hda if=mbr.backup bs=446 count=1 instead. This will write only the first 446 bytes of the MBR leaving the last 64 bytes intact (4 partition table entries * 16 bytes/entry). You can restore an MBR even from a backup that has all 512 bytes just by specifying 446 on the restore operation!

Be warned that you may not be able to boot from this disk if you changed the partition table after the backup of the MBR, depending on the actual boot loader .

Click here If you want to linux disk backup dd.

Formatting a USB thumbdrive back to original using Linux fdisk command line

Posted on by GoogleThem.
Categories: Linux tips and tricks.

If you like Linux command line tools, fdisk is a good one for partitioning and formatting USB memory sticks, aks thumbdrives. This works for windows formatted thumbdrives as well.

WARNING: This process will delete any information that is currently stored on the USB key. Proceed with caution! When you Fdisk thumb drive you are likely to delete the entire USB thumb drive. You are in effect “formatting usb memory sticks”.

Reverting your USB key back to it’s original state:

A.) First we need to delete the old partitions that remain on the USB key.

1. Open a terminal and type sudo su
2. Type fdisk -l and note your USB drive letter.
3. Type fdisk /dev/sdX (replacing X with your drive letter)
4. Type d to proceed to delete a partition
5. Type 1 to select the 1st partition and press enter
6. Type d to proceed to delete another partition (fdisk should automatically select the second partition)

B.) Next we need to create the new partition.

1. Type n to make a new partition
2. Type p to make this partition primary and press enter
3. Type 1 to make this the first partition and then press enter
4. Press enter to accept the default first cylinder
5. Press enter again to accept the default last cylinder
6. Type w to write the new partition information to the USB key
7. Type umount /dev/sdX (replacing X with your drive letter)

C.) Lastly we need to create the fat filesystem.
For FAT16!
1. Type mkfs.vfat -F 16 /dev/sdX1 (replacing X with your USB key drive letter)

That’s it, you should now have a restored USB thumb drive with a single fat 16 partition that can be read from any computer.

Stop SOPA