Getting Citrix to work on Linux can be tricky - specially since there is no official 64bit client for Linux. However, with a bit of tweaking, it can be made to work. Here's how:
1. Download the Citrix client from the website http://www.citrix.com/English/SS/downloads/details.asp?downloadID=3323&productID=-1 . The current version as of this writing is version 11.100
2. Install the OpenMotif libraries
sudo yum install openmotif openmotif-devel
3. Next we need to install the 32 bit version of libXaw.
sudo yum install libXaw.i686
4. Now install the client. Change directory to the location where the client was downloaded and run:
tar xvf linuxx86-11.100.158406.tar.gz
sudo ./setupwfc
5. Follow the onscreen instructions to install the client. I installed client at /usr/lib/ICAClient and disabled Gnome and KDE integration as well as USB support.
6. Restart the browser if it was already open and navigate to your Citrix site. When the browser prompts to download the .ica file, select open with /usr/lib/ICAClient/wfica and you should be able to see your remote desktop on screen.
7. Alternatively, download the .ica file and run /usr/lib/ICAClient/wfica /path/to/my.ica (Replace /path/to/my.ica with the real path to your ica file.
Showing posts with label System Admin. Show all posts
Showing posts with label System Admin. Show all posts
Thursday, 4 March 2010
Saturday, 28 November 2009
Hosing the dual boot and recovering from it
I recently installed Fedora 12 in a PC that came pre-installed with Vista. Usually, Windows XP and even Windows 7 is happy to get loaded by Grub - so I went ahead and installed Grub as the default bootloader. Everything went fine until I tried to reboot back to Vista and got the following error message:
I followed many articles in the internet that all advocated using either the Vista startup recovery tools or the command prompt but none worked. So for posterity here's how I fixed the issue:
1. Boot the computer using a Vista CD
2. Select the Language and Keyboard layout from the first screen and click Next.
3. Click on Repair your computer in the next screen.
4. Select your Vista installation from the dialog box and click next.
5. Click on Command Prompt to start a new command prompt
6. Type the following command:
bootrec /FixMbr
7. Type exit to close the command prompt. Then hit the Reboot button.
8. The computer should now boot back to Vista..hurrah! but where's the Fedora installation?
9. Pop the Fedora DVD in to the drive and reboot the computer
10. Select the Rescue option from the Fedora DVD boot menu
11. The installer will prompt you with a few questions (Which unfortunately I can't remember now). They are fairly obvious and simple questions so there should be no issue in getting past them.
12. Finally the installer will mount your Fedora installation into /mnt/sysimage and provide you with a menu to start a shell or reboot. Select the option to start the shell.
13. Run the following command to see a list of partitions:
fdisk -l
14. You have to figure out the device path of your Linux partition. This is usually where /boot is mounted or if you don't have a separate boot partition, where / is mounted. In my case it was /dev/sda5
15. Run grub-install with the correct device path to install Grub in the Linux partition.
grub-install /dev/sda5
16. Now exit the shell and reboot the computer. (Remove the Fedora disk from the drive to prevent booting from the CD)
17. You will boot back to Vista.
18. Download and install EasyBCD (http://neosmart.net/dl.php?id=1)
19. Run EasyBCD and click on Add Remove Entries
20. Click on the Linux tab and select the drive where Grub was installed from the Drive drop-down. You can optionally change the name from "NeoSmart Linux" to "Fedora" if you like.
21. Click Add Entry to save the entry.
22. Restart the computer. You should now be presented with a boot menu. Select the Fedora option (If you named it Fedora in the previous step) and Fedora should boot up!
BOOTMGR is missing. Press Ctrl+Alt+Del to restart.
I followed many articles in the internet that all advocated using either the Vista startup recovery tools or the command prompt but none worked. So for posterity here's how I fixed the issue:
1. Boot the computer using a Vista CD
2. Select the Language and Keyboard layout from the first screen and click Next.
3. Click on Repair your computer in the next screen.
4. Select your Vista installation from the dialog box and click next.
5. Click on Command Prompt to start a new command prompt
6. Type the following command:
bootrec /FixMbr
7. Type exit to close the command prompt. Then hit the Reboot button.
8. The computer should now boot back to Vista..hurrah! but where's the Fedora installation?
9. Pop the Fedora DVD in to the drive and reboot the computer
10. Select the Rescue option from the Fedora DVD boot menu
11. The installer will prompt you with a few questions (Which unfortunately I can't remember now). They are fairly obvious and simple questions so there should be no issue in getting past them.
12. Finally the installer will mount your Fedora installation into /mnt/sysimage and provide you with a menu to start a shell or reboot. Select the option to start the shell.
13. Run the following command to see a list of partitions:
fdisk -l
14. You have to figure out the device path of your Linux partition. This is usually where /boot is mounted or if you don't have a separate boot partition, where / is mounted. In my case it was /dev/sda5
15. Run grub-install with the correct device path to install Grub in the Linux partition.
grub-install /dev/sda5
16. Now exit the shell and reboot the computer. (Remove the Fedora disk from the drive to prevent booting from the CD)
17. You will boot back to Vista.
18. Download and install EasyBCD (http://neosmart.net/dl.php?id=1)
19. Run EasyBCD and click on Add Remove Entries
20. Click on the Linux tab and select the drive where Grub was installed from the Drive drop-down. You can optionally change the name from "NeoSmart Linux" to "Fedora" if you like.
21. Click Add Entry to save the entry.
22. Restart the computer. You should now be presented with a boot menu. Select the Fedora option (If you named it Fedora in the previous step) and Fedora should boot up!
Thursday, 1 January 2009
Fixing Bluetooth and PackageKit problems in Fedora 10
I began to suspect that something was wrong with the D-BUS permissions on my Fedora 10 system when I started getting the following error at the end of a Yum session:
ERROR:dbus.proxies:Introspect error on :1.46:/org/freedesktop/PackageKit: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: A security policy in place prevents this sender from sending this message to this recipient, see message bus configuration file (rejected message had interface "org.freedesktop.DBus.Introspectable" member "Introspect" error name "(unset)" destination ":1.46")
This seemed to have affected the Bluetooth daemon as well. No matter how I tried, I could not get bluetooth-properties to remember my preferences. My computer was not visible to other Bluetooth enabled devices and I could not browse my phone via Bluetooth. (It used to work flawlessly in Fedora 9). I diagnosed that the problem is with D-Bus by running the following command:
sudo bluetoothd -n -d
bluetoothd always terminated with the error:
Unable to get on D-BUS
I tried mucking around with D-Bus policy settings in /etc/dbus-1/system.d/ but had no luck until I came across this helpful post at FedoraForums.
After editing /etc/dbus-1/system.conf as mentioned, I restarted the computer and voila ! Bluetooth started working and yum stopped complaining !!
For completeness, this is the interesting bit from my new /etc/dbus-1/system.conf
<!-- allow sending valid replies -->
<!-- commented out part
<allow send_requested_reply="true" send_type="method_return"/>
<allow send_requested_reply="true" send_type="error"/>
-->
<!-- Newly added line to fix permission problems -->
<allow send_requested_reply="true" />
Kudos to all the helpful people at Fedora Forums !
ERROR:dbus.proxies:Introspect error on :1.46:/org/freedesktop/PackageKit: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: A security policy in place prevents this sender from sending this message to this recipient, see message bus configuration file (rejected message had interface "org.freedesktop.DBus.Introspectable" member "Introspect" error name "(unset)" destination ":1.46")
This seemed to have affected the Bluetooth daemon as well. No matter how I tried, I could not get bluetooth-properties to remember my preferences. My computer was not visible to other Bluetooth enabled devices and I could not browse my phone via Bluetooth. (It used to work flawlessly in Fedora 9). I diagnosed that the problem is with D-Bus by running the following command:
sudo bluetoothd -n -d
bluetoothd always terminated with the error:
Unable to get on D-BUS
I tried mucking around with D-Bus policy settings in /etc/dbus-1/system.d/ but had no luck until I came across this helpful post at FedoraForums.
After editing /etc/dbus-1/system.conf as mentioned, I restarted the computer and voila ! Bluetooth started working and yum stopped complaining !!
For completeness, this is the interesting bit from my new /etc/dbus-1/system.conf
<!-- allow sending valid replies -->
<!-- commented out part
<allow send_requested_reply="true" send_type="method_return"/>
<allow send_requested_reply="true" send_type="error"/>
-->
<!-- Newly added line to fix permission problems -->
<allow send_requested_reply="true" />
Kudos to all the helpful people at Fedora Forums !
Thursday, 11 September 2008
Spice up the command line with BashStyle-NG
What I like most about Linux is its powerful command line. Many people find it intimidating, but with a little practice, the command line is the most natural way of interacting with a computer. Things can be done with the command line in less time than it takes to just launch the equivalent GUI utility.
The term "command line" naturally doesn't invoke a very pleasant image because we have come to associate it with a bland, colourless screen filled with text. But in reality, things can't be more further from the truth. X based terminal utilities allow a variety of customizations to tweak the appearance to fit the user's needs. It's well worth the effort to spend some time tweaking the terminal to fit your taste, because sooner or later, you are sure to come across a task that is more easily accomplished using the command line than the GUI.
BashStyle-NG (http://freshmeat.net/projects/bsng/?branch_id=75809&release_id=284647) is a GUI utility that allows the user to customize the command line in more innovative ways. Some of the options provided include:
Installing BashStyle-NG is quite easy. Grab the source tarball from http://freshmeat.net/redir/bsng/75809/url_bz2/BashStyle-7.1.tar.bz2 and configure, make and make install !
BashStyle uses the python-psyco compiler to speed up execution times. It's a good idea to install it before beginning the actual installation.
sudo yum install python-psyco
wget http://freshmeat.net/redir/bsng/75809/url_bz2/BashStyle-7.1.tar.bz2
tar xvf BashStyle-7.1.tar.bz2
cd bashstyle
./configure
make && sudo make install
On my machine, BashStyle-NG got installed with root as the owner. This prevented some of the customizations from working correctly when run as a normal user. To fix this, change the permissions of the BashStyle-NG script.
sudo chmod 0777 /usr/share/bashstyle-ng/system/nx-rc
Now all that's left is to invoke BashStyle and start customizing !
bashstyle

The term "command line" naturally doesn't invoke a very pleasant image because we have come to associate it with a bland, colourless screen filled with text. But in reality, things can't be more further from the truth. X based terminal utilities allow a variety of customizations to tweak the appearance to fit the user's needs. It's well worth the effort to spend some time tweaking the terminal to fit your taste, because sooner or later, you are sure to come across a task that is more easily accomplished using the command line than the GUI.
BashStyle-NG (http://freshmeat.net/projects/bsng/?branch_id=75809&release_id=284647) is a GUI utility that allows the user to customize the command line in more innovative ways. Some of the options provided include:
- The ability to tweak the prompt in interesting ways to display important information in various colours.
- Colourizing output from tools like grep and man for easy readability
- Creating aliases
- Tweak command history, auto completion and internal variables such as the default editor
- Change behaviour of editors such as vim and nano
- Manage user profiles
Installing BashStyle-NG is quite easy. Grab the source tarball from http://freshmeat.net/redir/bsng/75809/url_bz2/BashStyle-7.1.tar.bz2 and configure, make and make install !
BashStyle uses the python-psyco compiler to speed up execution times. It's a good idea to install it before beginning the actual installation.
sudo yum install python-psyco
wget http://freshmeat.net/redir/bsng/75809/url_bz2/BashStyle-7.1.tar.bz2
tar xvf BashStyle-7.1.tar.bz2
cd bashstyle
./configure
make && sudo make install
On my machine, BashStyle-NG got installed with root as the owner. This prevented some of the customizations from working correctly when run as a normal user. To fix this, change the permissions of the BashStyle-NG script.
sudo chmod 0777 /usr/share/bashstyle-ng/system/nx-rc
Now all that's left is to invoke BashStyle and start customizing !
bashstyle


Saturday, 28 June 2008
Resumable SFTP/SCP Transfers
Transmission errors inevitably occur during any online activity. This is specially true when tranferring large files. Murphy always prefers to poke his nose in at the worst possible time to disrupt an important file transfer.
Although HTTP and FTP transfers can be resumed without starting all over again, SFTP and SCP do not provide this capability out of the box. There are essentially two methods to obtain resumable SFTP and SCP transfers, but they are not 100% reliable. However, if you are stuck with an unreliable communication channel and a server supporting only SCP/SFTP, then it's the only ray of hope.
Method 1:
rsync supports resumable transfers across secure connections, and is the most easy to use solution. The downside is that both the server and the client must have rsync installed. If you're fortunate enough to have a server that supports rsync, the following command is all you will need.
rsync --partial --progress --rsh=ssh file_name user@host:server_path
If you use SCP on a daily basis, then it's worthwhile to add an alias to quickly start resumable transfers by editing ~/.bashrc and adding a line similar to:
alias scpr='rsync --partial --progress --rsh=ssh'
The invocation syntax will be similar to a normal scp command. For example:
scpr myfile.tar me@myremotehost.com:~/mydir/
Method 2:
cURL the multi-protocol URL grokker also provides resumable transfers with the -C flag.
curl -C -Tfile_name -u username sftp://myhost/mypath/
libcurl provided with my Fedora 9 setup is not built with libssh2 to enable SFTP and SCP. You can check whether your distribution has a libcurl that supports SCP/SFTP by running:
curl-config --protocols
I downloaded and compiled cURL from source to enable SCP and SFTP. However, I did not dare to replace the libcurl shipped with Fedora because there are over 85 programs depending on it. The downside is that my binary gets built by linking to the old libcurl which does not support SFTP and SCP ! However, I can run the curl static executable from the build directory with full SCP and SFTP support. Building a separate dynamic executable shouldn't be that difficult, but it requires wading through the Makefiles. Since I am not in a dire need for curl with SFTP and SCP support, I will defer this adventure to another time.
Although HTTP and FTP transfers can be resumed without starting all over again, SFTP and SCP do not provide this capability out of the box. There are essentially two methods to obtain resumable SFTP and SCP transfers, but they are not 100% reliable. However, if you are stuck with an unreliable communication channel and a server supporting only SCP/SFTP, then it's the only ray of hope.
Method 1:
rsync supports resumable transfers across secure connections, and is the most easy to use solution. The downside is that both the server and the client must have rsync installed. If you're fortunate enough to have a server that supports rsync, the following command is all you will need.
rsync --partial --progress --rsh=ssh file_name user@host:server_path
If you use SCP on a daily basis, then it's worthwhile to add an alias to quickly start resumable transfers by editing ~/.bashrc and adding a line similar to:
alias scpr='rsync --partial --progress --rsh=ssh'
The invocation syntax will be similar to a normal scp command. For example:
scpr myfile.tar me@myremotehost.com:~/mydir/
Method 2:
cURL the multi-protocol URL grokker also provides resumable transfers with the -C flag.
curl -C -Tfile_name -u username sftp://myhost/mypath/
libcurl provided with my Fedora 9 setup is not built with libssh2 to enable SFTP and SCP. You can check whether your distribution has a libcurl that supports SCP/SFTP by running:
curl-config --protocols
I downloaded and compiled cURL from source to enable SCP and SFTP. However, I did not dare to replace the libcurl shipped with Fedora because there are over 85 programs depending on it. The downside is that my binary gets built by linking to the old libcurl which does not support SFTP and SCP ! However, I can run the curl static executable from the build directory with full SCP and SFTP support. Building a separate dynamic executable shouldn't be that difficult, but it requires wading through the Makefiles. Since I am not in a dire need for curl with SFTP and SCP support, I will defer this adventure to another time.
Friday, 27 June 2008
Fedora Sytem Restore
One of the good features of Microsoft Windows is the system restore tool which allows quick rollbacks to a previous state. When I was a Windows user, I had to make use of it extensively because the auto-updates always seemed to screw up something and make my system unusable. With Linux, that sort of problems are rare because the repositories are well managed. But sometimes things do tend to get messy after an update. I have had my fair share of updates gone awry, but they were minor infractions that didn't leave my system completely unusable. However, the time I spent on untangling the mess would have been better spent somewhere else.
Today by chance I came across a Linux Journal article about a little known feature of yum and rpm which allows rollbacks to previous states, just like Windows system restore does ! I have no idea why this feature is not enabled by default or why is it not more widely publicized, but who am I to argue with the collective inteligence of the wizards at RedHat and Fedora ?
Basically, to manually enable rollbacks of a certain install, the user has to repackage the old rpm so that it's state is saved. However, doing this manually for each and every package is cumbersome and error prone. Follow these steps to make this process automatic.
1. Edit /etc/yum.conf and add the line tsflags=repackage
2. Edit /etc/rpm/macros (You might need to create this file) and add
%_repackage_all_erasures 1
%_repackage_dir /repackaged
%_repackage_dir is not neccessary for the funcationality. But it's advisable to set it to a partition with lots of space, so that it doesn't eat out the disk space from the important data partitions.
To rollback to a previous state, simply run rpm with the -rollback option and the desired time.
rpm -Uvh -rollback '2 hour ago'
ONLamp blog lists several other variants to invoke rollback such as:
rpm -Uvh -rollback '8.00 am'
rpm -Uvh -rollback 'november 1'
Edit: After enabling repackaging on my Fedora 9 system, packagekit reported repackaging errors during an update. I am still trying to find a solution to get rid of the error messages while keeping repackaging instact. Proceed at your own risk.
Today by chance I came across a Linux Journal article about a little known feature of yum and rpm which allows rollbacks to previous states, just like Windows system restore does ! I have no idea why this feature is not enabled by default or why is it not more widely publicized, but who am I to argue with the collective inteligence of the wizards at RedHat and Fedora ?
Basically, to manually enable rollbacks of a certain install, the user has to repackage the old rpm so that it's state is saved. However, doing this manually for each and every package is cumbersome and error prone. Follow these steps to make this process automatic.
1. Edit /etc/yum.conf and add the line tsflags=repackage
2. Edit /etc/rpm/macros (You might need to create this file) and add
%_repackage_all_erasures 1
%_repackage_dir /repackaged
%_repackage_dir is not neccessary for the funcationality. But it's advisable to set it to a partition with lots of space, so that it doesn't eat out the disk space from the important data partitions.
To rollback to a previous state, simply run rpm with the -rollback option and the desired time.
rpm -Uvh -rollback '2 hour ago'
ONLamp blog lists several other variants to invoke rollback such as:
rpm -Uvh -rollback '8.00 am'
rpm -Uvh -rollback 'november 1'
Edit: After enabling repackaging on my Fedora 9 system, packagekit reported repackaging errors during an update. I am still trying to find a solution to get rid of the error messages while keeping repackaging instact. Proceed at your own risk.
Friday, 25 April 2008
CD Burning Permissions in Linux
There are many options for burning CDs and DVDs in linux. This article is not about any particular disk burning tool. In some linux configurations, the normal users do not have exclusive rights to the cd burning device and this causes the burn process to fail. Although this can be solved by running the cd recording utility as root, it is not very elegant nor recommended for daily use.
Usually the permission problems crop up because the user doesn't have write access to the /dev/sg* devices. This can be solved by a simple
sudo chmod o+w /dev/sg*However, in many modern linux distributions, the /dev devices are created automatically at runtime by the udev daemon. So setting permissions like above will only last for that particular session. You can ofcourse modify /etc/rc.local or other startup script to change the permissions everytime on boot, but it is also a rather inelegant solution.
Ofcourse, there's more than one way to skin a rabbit. So if you're ok with the solutions I outlined above, you can forget about the rest of the article. If you get a thrill out of editing esoteric config files, keep reading . :)
The way I proceeded to solve the problem was by scanning through the /etc/udev directory. I noticed that there is a folder titled rules.d which contained a lot of scripts organized in a similar way to the scripts in /etc/rc.d directories. There are many scripts for lot of special devices on my system, but nothing that seemed specially setup for cd-roms or block devices. Therefore I proceeded to open up the most likely candidate titled /etc/udev/rules.d/50-udev-default.rules. Sure enough about halfway through the very lengthy file, I discovered the line where the /dev/sg* devices were being created. The line looks like
# block, tapes, block-releated
SUBSYSTEM=="block", GROUP="disk", MODE="0640"
SUBSYSTEM=="block", KERNEL=="sr[0-9]*", SYMLINK+="scd%n"
SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", ACTION=="add", ATTR{type}=="0|7|14", ATTR{timeout}="60"
SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", ACTION=="add", ATTR{type}=="1", ATTR{timeout}="900"
KERNEL=="hd*", SUBSYSTEMS=="ide", ATTRS{media}=="floppy", OPTIONS+="all_partitions"
KERNEL=="fd[0-9]", GROUP="floppy"
KERNEL=="fd[0-9]", ACTION=="add", ATTRS{cmos}=="?*", RUN+="create_floppy_devices -c -t $attr{cmos} -m %M -M 0640 -G floppy $root/%k"
KERNEL=="sch[0-9]*", GROUP="disk"
KERNEL=="sg[0-9]*", ATTRS{type}!="3|6", GROUP="disk", MODE="0640"
KERNEL=="ht[0-9]*|nht[0-9]*", GROUP="disk"
KERNEL=="pg[0-9]*", GROUP="disk"
KERNEL=="pt[0-9]*|npt[0-9]*", GROUP="disk"
KERNEL=="qft[0-9]*|nqft[0-9]*|zqft[0-9]*|nzqft[0-9]*|rawqft[0-9]*|nrawqft[0-9]*", GROUP="disk"
KERNEL=="rawctl", NAME="raw/%k", GROUP="disk"
SUBSYSTEM=="raw", KERNEL=="raw[0-9]*", NAME="raw/%k", GROUP="disk"
KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%k"
KERNEL=="pktcdvd", NAME="pktcdvd/control"
KERNEL=="qft0", SYMLINK+="ftape"
SUBSYSTEM=="bsg", NAME="bsg/%k"
SUBSYSTEM=="aoe", NAME="etherd/%k", GROUP="disk"
Problem solved. All I needed to do was change the mode to 0660 and add myself to the disk group.
The modified line in /etc/udev/rules.d/50-udev-default.rules looks like
KERNEL=="sg[0-9]*", ATTRS{type}!="3|6", GROUP="disk", MODE="0660"
Then I added myself to the disk group.
sudo usermod -a -G disk januz
To make sure you're in the disk group, run
groups januz If the output contains 'disk', then you're done. The next time you reboot the machine, the cd recording devices will be writable by you and the cd recording tools won't be throwing out any nasty permission errors.
Usually the permission problems crop up because the user doesn't have write access to the /dev/sg* devices. This can be solved by a simple
sudo chmod o+w /dev/sg*However, in many modern linux distributions, the /dev devices are created automatically at runtime by the udev daemon. So setting permissions like above will only last for that particular session. You can ofcourse modify /etc/rc.local or other startup script to change the permissions everytime on boot, but it is also a rather inelegant solution.
Ofcourse, there's more than one way to skin a rabbit. So if you're ok with the solutions I outlined above, you can forget about the rest of the article. If you get a thrill out of editing esoteric config files, keep reading . :)
The way I proceeded to solve the problem was by scanning through the /etc/udev directory. I noticed that there is a folder titled rules.d which contained a lot of scripts organized in a similar way to the scripts in /etc/rc.d directories. There are many scripts for lot of special devices on my system, but nothing that seemed specially setup for cd-roms or block devices. Therefore I proceeded to open up the most likely candidate titled /etc/udev/rules.d/50-udev-default.rules. Sure enough about halfway through the very lengthy file, I discovered the line where the /dev/sg* devices were being created. The line looks like
# block, tapes, block-releated
SUBSYSTEM=="block", GROUP="disk", MODE="0640"
SUBSYSTEM=="block", KERNEL=="sr[0-9]*", SYMLINK+="scd%n"
SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", ACTION=="add", ATTR{type}=="0|7|14", ATTR{timeout}="60"
SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", ACTION=="add", ATTR{type}=="1", ATTR{timeout}="900"
KERNEL=="hd*", SUBSYSTEMS=="ide", ATTRS{media}=="floppy", OPTIONS+="all_partitions"
KERNEL=="fd[0-9]", GROUP="floppy"
KERNEL=="fd[0-9]", ACTION=="add", ATTRS{cmos}=="?*", RUN+="create_floppy_devices -c -t $attr{cmos} -m %M -M 0640 -G floppy $root/%k"
KERNEL=="sch[0-9]*", GROUP="disk"
KERNEL=="sg[0-9]*", ATTRS{type}!="3|6", GROUP="disk", MODE="0640"
KERNEL=="ht[0-9]*|nht[0-9]*", GROUP="disk"
KERNEL=="pg[0-9]*", GROUP="disk"
KERNEL=="pt[0-9]*|npt[0-9]*", GROUP="disk"
KERNEL=="qft[0-9]*|nqft[0-9]*|zqft[0-9]*|nzqft[0-9]*|rawqft[0-9]*|nrawqft[0-9]*", GROUP="disk"
KERNEL=="rawctl", NAME="raw/%k", GROUP="disk"
SUBSYSTEM=="raw", KERNEL=="raw[0-9]*", NAME="raw/%k", GROUP="disk"
KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%k"
KERNEL=="pktcdvd", NAME="pktcdvd/control"
KERNEL=="qft0", SYMLINK+="ftape"
SUBSYSTEM=="bsg", NAME="bsg/%k"
SUBSYSTEM=="aoe", NAME="etherd/%k", GROUP="disk"
Problem solved. All I needed to do was change the mode to 0660 and add myself to the disk group.
The modified line in /etc/udev/rules.d/50-udev-default.rules looks like
KERNEL=="sg[0-9]*", ATTRS{type}!="3|6", GROUP="disk", MODE="0660"
Then I added myself to the disk group.
sudo usermod -a -G disk januz
To make sure you're in the disk group, run
groups januz If the output contains 'disk', then you're done. The next time you reboot the machine, the cd recording devices will be writable by you and the cd recording tools won't be throwing out any nasty permission errors.
Friday, 18 April 2008
Conky : System monitoring eye candy
[This is not really news, but I thought I would keep a record just in case for future reference.]
Recently I came across this nifty utility called conky, which displays information about the system on the desktop. It's light-weight and highly customizable. Everything is controlled via the .conkyrc file in the home directory, and the settings are quite intuitive.
Installing conky is a breeze. Just grab the source from http://conky.sourceforge.net/ and do the make dance.
tar -jxvf conky-1.5.1.tar.bz2
cd conky-1.5.1
./configure
make
sudo make install
To run conky with the default settings, just type
conky
My Fedora 8 system by default didn't have X double buffering enabled. If you start to see some flicker or if the text gets garbled, open up xorg.conf and add the following line to the Modules section.
Load "dbe" Restart X afterwards to enable the setting.
http://conky.sourceforge.net/screenshots.html lists several conky configurations with screenshots. Just download what you fancy and save it in the home directory as .conkyrc and restart conky to see the results. You can customize the setup by editing conkyrc, it's quite intuitive. If you have done any HTML+CSS coding before, you'll be right at home with the conky syntax.
http://conky.sourceforge.net/variables.html Lists available conky variables and http://conky.sourceforge.net/config_settings.html lists the config settings. You can also try the man pages for reference.
I am posting my conkyrc below for backup purposes.
# Conky sample configuration
#
# the list of variables has been removed from this file in favour
# of keeping the documentation more maintainable.
# Check http://conky.sf.net for an up-to-date-list.
# set to yes if you want Conky to be forked in the background
background no
# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
font 9x15
# Use Xft?
use_xft yes
# Xft font when Xft is enabled
xftfont Bitstream Vera Sans Mono:size=8
# Text alpha when using Xft
xftalpha 0.8
# Print everything to stdout?
# out_to_console no
# MPD host/port
# mpd_host localhost
# mpd_port 6600
# mpd_password tinker_bell
# Print everything to console?
# out_to_console no
# mail spool
mail_spool $MAIL
# Update interval in seconds
update_interval 5.0
# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0
# Create own window instead of using desktop (required in nautilus)
own_window yes
# If own_window is yes, you may use type normal, desktop or override
own_window_type override
# Use pseudo transparency with own_window?
own_window_transparent yes
# If own_window_transparent is set to no, you can set the background colour here
own_window_colour white
# If own_window is yes, these window manager hints may be used
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_hints undecorated,below,sticky
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# Minimum size of text area
minimum_size 280 5
# Draw shades?
draw_shades no
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
# Draw borders around graphs
draw_graph_borders yes
# Stippled borders?
stippled_borders 8
# border margins
border_margin 4
# border width
border_width 1
# Default colors and also border colors
default_color white
default_shade_color black
default_outline_color green
# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right
#alignment none
# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 12
gap_y 35
# Subtract file system buffers from used memory?
no_buffers yes
# set to yes if you want all text to be in uppercase
uppercase no
# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2
# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2
# Force UTF8? note that UTF8 support required XFT
override_utf8_locale no
# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer left
# Allow each port monitor to track at most this many connections (if 0 or not set, default is 256)
#max_port_monitor_connections 256
# Maximum number of special things, e.g. fonts, offsets, aligns, etc.
#max_specials 512
# Maximum size of buffer for user text, i.e. below TEXT line.
#max_user_text 16384
# variable is given either in format $variable or in ${variable}. Latter
# allows characters right after the variable and must be used in network
# stuff because of an argument
# stuff after 'TEXT' will be formatted on screen
TEXT
$color $nodename - $sysname $kernel on $machine
$hr
Uptime:${color #606060} $uptime $color - Load:${color #606060} $loadavg
$color CPU Usage:${color #606060} $cpu% ${cpubar}
${color #606060} ${cpugraph 0000ff 00ec00}
$color RAM Usage:${color #606060} $mem/$memmax - $memperc% ${membar}
$color Swap Usage:${color #606060} $swap/$swapmax - $swapperc% ${swapbar}
$color Processes:${color #606060} $processes $color Running:${color #606060} $running_processes
$color$hr
Networking:
Down:${color #606060} ${downspeed wlan0} k/s$color ${offset 80}Up:${color #606060} ${upspeed wlan0} k/s
${color #606060}${downspeedgraph wlan0 32,150 ff0000 0000ec} ${upspeedgraph wlan0 32,150 0000ff ec0000}
$color File systems: / ${color #606060}${fs_used /}/${fs_size /} ${fs_bar /}
$color Name PID CPU% MEM%
${color #ec0000} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${color #606060} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}
$color Mem usage
${color #ec0000} ${top_mem name 1} ${top_mem pid 1} ${top_mem cpu 1} ${top_mem mem 1}
${color #606060} ${top_mem name 2} ${top_mem pid 2} ${top_mem cpu 2} ${top_mem mem 2}
${top_mem name 3} ${top_mem pid 3} ${top_mem cpu 3} ${top_mem mem 3}
$color$hr
Connections in:${color #606060} ${tcp_portmon 1 32767 count}$color Connections out:${color #606060} ${tcp_portmon 32768 61000 count}$color Total:${color #606060} ${tcp_portmon 1 65535 count}
$color Inbound Connection ${alignr} Local Service/Port
${color #606060} ${tcp_portmon 1 32767 rhost 0} ${alignr} ${tcp_portmon 1 32767 lservice 0}
${tcp_portmon 1 32767 rhost 1} ${alignr} ${tcp_portmon 1 32767 lservice 1}
${tcp_portmon 1 32767 rhost 2} ${alignr} ${tcp_portmon 1 32767 lservice 2}
${tcp_portmon 1 32767 rhost 3} ${alignr} ${tcp_portmon 1 32767 lservice 3}
${tcp_portmon 1 32767 rhost 4} ${alignr} ${tcp_portmon 1 32767 lservice 4}
${tcp_portmon 1 32767 rhost 5} ${alignr} ${tcp_portmon 1 32767 lservice 5}
$color Outbound Connection ${alignr} Remote Service/Port$color
${color #606060} ${tcp_portmon 32768 61000 rhost 0} ${alignr} ${tcp_portmon 32768 61000 rservice 0}
${tcp_portmon 32768 61000 rhost 1} ${alignr} ${tcp_portmon 32768 61000 rservice 1}
${tcp_portmon 32768 61000 rhost 2} ${alignr} ${tcp_portmon 32768 61000 rservice 2}
${tcp_portmon 32768 61000 rhost 3} ${alignr} ${tcp_portmon 32768 61000 rservice 3}
${tcp_portmon 32768 61000 rhost 4} ${alignr} ${tcp_portmon 32768 61000 rservice 4}
${tcp_portmon 32768 61000 rhost 5} ${alignr} ${tcp_portmon 32768 61000 rservice 5}
$color$hr
Recently I came across this nifty utility called conky, which displays information about the system on the desktop. It's light-weight and highly customizable. Everything is controlled via the .conkyrc file in the home directory, and the settings are quite intuitive.
Installing conky is a breeze. Just grab the source from http://conky.sourceforge.net/ and do the make dance.
tar -jxvf conky-1.5.1.tar.bz2
cd conky-1.5.1
./configure
make
sudo make install
To run conky with the default settings, just type
conky
My Fedora 8 system by default didn't have X double buffering enabled. If you start to see some flicker or if the text gets garbled, open up xorg.conf and add the following line to the Modules section.
Load "dbe" Restart X afterwards to enable the setting.
http://conky.sourceforge.net/screenshots.html lists several conky configurations with screenshots. Just download what you fancy and save it in the home directory as .conkyrc and restart conky to see the results. You can customize the setup by editing conkyrc, it's quite intuitive. If you have done any HTML+CSS coding before, you'll be right at home with the conky syntax.
http://conky.sourceforge.net/variables.html Lists available conky variables and http://conky.sourceforge.net/config_settings.html lists the config settings. You can also try the man pages for reference.
I am posting my conkyrc below for backup purposes.
# Conky sample configuration
#
# the list of variables has been removed from this file in favour
# of keeping the documentation more maintainable.
# Check http://conky.sf.net for an up-to-date-list.
# set to yes if you want Conky to be forked in the background
background no
# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
font 9x15
# Use Xft?
use_xft yes
# Xft font when Xft is enabled
xftfont Bitstream Vera Sans Mono:size=8
# Text alpha when using Xft
xftalpha 0.8
# Print everything to stdout?
# out_to_console no
# MPD host/port
# mpd_host localhost
# mpd_port 6600
# mpd_password tinker_bell
# Print everything to console?
# out_to_console no
# mail spool
mail_spool $MAIL
# Update interval in seconds
update_interval 5.0
# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0
# Create own window instead of using desktop (required in nautilus)
own_window yes
# If own_window is yes, you may use type normal, desktop or override
own_window_type override
# Use pseudo transparency with own_window?
own_window_transparent yes
# If own_window_transparent is set to no, you can set the background colour here
own_window_colour white
# If own_window is yes, these window manager hints may be used
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_hints undecorated,below,sticky
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# Minimum size of text area
minimum_size 280 5
# Draw shades?
draw_shades no
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
# Draw borders around graphs
draw_graph_borders yes
# Stippled borders?
stippled_borders 8
# border margins
border_margin 4
# border width
border_width 1
# Default colors and also border colors
default_color white
default_shade_color black
default_outline_color green
# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right
#alignment none
# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 12
gap_y 35
# Subtract file system buffers from used memory?
no_buffers yes
# set to yes if you want all text to be in uppercase
uppercase no
# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2
# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2
# Force UTF8? note that UTF8 support required XFT
override_utf8_locale no
# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer left
# Allow each port monitor to track at most this many connections (if 0 or not set, default is 256)
#max_port_monitor_connections 256
# Maximum number of special things, e.g. fonts, offsets, aligns, etc.
#max_specials 512
# Maximum size of buffer for user text, i.e. below TEXT line.
#max_user_text 16384
# variable is given either in format $variable or in ${variable}. Latter
# allows characters right after the variable and must be used in network
# stuff because of an argument
# stuff after 'TEXT' will be formatted on screen
TEXT
$color $nodename - $sysname $kernel on $machine
$hr
Uptime:${color #606060} $uptime $color - Load:${color #606060} $loadavg
$color CPU Usage:${color #606060} $cpu% ${cpubar}
${color #606060} ${cpugraph 0000ff 00ec00}
$color RAM Usage:${color #606060} $mem/$memmax - $memperc% ${membar}
$color Swap Usage:${color #606060} $swap/$swapmax - $swapperc% ${swapbar}
$color Processes:${color #606060} $processes $color Running:${color #606060} $running_processes
$color$hr
Networking:
Down:${color #606060} ${downspeed wlan0} k/s$color ${offset 80}Up:${color #606060} ${upspeed wlan0} k/s
${color #606060}${downspeedgraph wlan0 32,150 ff0000 0000ec} ${upspeedgraph wlan0 32,150 0000ff ec0000}
$color File systems: / ${color #606060}${fs_used /}/${fs_size /} ${fs_bar /}
$color Name PID CPU% MEM%
${color #ec0000} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${color #606060} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}
$color Mem usage
${color #ec0000} ${top_mem name 1} ${top_mem pid 1} ${top_mem cpu 1} ${top_mem mem 1}
${color #606060} ${top_mem name 2} ${top_mem pid 2} ${top_mem cpu 2} ${top_mem mem 2}
${top_mem name 3} ${top_mem pid 3} ${top_mem cpu 3} ${top_mem mem 3}
$color$hr
Connections in:${color #606060} ${tcp_portmon 1 32767 count}$color Connections out:${color #606060} ${tcp_portmon 32768 61000 count}$color Total:${color #606060} ${tcp_portmon 1 65535 count}
$color Inbound Connection ${alignr} Local Service/Port
${color #606060} ${tcp_portmon 1 32767 rhost 0} ${alignr} ${tcp_portmon 1 32767 lservice 0}
${tcp_portmon 1 32767 rhost 1} ${alignr} ${tcp_portmon 1 32767 lservice 1}
${tcp_portmon 1 32767 rhost 2} ${alignr} ${tcp_portmon 1 32767 lservice 2}
${tcp_portmon 1 32767 rhost 3} ${alignr} ${tcp_portmon 1 32767 lservice 3}
${tcp_portmon 1 32767 rhost 4} ${alignr} ${tcp_portmon 1 32767 lservice 4}
${tcp_portmon 1 32767 rhost 5} ${alignr} ${tcp_portmon 1 32767 lservice 5}
$color Outbound Connection ${alignr} Remote Service/Port$color
${color #606060} ${tcp_portmon 32768 61000 rhost 0} ${alignr} ${tcp_portmon 32768 61000 rservice 0}
${tcp_portmon 32768 61000 rhost 1} ${alignr} ${tcp_portmon 32768 61000 rservice 1}
${tcp_portmon 32768 61000 rhost 2} ${alignr} ${tcp_portmon 32768 61000 rservice 2}
${tcp_portmon 32768 61000 rhost 3} ${alignr} ${tcp_portmon 32768 61000 rservice 3}
${tcp_portmon 32768 61000 rhost 4} ${alignr} ${tcp_portmon 32768 61000 rservice 4}
${tcp_portmon 32768 61000 rhost 5} ${alignr} ${tcp_portmon 32768 61000 rservice 5}
$color$hr

Wednesday, 16 April 2008
screen : Manage multiple sessions over a SSH connection
Screen is a popular utility that every system admin must know about. It's essentially a window manager for your shell sessions so that you can work on multiple shells at once without opening multiple connections to the server, Screen is specially useful if your connection is unreliable and has a tendency to drop while in the middle of something. Screen keeps running in the background even if you get disconnected, so you can imagine what a life saver it is.
I summarize some of the most important commands here for my future convenience. But the best way to get information about screen is to read the man pages.
After opening a connection to the server, simply run 'screen' to start screen. It might appear that nothing happened, but be assured, you're now in one of the screen 'windows'. To check, simply run:
screen -ls
The output will be similar to the following:
There is a screen on:
23876.pts-1.TuxMaster-JanuZ (Attached)
1 Socket in /var/run/screen/S-januz.
Once screen is running, there are several keyboard shortcuts that can be used. Some of the most important ones are:
C-a-c : Open another 'window'
C-a-n : Switch to next 'window'
C-a-p : Switch to previous 'window'
C-a-d : Detach the 'window'. The commands running in the window keeps running in the background even if you get disconnected.
C-a-h : Create a log of the session
C-a-? : Display a help window with all the keyboard shortcuts
If you got disconnected from a session and want to resume from where you left off, simply log back in and run the following set of commands to re-attach to the windows:
First list the running screen sessions
screen -ls
The output will be similar to
There is a screen on:
23876.pts-1.TuxMaster-JanuZ (Detached)
1 Socket in /var/run/screen/S-januz.
To re-attach, run screen with -r option, giving the session name (23876.pts-1.TuxMaster-JanuZ).
screen -r 23876.pts-1.TuxMaster-JanuZ
Sometimes, simply typing
screen -r 23876
also works.
Check out the man pages for more information or Google around for a tutorial. Mastering screen will be one of the best moves you will ever make.
I summarize some of the most important commands here for my future convenience. But the best way to get information about screen is to read the man pages.
After opening a connection to the server, simply run 'screen' to start screen. It might appear that nothing happened, but be assured, you're now in one of the screen 'windows'. To check, simply run:
screen -ls
The output will be similar to the following:
There is a screen on:
23876.pts-1.TuxMaster-JanuZ (Attached)
1 Socket in /var/run/screen/S-januz.
Once screen is running, there are several keyboard shortcuts that can be used. Some of the most important ones are:
C-a-c : Open another 'window'
C-a-n : Switch to next 'window'
C-a-p : Switch to previous 'window'
C-a-d : Detach the 'window'. The commands running in the window keeps running in the background even if you get disconnected.
C-a-h : Create a log of the session
C-a-? : Display a help window with all the keyboard shortcuts
If you got disconnected from a session and want to resume from where you left off, simply log back in and run the following set of commands to re-attach to the windows:
First list the running screen sessions
screen -ls
The output will be similar to
There is a screen on:
23876.pts-1.TuxMaster-JanuZ (Detached)
1 Socket in /var/run/screen/S-januz.
To re-attach, run screen with -r option, giving the session name (23876.pts-1.TuxMaster-JanuZ).
screen -r 23876.pts-1.TuxMaster-JanuZ
Sometimes, simply typing
screen -r 23876
also works.
Check out the man pages for more information or Google around for a tutorial. Mastering screen will be one of the best moves you will ever make.
Subscribe to:
Posts (Atom)