Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Linux Timesaving Techniques For Dummies.pdf
Скачиваний:
59
Добавлен:
15.03.2015
Размер:
15.98 Mб
Скачать

Popping the Cork: Speeding Up WINE with /proc 175

icmp_echo_ignore_broadcasts: Enabling this variable tells your system to ignore broadcast pings, which can help spare you from denial-of- service attacks.

log_martians: Enable this variable to tell the kernel to send a message to the system log when an illegally addressed packet is received. After setting this variable, monitor the syslog files (see Technique 41) to find out if you’re receiving nasty packets.

accept_redirects: Disable this variable to help prevent man-in-the-middle attacks. Turning off accept_redirects tells your system to prevent outgoing packets from being redirected. Hackers can’t grab your outbound packets looking for sensitive information (such as passwords or credit card numbers).

You can change many variables to affect the state of your kernel. Some of the variables work like on/off switches. To turn on a variable (or enable the variable), echo a 1 to it in the startup script. To turn a variable off (or disable the variable), echo a 0 to it in the startup script. Variables that control time settings or cache sizes are manipulated with integer values.

You can find many good resources on the Web that list kernel variables and what they control. Google for /proc/sys variables, and you’ll get dozens of hits that will help you find good settings for your system.

Popping the Cork: Speeding Up WINE with /proc

If you use WINE in your daily life and want a quicker way to start your programs, using the files in /proc can help.

If you’re not familiar with WINE (the program, not the beverage), it’s a package that lets you run Windows programs on Linux machines.

The abbreviation WINE stands for Wine Is Not

an Emulator. WINE doesn’t emulate Windows machines, but it runs their programs in a Linux environment.

Normally, to start a program with WINE, you need to preface the command with wine. With a simple change to the startup file, you can run a Windows program simply by typing its name, just like the Linux programs on your system.

To simplify the startup of your Windows programs in Fedora or Mandrake, follow these steps:

1. Open a terminal window and give yourself superuser privileges with the su command.

2. Move to the /etc/rc.d directory:

#cd /etc/rc.d

3.Open the rc.local file with your favorite editor:

#kedit rc.local

4.Add the following commands to the end of the file:

modprobe binfmt_misc

echo ‘:Wine:M::MZ::/usr/local/bin/ wine:’ > /proc/sys/fs/binfmt_misc/ register

5.Save your work and exit the editor.

6.Reboot your system to make the changes take effect.

If you’re a SuSE user, you can add similar code to your boot script. To simplify the startup of your Windows programs in SuSE, follow these steps:

1. Open a terminal window and give yourself superuser privileges with the su command.

2. Move to the /etc/init.d directory:

#cd /etc/init.d

3.Open the boot.local file with your favorite editor:

#kedit boot.local

176 Technique 26: Finding Out about Your System with /proc

4. Add the following commands to the end of the file:

modprobe binfmt_misc

echo ‘:Wine:M::MZ::/usr/local/bin/ wine:’ > /proc/sys/fs/binfmt_misc/ register

5. Save your work and exit the editor.

6. Reboot your system to make the changes take effect.

The preceding steps change the boot script that is executed at boot time. The two lines shown in Step 4 tell Linux to automatically recognize Microsoft Windows programs and execute them with wine. For example, to play Minesweeper, you can simply type the command ./winmine.exe.

When you make this change, you don’t have to remember to type wine before entering the program name. This also makes it easier to include Windows programs on menus and shortcuts.

Part V

Securing Your

Workspace

Соседние файлы в предмете Операционные системы