Ubuntu root
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.
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.
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
Hard faults/sec in Windows 7 Resource Manager too many! »« Unpredictable drive errors
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
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:
If the memory diagnostic does not report any errors, check the following:
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 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.
Apache httpd.conf – ServerSignature Off ServerTokens Prod »« Linux root password for live session
When there is no root password for a live session in linux you can type:
sudo passwd root
Then enter a new unix password
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.
Unpredictable drive errors »« Windows 7 taking too much space, how to cleanup the winsxs folder and reduce hard drive usage
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.
Does google count cached page hits in my analytics? »« Advanced SEO overview:
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.
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
Email bounces – creating SPF records and rDNS »« Cannot see other computers on network
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 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!)
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
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.
My css tips and tricks »« Formatting a USB thumbdrive back to original using Linux fdisk command line
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.
Linux Backup MBR – Master Boot Record »« Maximum Page Title length