Tips and Tricks
Windows
Greek Spell Checking for the Mozilla and Mozilla Thunderbird email clients
In order to have Greek spell checking for the previously mentioned clients ( Mozzila mail, and Mozzila Thunderbird Mail) go to ftp://ftp.cs.ucy.ac.cy/pub/Windows/Thunderbird/Greek_Dictionary/ and download the el.aff and el.dic
Save the downloaded files in the following locations:
- For Mozilla mail in C:\Program Files\mozilla.org\Mozilla\components\myspell
- For Thunderbird in C:\Program Files\Mozilla Thunderbird\components\myspell
--- nsc
Start/stop Windows services remotely
Use the command sc to enable and start the service: --- Tmaria
sc \\hostname config <servicename> start= auto
sc \\hostname start <servicename>
Use the command sc to disable and stop the service:
sc \\hostname config <servicename> start= disabled
sc \\hostname stop <servicename>
To initiate immediate contact between a client computer and WSUS server
On the client computer, at the command prompt, type
wuauclt.exe /detectnow This will force the client computer to initiate contact to WSUS, and appear in WSUS console
To remove Software Restriction Group policies settings on windows XP pcs
When users can not logon when wrong Software Restriction group policies have been set-up on DC you can follow the next steps to solve the problem: Reboot the pc in safe mode Run regedit and delete the subkeys of HKLM\Software\Policies\Microsoft\Windows\Safer
How to move folders and files on WindowsXP/2000/2003 and retain security permissions (useful when moving profiles dirs)
Use robocopy command from windows 2003 Resource Kit Tools. The syntax is : robocopy <source> <destination> /e /move /copyall Check [1] for all command options
How to install network printer for all users on windows machines
Execute the command from a windows server. Using the above command, will also install the network printer for all users. Use the tool \\kalliopi\sys-data\Windows\Tools\addglobalprinterremotely.cmd. The syntax of the command is: addglobalprinterremotely.cmd <remotemachinename> <printservername>\<printersharename>
Linux
mount -t smbfs -o username=<YOUR_USERNAME>,workgroup=CS-UCY-AC-CY //<WINDOWS_MACHINE_NAME>/SHARED_FOLDER /PATH/TO/YOUR/MOUNTPOINT
Reclaiming free space after deleting log files
If a filesystem is full (for example /var) and you delete some log files in order to make some room on the filesystem, you observe that the space does not appear to be there when running the
df command.
The solution to this is to restart the application which is using the log files deleted. e.g: if you delete an apache log file then you should restart the httpd service.
% service httpd restart will do the trick nsc
Typing Greek in Linux Fedora Core 4 (changing the keyboard maping to greek 319)
First of all download this file from the UCY CS Dept. ftp server [2] ... This file contains some files...We are interested on the two of them: el319 and en319! You have to put them in the following folder(be sure you are logged in as a superuser). So lets start : Extract the contents of the package in a folder
tar -xvf gr319kb.tar.bz2
and copy those two files in the /etc/X11/xkb/symbols/pc/ folder... you can run the following commands from that folder:
cp el319 /etc/X11/xkb/symbols/pc/el319
cp en319 /etc/X11/xkb/symbols/pc/en319
(After that if you want to load those key-maps you can type :setkeymap el319 (or en 319) in order to have the mapping you need...(NOT RECOMENDED))
If you want to have the mapping loaded in the system by default and switch between mappings with alt-shift you have to make some changes to the file /etc/X11/xorg.conf . So , open that file with an editor and find the line that describes the keyboard mapping configuration...That should be under the Section "InputDevice". After all those comments we have to change(or/and add) some lines and make them look like this:
...
Section "InputDevice"
...
Identifier "Keyboard0"
Driver "kbd"
Option "XkbModel" "pc104"
Option "XkbLayout" "en319,el319"
Option "XkbOptions" "grp:alt_shift_toggle,grp_led:scroll"
EndSection
...
change everything that needs to be changed in those lines and save the file...
Restart the X server(or the computer) and the new configuration will be loaded. From that time you can change the keyboard layout by pressing alt-shift(just like windows!).
NOTE:After the restart you will be asked to use: gnome or X configuration...Be sure you choose the X configuration!
Variable Indirection in csh scripting
Although the csh (and therefore? tcsh) are considered not to support variable indirection as bash does with the use of the (!) exclamation mark, the following command does the trick nsc set temp=`eval echo \$${x}`
bash example $a=x $x="Hello There" $echo $a x $echo $!x Hello There $
tcsh example %set a=x %set x="Hello There" %echo $a x %eval echo \$$x Hello There %set tmp=`eval echo \$$x` %echo $tmp Hello There
Seting extented permissions for OPNET directories
The following commands must be used in order to give rwx permissions to Mylonas for the opnet directories
/usr/bin/setfacl -d --set u:<USERNAME>:rwx,m:rwx /path/to/<USERNAME> /usr/bin/setfacl -m u:mylonasy:rwx /path/to/<USERNAME> /usr/bin/setfacl -d -m u:mylonasy:rwx,m:rwx /path/to/<USERNAME>
How to allow XDMCP run on linux server
In order to allow other clients to connect to a linux machine, by X-win, the following steps should be followed:
1. /etc/X11/xdm/Xaccess file:uncomment the line that allows all host to get a login window. 2. /etc/X11/xdm/xdm-config file:comment out (with !) the last line which contains DisplayManager.RequestPort:0 3. Enable [XDMCP] service from /etc/X11/gdm/gdm.conf (/etc/gdm/custom.conf for FC5 kekkos) and /etc/kde/kdm/kdmrc files. The required changes in the custom.conf file are:
[daemon] RemoteGreeter=/usr/libexec/gdmgreeter
[xdmcp] Enable=true
If you are too lazy to edit the file then go to System->Administration->Login Screen->Remote-> and set Style to "Same as local" 5. Reboot the machine
How to rip (create) an ISO image from a normal CD
In order to create an ISO image from a any normal CD go to any Linux machine and do:
dd if=/dev/cdrom of=<my_cd_image.iso> where <my_cd_image.iso> is the ISO file name you are creating.
This assumes that your cd drive is called /dev/cdrom
To test that you have actually created an ISO image do:
mount -t iso9660 -o ro,loop <my_cd_image.iso> /mnt/cdrom cd /mnt/cdrom
List the files in the ISO image. You should get a listing of the CD files in the ISO image.
Starting Condor on the linux rack servers
For the condor to run correctly one must start it first on cs919
to start condor type: /usr/local/condor/sbin/condor_master
on some machines the executable is under /usr/local/condor/
Check that condor is running on cs919 condor_status and then
start it on the rest of the machines using the same command
The list of the machines follows:
cs918, cs919, cs920, cs921, cs922, cs1417, cs1418, cs1419,
areti, ikaros, olympia, cs974, cs976, cs977, cs978, cs979, cs980,
cs981, cs982, cs983, cs984, cs985, cs986, cs987, cs988, cs989,
cs990, cs991, cs992
General
Handling multiple messages in pine.
In order to handle multiple messages at once using pine, you first have to enable the aggregate commands: Setup<S> -> Config<C> and check the enable-aggregate-command-set option as shown in Figure 1
.
This option adds: a Select command (;) to select messages by various criteria (From, Subject, Date, etc); a Select Cur (:) to select the current message; an Apply command (A) to apply commands such as Save(S), to save all Selected messages; and Zoom (Z) to restrict the messages shown in the Folder Index to just the selected ones; and Del (D) to delete all Selected messages.
Open the folder you want to handle and click the semicolon (;) Select the messages you want to handle by any criteria that you like, {e.g.: if you want to select a range of message type (N) and then the range (1-1000) and hit enter} then hit (A) and select the command you would like to apply to them{e.g.: (D) To delete the selected messages (X) after (D) will also expunge the messages}.
Out of the office or going on vacation
- ssh to any Unix/Linux Machine and create a file called .forward
The file should have the following line
\username, "|/usr/bin/vacation -t## username"
where username is your login name and ## is the number of days before sending the vacation mesage to the same recipient again.
- Enjoy your vacation
- Once you return back delete the .forward file or move it to a different name to stop sending vacation messages