| ||||||||
Line: 160 to 160 | ||||||||
---|---|---|---|---|---|---|---|---|
Filenames can have spaces in them! | ||||||||
Added: | ||||||||
> > |
XEmacs To get rid of that annoying flashing when making a mistake in XEmacs: M-x
set-variable
visible-bell
Value: nil
| |||||||
|
| ||||||||
Line: 116 to 116 | ||||||||
---|---|---|---|---|---|---|---|---|
procps-2.0.7-11.21AS.4
| ||||||||
Added: | ||||||||
> > |
To list the files in an uninstalled package:
rpm -qpl packagename.rpm | |||||||
Vim |
| ||||||||
Line: 150 to 150 | ||||||||
---|---|---|---|---|---|---|---|---|
Renaming a large number of hidden files | ||||||||
Changed: | ||||||||
< < |
The following command searches the current directory, recursively, for all hidden mp3 files, renaming them with a .blah suffix:
| |||||||
> > |
The following command searches the current directory, recursively, for all hidden mp3 files, appending a .blah suffix:
| |||||||
find . | egrep "/\..*mp3$" | while read e ; do mv "$e" "$e.blah"; done
|
| ||||||||
Line: 146 to 146 | ||||||||
---|---|---|---|---|---|---|---|---|
Note: your device might be mounted somewhere other than /dev/sda .
| ||||||||
Added: | ||||||||
> > |
Renaming a large number of hidden files The following command searches the current directory, recursively, for all hidden mp3 files, renaming them with a .blah suffix:
find . | egrep "/\..*mp3$" | while read e ; do mv "$e" "$e.blah"; done
Filenames can have spaces in them!
| |||||||
|
| ||||||||
Line: 136 to 136 | ||||||||
---|---|---|---|---|---|---|---|---|
du -h --max-depth=1
| ||||||||
Added: | ||||||||
> > |
Prolong the life of your external USB drive I have an external usb powered hard drive (one of these) connected to my server permanently, as part of my backup solution. To prolong the life of the disk, I spin it down after my overnight using the following command: sdparm --command=stop /dev/sda
Note: your device might be mounted somewhere other than /dev/sda .
| |||||||
|
| ||||||||
Line: 128 to 128 | ||||||||
---|---|---|---|---|---|---|---|---|
:set ff?
| ||||||||
Added: | ||||||||
> > |
du Lists the size of each directory/file in the current directory, and prints the sizes in human readable form: du -h --max-depth=1
| |||||||
|
Generate random numbers on linux: | ||||||||
Changed: | ||||||||
< < |
dd if=/dev/urandom bs=1 count=128 | od -x | |||||||
> > |
dd if=/dev/urandom bs=1 count=128 | od -x
| |||||||
Solaris: | ||||||||
Changed: | ||||||||
< < |
psrinfo -v lists the processors on a box | |||||||
> > |
psrinfo -v
lists the processors on a box
| |||||||
| ||||||||
Line: 121 to 124 | ||||||||
---|---|---|---|---|---|---|---|---|
:set ff=unix
| ||||||||
Changed: | ||||||||
< < |
To find out what format a files is: | |||||||
> > |
To find out what format a file is: | |||||||
:set ff?
|
| ||||||||
Line: 113 to 113 | ||||||||
---|---|---|---|---|---|---|---|---|
procps-2.0.7-11.21AS.4
| ||||||||
Added: | ||||||||
> > |
Vim Setting a text file to unix format from DOS using vim: :set ff=unix
To find out what format a files is:
:set ff?
| |||||||
|
| ||||||||
Line: 101 to 101 | ||||||||
---|---|---|---|---|---|---|---|---|
Mon Jan 2 09:24:03 2006
| ||||||||
Added: | ||||||||
> > |
RPM To check the version of an installed rpm package, use the following command (this example looks at procps, which includes the ps command): rpm -qa | grep procps
returns:
procps-2.0.7-11.21AS.4
| |||||||
|
| ||||||||
Line: 89 to 89 | ||||||||
---|---|---|---|---|---|---|---|---|
Note, no need to use xhost + . The above solution is much more secure, both for client and server. All communication is authenticated and encrypted. And you don't have to set/export your display on the client (debian)!
| ||||||||
Added: | ||||||||
> > |
awk To print a timestamp (UTC) in a locale readable string do the following: echo "1136211843" | awk '{print strftime("%c", $1)}'
prints:
Mon Jan 2 09:24:03 2006
| |||||||
|
| ||||||||
Line: 19 to 19 | ||||||||
---|---|---|---|---|---|---|---|---|
My backup drive, a Western Digital usb hard drive, had a vfat file system - which I found didn't preserve file permissions. | ||||||||
Changed: | ||||||||
< < |
The following describes how to convert from vfat to an ext3 file system. Remember, if you follow these instructions all your existing data will be erased. Be sure, be very sure you want to re-format your existing drive. | |||||||
> > |
The following describes how to convert from vfat to an ext3 file system. Remember, if you follow these instructions all your existing data will be erased. Be sure, be very sure you want to re-format your existing drive. | |||||||
Here goes... | ||||||||
Changed: | ||||||||
< < |
When you plug the drive in check dmesg to find out which /dev device it's been mapped to. I found mine under /dev/sda1. | |||||||
> > |
When you plug the drive in check dmesg to find out which /dev device it's been mapped to. I found mine under /dev/sda1.
| |||||||
Then you'll need to partition the disk: | ||||||||
Changed: | ||||||||
< < |
fdisk /dev/sda1 | |||||||
> > |
fdisk /dev/sda1
| |||||||
Changed: | ||||||||
< < |
This will give you a command prompt interface. Type p to get a list of the current partitions. | |||||||
> > |
This will give you a command prompt interface. Type p to get a list of the current partitions.
| |||||||
Changed: | ||||||||
< < |
I had 4 partitions, so I deleted them all using the d command. | |||||||
> > |
I had 4 partitions, so I deleted them all using the d command.
| |||||||
Changed: | ||||||||
< < |
Then create your partition(s). I created one great big extended partition using the n command. It asks you a few questions about block sizes etc, I chose the defaults. | |||||||
> > |
Then create your partition(s). I created one great big extended partition using the n command. It asks you a few questions about block sizes etc, I chose the defaults.
| |||||||
Changed: | ||||||||
< < |
Then I typed w to write the partition data to the disk. Then I quit fdisk. | |||||||
> > |
Then I typed w to write the partition data to the disk. Then I quit fdisk.
| |||||||
Then I created the filesystem: | ||||||||
Changed: | ||||||||
< < |
mkfs.ext3 /dev/sda1 | |||||||
> > |
mkfs.ext3 /dev/sda1
| |||||||
It asked me a few questions, I excepted all the defaults. Then you're ready to mount the device: | ||||||||
Changed: | ||||||||
< < |
mount /dev/sda1 /mnt/usbdrive | |||||||
> > |
mount /dev/sda1 /mnt/usbdrive
| |||||||
You'll have to create the folder /mnt/usbdrive yourself. So that the disk gets mounted on reboot add the following line to /etc/fstab: | ||||||||
Changed: | ||||||||
< < |
/dev/sda1 /mnt/usbdrive ext3 defaults 0 0 | |||||||
> > |
/dev/sda1 /mnt/usbdrive ext3 defaults 0 0
| |||||||
This also means you can simply type: | ||||||||
Changed: | ||||||||
< < |
mount /dev/sda1 | |||||||
> > |
mount /dev/sda1
| |||||||
when mounting the disk from the command line. | ||||||||
Line: 85 to 85 | ||||||||
How to run x windows apps using X11 forwarding.
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Note, no need to use xhost + . The above solution is much more secure, both for client and server. All communication is authenticated and encrypted. And you don't have to set/export your display on the client (debian)!
|
| ||||||||
Line: 85 to 85 | ||||||||
---|---|---|---|---|---|---|---|---|
How to run x windows apps using X11 forwarding.
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Changed: | ||||||||
< < |
Note, no need to use xhost + . The above solution is much more secure, both for client and server. All communication is authenticated and encrypted. And you don't have to set/export your display on the client!
| |||||||
> > |
Note, no need to use xhost + . The above solution is much more secure, both for client and server. All communication is authenticated and encrypted. And you don't have to set/export your display on the client (debian)!
| |||||||
|
| ||||||||
Line: 82 to 82 | ||||||||
---|---|---|---|---|---|---|---|---|
X11 | ||||||||
Changed: | ||||||||
< < |
I'm going to explain how I run x windows applications on my linux box (x client), displayed on my powerbook (x server), via X11 forwarding. | |||||||
> > |
How to run x windows apps using X11 forwarding. | |||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Changed: | ||||||||
< < |
Note, no need to use xhost + . The above solution is much more secure, both for client and server. All communication is authenticated and encrypted.
| |||||||
> > |
Note, no need to use xhost + . The above solution is much more secure, both for client and server. All communication is authenticated and encrypted. And you don't have to set/export your display on the client!
| |||||||
|
| ||||||||
Line: 78 to 78 | ||||||||
---|---|---|---|---|---|---|---|---|
According to testdisk my partition was situated at the 63rd cylinder -> 63 * 512 (assuming 512 bytes per block) = 32256 bytes. | ||||||||
Added: | ||||||||
> > |
X11 I'm going to explain how I run x windows applications on my linux box (x client), displayed on my powerbook (x server), via X11 forwarding.
xhost + . The above solution is much more secure, both for client and server. All communication is authenticated and encrypted.
| |||||||
|
| ||||||||
Line: 78 to 78 | ||||||||
---|---|---|---|---|---|---|---|---|
According to testdisk my partition was situated at the 63rd cylinder -> 63 * 512 (assuming 512 bytes per block) = 32256 bytes. | ||||||||
Added: | ||||||||
> > |
|
| ||||||||
Line: 19 to 19 | ||||||||
---|---|---|---|---|---|---|---|---|
My backup drive, a Western Digital usb hard drive, had a vfat file system - which I found didn't preserve file permissions. | ||||||||
Changed: | ||||||||
< < |
The following describes how to convert from vfat to an ext3 file system. Remember, if you follow these instructions all your existing data will be erased. Be sure, be very sure, you want to re-format your existing drive. | |||||||
> > |
The following describes how to convert from vfat to an ext3 file system. Remember, if you follow these instructions all your existing data will be erased. Be sure, be very sure you want to re-format your existing drive. | |||||||
Here goes... | ||||||||
Line: 59 to 59 | ||||||||
when mounting the disk from the command line. | ||||||||
Changed: | ||||||||
< < |
This link is useful. | |||||||
> > |
This link was useful.
Recovering a screwed NTFS disk I created an image file from the corrupt disk using dd -> dd if=/dev/hdd of=imagename.img conv=noerror I wanted to use an image file so that I could mess around without harming the data on the original corrupt disk. I used testdisk to restore the image file's partition information (follow interactive menu system). I was then able to mount the disk: mount -t ntfs imagename.img /mnt/restoredntfs -o loop,offset=32256 Becasue I was mounting from an image file, I had to mount to a loop device. Thanks NASA, apparently. According to testdisk my partition was situated at the 63rd cylinder -> 63 * 512 (assuming 512 bytes per block) = 32256 bytes. | |||||||
| ||||||||
Line: 19 to 19 | ||||||||
---|---|---|---|---|---|---|---|---|
My backup drive, a Western Digital usb hard drive, had a vfat file system - which I found didn't preserve file permissions. | ||||||||
Changed: | ||||||||
< < |
The following describes how to convert from vfat to an ext3 file system. Remember, if you follow these instructions all your existing data will be erased. Be sure, be very sure, you want to re-format your existing drive. | |||||||
> > |
The following describes how to convert from vfat to an ext3 file system. Remember, if you follow these instructions all your existing data will be erased. Be sure, be very sure, you want to re-format your existing drive. | |||||||
Here goes... |
| ||||||||
Line: 13 to 13 | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Changed: | ||||||||
< < |
Re-format external USB hard-drive | |||||||
> > |
Re-format external USB hard drive (Debian) | |||||||
Motive: I wanted a backup solution that preserved file permissions when using rsync with the -a option. | ||||||||
Changed: | ||||||||
< < |
My Western Digital usb drive had a vfat file system - which doesn't preserve file permissions. | |||||||
> > |
My backup drive, a Western Digital usb hard drive, had a vfat file system - which I found didn't preserve file permissions. | |||||||
Changed: | ||||||||
< < |
This is what you'll need to do in order to convert to an ext3 file system: | |||||||
> > |
The following describes how to convert from vfat to an ext3 file system. Remember, if you follow these instructions all your existing data will be erased. Be sure, be very sure, you want to re-format your existing drive. Here goes... | |||||||
When you plug the drive in check dmesg to find out which /dev device it's been mapped to. I found mine under /dev/sda1. | ||||||||
Line: 31 to 33 | ||||||||
I had 4 partitions, so I deleted them all using the d command. | ||||||||
Changed: | ||||||||
< < |
Then create a your partition(s). I created 1 great big extended partition using the n command. It asks you a few questions about block sizes etc, I chose the defaults. | |||||||
> > |
Then create your partition(s). I created one great big extended partition using the n command. It asks you a few questions about block sizes etc, I chose the defaults. | |||||||
Then I typed w to write the partition data to the disk. Then I quit fdisk. | ||||||||
Line: 53 to 55 | ||||||||
This also means you can simply type: | ||||||||
Changed: | ||||||||
< < |
mount /dev/sda1 | |||||||
> > |
mount /dev/sda1 | |||||||
when mounting the disk from the command line. | ||||||||
Added: | ||||||||
> > |
This link is useful. |
| ||||||||
Line: 11 to 11 | ||||||||
---|---|---|---|---|---|---|---|---|
Solaris: psrinfo -v lists the processors on a box | ||||||||
Added: | ||||||||
> > |
Re-format external USB hard-drive Motive: I wanted a backup solution that preserved file permissions when using rsync with the -a option. My Western Digital usb drive had a vfat file system - which doesn't preserve file permissions. This is what you'll need to do in order to convert to an ext3 file system: When you plug the drive in check dmesg to find out which /dev device it's been mapped to. I found mine under /dev/sda1. Then you'll need to partition the disk: fdisk /dev/sda1 This will give you a command prompt interface. Type p to get a list of the current partitions. I had 4 partitions, so I deleted them all using the d command. Then create a your partition(s). I created 1 great big extended partition using the n command. It asks you a few questions about block sizes etc, I chose the defaults. Then I typed w to write the partition data to the disk. Then I quit fdisk. Then I created the filesystem: mkfs.ext3 /dev/sda1 It asked me a few questions, I excepted all the defaults. Then you're ready to mount the device: mount /dev/sda1 /mnt/usbdrive You'll have to create the folder /mnt/usbdrive yourself. So that the disk gets mounted on reboot add the following line to /etc/fstab: /dev/sda1 /mnt/usbdrive ext3 defaults 0 0 This also means you can simply type: mount /dev/sda1 when mounting the disk from the command line. |
| ||||||||
Line: 8 to 8 | ||||||||
---|---|---|---|---|---|---|---|---|
dd if=/dev/urandom bs=1 count=128 | od -x
| ||||||||
Added: | ||||||||
> > |
Solaris: psrinfo -v lists the processors on a box |
| ||||||||
Added: | ||||||||
> > |
Linux tcp tuning: http://www-didc.lbl.gov/TCP-tuning/linux.html
| |||||||
Generate random numbers on linux: dd if=/dev/urandom bs=1 count=128 | od -x |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Added: | ||||||||
> > |
|