Friday, January 18, 2008
Aspell in spanish
aspell -d spanish -c myfile.tex
To check an English document:
aspell -c myfile.tex
Friday, January 11, 2008
Quota command
quota -v
Other options (on NFS)
/sbin/quotacheck -avug
Tuesday, January 01, 2008
Mod4 key in FluxBox
If the Mod4 key doesn't work, it means that when you set up X you probably picked a 101 or 102 key rather than 104 key keyboard. This is easily fixed. You'll need to be root or use sudo. Open up your favorite text editor and open /etc/X11/XF86Config or xorg.conf. (Sometimes, this will be /etc/X11/XF86Config-4). In there you will find the line
| Option "XkbModel" "pc101" |
Change it to read
| Option "XkbModel" "pc104" |
If you don't have that pc101 line in there, then you have some other problem. Some distributions, for some reason, don't automagically bind Mod4 to Super_L. You can check this with
xmodmap |
You should see something like
xmodmap: up to 3 keys per modifier, (keycodes in parentheses): |
If you don't, you can create a $HOME/.xmodmaprc file. In that file put
keycode 115 = Super_L |
The last line enables you to use the Windows menu key as well.
Save this file in your home directory and then add the following to your .xinitrc (above the exec startfluxbox line)
xmodmap .xmodmaprc |
Sometimes, this doesn't work for me. In that case, I have to add
add Mod4 = Super_L |
to my .xmodmaprc file There's other nice things you can do with the key bindings. For example, you can open up the root menu, move windows with keystrokes, etc. I have for example, in my fluxbox keys file
Monday, December 31, 2007
How to: Restrict Users to SCP and SFTP and Block SSH Shell Access with rssh
http://www.cyberciti.biz/tips
FTP is insecure protocol, but file-transfer is required all time. You can use OpenSSH Server to transfer file using SCP and SFTP (secure ftp) without setting up an FTP server. However, this feature also grants ssh shell access to a user. Basically OpenSSH requires a valid shell. Here is how sftp works:
SCP/SFTP -> SSHD -> Call sftpd subsystem -> Requires a shell -> User can login to server and run other commands.
In this article series we will help you provide secure restricted file-transfer services to your users without resorting to FTP. It also covers chroot jail setup instructions to lock down users to their own home directories (allow users to transfer files but not browse the entire Linux / UNIX file system of the server) as well as per user configurations.
rssh ~ a restricted shell
rssh is a restricted shell for use with OpenSSH, allowing only scp and/or sftp. It now also includes support for rdist, rsync, and cvs. For example, if you have a server which you only want to allow users to copy files off of via scp, without providing shell access, you can use rssh to do that.
Supported operations using rssh
Restricted shell only allows following operations only:
- scp - Secure file copy
- sftp - Secure FTP
- cvs - Concurrent Versions System ~ you can easily retrieve old versions to see exactly which change caused the bug
- rsync - Backup and sync file system
- rdist - Backup / RDist program maintains identical copies of files on multiple hosts.
Install rssh
CentOS / Fedora / RHEL Linux rssh installation
Visit Dag’s repo to grab rssh package# cd /tmp
# wget http://dag.wieers.com/rpm/packages/rssh/rssh-2.3.2-1.2.el5.rf.i386.rpm
# rpm -ivh rssh-2.3.2-1.2.el5.rf.i386.rpm
Debian / Ubuntu Linux rssh installation
Use apt-get command:$ sudo apt-get install rssh
FreeBSD installation
# cd /usr/ports/shells/rssh
# make install clean
Make sure you build binary with rsync support.
rssh configuration file
- Default configuration file is located at /etc/rssh.conf (FreeBSD - /usr/local/etc/rssh.conf)
- Default rssh binary location /usr/bin/rssh (FreeBSD - /usr/local/bin/rssh)
- Default port none - ( openssh 22 port used - rssh is shell with security features)
Continue reading rest of the rssh a restricted shell series.
Contents
- How to: Restrict Users to SCP and SFTP and Block SSH Shell Access with rssh
- How to: Configure User Account to Use a Restricted Shell ( rssh )
- Linux Configure rssh Chroot Jail To Lock Users To Their Home Directories Only
- rssh: Per User Configuration Options For Chroot Jail
Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or full RSS feed to get all updates. You can Email this page to a friend.
You may also be interested in...
- How to: Configure User Account to Use a Restricted Shell ( rssh )
- Howto: Add a new yum repository to install software under CentOS / Redhat Linux
- rssh: Per User Configuration Options For Chroot Jail
- Linux Configure rssh Chroot Jail To Lock Users To Their Home Directories Only
- Download of the day CentOS 5 CD / DVD ISO
Thursday, December 27, 2007
GRUB Splash Image HowTo
http://ruslug.rutgers.edu/~mcgrof/grub-images/
http://gentoo-wiki.com/HOWTO_Splash_image_in_GRUB
Requirements for GRUB splashimages:
1. xpm.gz file type
2. 640x480
3. 14 colors only
If you already have your image:
1. Gzip your xpm file and put it into your /boot/grub directory (as root)
# gzip myfile.xpm
2. Edit your grub.conf file
# nano /boot/grub/grub.conf
and add this line:
splashimage=(hd0,0)/GRUB/myfile.xpm.gz
NOTE Change the partition and directory according to your system's setup.
3. reboot
How to convert an image to only 14 colors
To get the GIMP to use only a 14 color palette, right click on your file and press ALT+I and put 14 where it says "Generate Optimal Palette:" on the top of the menu. If ALT+I doesn't get you there then right click on the image and go to:
Image-->Mode-->Indexed
Specify you want 14 colors and then if you want (*recommended*) select NO DITHERING. This will tell the gimp not to try to guess colors in between areas.
It does not have to be filename.xpm.gz only, but, compressed files load quicker that uncompressed files.
You can also change the foreground and background color of the menu, like this:
Just put something like the following in your menu.lst file:
foreground = ffffff (for text color)
background = 000000 (for background color)
Colors:
ffffff = white
000000 = black
333333 = cyan dark
666666 = cyan light
View images of currently available splashimages
Download working publically available GRUB splash images
------------------------------------------
The complete GRUB Splash Image Howto is here
Good Luck !!!

Greetings

gonzalo
===================
Introduction
The splash image is the image shown in the background when GRUB is displaying the list of operating systems you can boot. All you need to customize it is the GIMP or Imagemagick. You will need to make sure your GRUB supports the splashimage command. I took image from gentoo.org and cut a little for the GRUB background.
Creating image (GIMP)
1. Start the GIMP.
2. Click on File » New or type Ctrl+n
3. In the new image dialog, change Width to 640 pixels and Height to 480 pixels (the image should be of size 640x480 pixels). Now click OK.
4. Create the image which you would like to be the splash image. It's quite fun to experiment with the various tools of the GIMP!
5. After you have finished creating the image, hit Alt+i or right click on the image and click on Image » Mode » Indexed.
6. In the Indexed Color Conversion dialog that appears, click on the radio button Generate optimal Palette and in # of colors enter 14. Click OK (the image should be of only 14 colors).
7. Now right-click on the image and click on File » Save As.... Save the file as ImageName.xpm in a directory of your choice. If you can't create ImageName.xpm you can save it as ImageName.png and then convert it with convert ImageName.png ImageName.xpm (convert is a part of imagemagick).
8. Open a terminal, change directory to where the ImageName.xpm was saved, then compress it using GNU-zip: gzip ImageName.xpm
But be careful if you create you work with GIMP under Windows. It will use the standard Windows newline CR+LF. Nethertheless it seems as if GRUB can only cope with plain LF newlines. You have to convert the lineformat manually.
Creating image (Imagemagick)
You can also pick an image (any type supported by ImageMagick) and execute:
convert picture.jpg -resize 640x480! -colors 14 -depth 8 ImageName.xpm.gz
Installing the Image
Make sure you are root, then run the following in the terminal:
# mount /boot
# mv ImageName.xpm.gz /boot/grub/
In the /boot/grub/grub.conf you have to point splashimage to newly created image i.e.:
File: /boot/grub/grub.conf
# Splash Image
splashimage=(hd0,0)/grub/ImageName.xpm.gz
If your boot splash did not change,then try the following:
# cp ImageName.xpm.gz /boot/grub/splash.xpm.gz
That's it! When you reboot, you will find your image in the background, with the menu of operating systems etc. in the foreground.
Changing text colors
If you do not like the look of the default text settings (white text with black shadow and highlighting) or it turns out to be hard to read with your splashimage even though the color command wont work, there is a way to modify these. Use the command foreground to edit the text and border color background will do for the shadows and highlighted background of the selected item.
File: /boot/grub/grub.conf
# Set text color to RRGGBB
foreground RRGGBB
# Set shadows and selected highlight to RRGGBB
background RRGGBB
RRGGBB must be a HEX-Colorcode, i.e. numbers 0-9 and letters A-F, each group of two representing a color. You can either try it out (R means red, G means green, B means blue, so the range from 00 to FF allows you to address a range of 0 to 255 for each color that will then be combined with those of the others to make up the color you chose) or (more conveniently ;-) copy the 6-digit code that e.g. the KDE or GIMP color choosers provide.
Credits
* Some splash images
* Some more splash images
* Even more splash images
* ImageMagick Tricks book
Wednesday, December 26, 2007
Module snd-via82xx
http://ubuntuforums.org/archive/index.php/t-1994.html
This is in my /etc/modprobe.conf
alias eth0 via-rhine
alias scsi_hostadapter libata
alias scsi_hostadapter1 sata_via
alias scsi_hostadapter2 pata_via
alias snd-card-0 snd-via82xx
options snd-card-0 index=0
options snd-via82xx index=0
========== Then do ==============
This seems to solve the problem and load always the module:
=========================================
If there is anyone still alive who has this problem, one solution is to insert the line
options snd-via82xx dxs_support=3
in /etc/modprobe.d/alsa-base and just reboot.8)
=========================================
But mplayer was working without sound
http://www.fedoraonline.it/modules/newbb/viewtopic.php?post_id=32086
Se non va ancora...
...se lanci mplayer con una di queste opzioni:
$ mplayer -ao nosound blablabla.avi
o
$ mplayer -ao sdl blablabla.avi
o
$ mplayer -ao alsa blablabla.avi
o
$ mplayer -ao oss blablabla.avi
==========================
When the sound is working this are the modules that I have:
[root@localhost acardh]# /sbin/lsmod | grep 82
nfnetlink 8281 3 nf_conntrack_ipv4,nf_conntrack_ipv6,nf_conntrack
ip6t_REJECT 8257 2
dm_multipath 18249 0
snd_via82xx 25177 1
gameport 14665 1 snd_via82xx
snd_ac97_codec 92389 1 snd_via82xx
snd_mpu401_uart 10177 1 snd_via82xx
snd_pcm 63685 4 cx88_alsa,snd_via82xx,snd_ac97_codec,snd_pcm_oss
snd_page_alloc 11337 2 snd_via82xx,snd_pcm
snd 43461 12 cx88_alsa,snd_seq_oss,snd_seq,snd_via82xx,snd_ac97_codec,snd_pcm_oss,snd_mixer_oss,snd_mpu401_uart,snd_pcm,snd_rawmidi,snd_seq_device,snd_timer
i2c_core 21825 9 dvb_pll,nxt200x,cx88_vp3054_i2c,tuner,nvidia,cx88xx,i2c_algo_bit,tveeprom,i2c_viapro
ehci_hcd 31821 0
[root@localhost acardh]# /sbin/lsmod | grep snd
snd_seq_dummy 6725 0
snd_seq_oss 29889 0
snd_seq_midi_event 9793 1 snd_seq_oss
snd_seq 44849 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_via82xx 25177 1
gameport 14665 1 snd_via82xx
snd_ac97_codec 92389 1 snd_via82xx
snd_pcm_oss 37569 0
snd_mixer_oss 16705 3 snd_pcm_oss
ac97_bus 6081 1 snd_ac97_codec
snd_mpu401_uart 10177 1 snd_via82xx
snd_pcm 63685 4 cx88_alsa,snd_via82xx,snd_ac97_codec,snd_pcm_oss
snd_rawmidi 21185 1 snd_mpu401_uart
snd_seq_device 10061 4 snd_seq_dummy,snd_seq_oss,snd_seq,snd_rawmidi
snd_timer 20549 2 snd_seq,snd_pcm
snd_page_alloc 11337 2 snd_via82xx,snd_pcm
snd 43461 12 cx88_alsa,snd_seq_oss,snd_seq,snd_via82xx,snd_ac97_codec,snd_pcm_oss,snd_mixer_oss,snd_mpu401_uart,snd_pcm,snd_rawmidi,snd_seq_device,snd_timer
soundcore 9633 3 snd
==============================
$$$$$$$$$$$$$$$$$$$$$$$
Sound problem correction link
This is what I have in my /etc/modprobe.d/alsa-base
===============================
options snd-via82xx dxs_support=3
#http://www.linuxquestions.org/questions/fedora-35/problem-with-audio-in-fc5-433011/
# ALSA portion
options snd cards_limit=2
alias snd-card-0 snd-via82xx
alias snd-card-1 cx88-alsa
options snd-via82xx index=0
options cx88-alsa index=1
# OSS/Free portion
alias sound-slot-0 snd-via82xx
alias sound-slot-1 cx88-alsa
====================================
This last oprions in /etc/modprobe.d/alsa-base seemed to work in my Fedora 8
And this is the data in my PC (Fedora 8)
Model: Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller
Sound problem: PCM device VIA 8237
=================
Whithout sound:
[acardh@localhost ~]$ /sbin/lsmod | grep snd
snd_via82xx 25177 0
gameport 14665 1 snd_via82xx
snd_ac97_codec 92389 1 snd_via82xx
ac97_bus 6081 1 snd_ac97_codec
snd_seq_dummy 6725 0
snd_seq_oss 29889 0
snd_seq_midi_event 9793 1 snd_seq_oss
snd_seq 44849 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_pcm_oss 37569 0
snd_mixer_oss 16705 1 snd_pcm_oss
snd_pcm 63685 4 snd_via82xx,snd_ac97_codec,cx88_alsa,snd_pcm_oss
snd_timer 20549 2 snd_seq,snd_pcm
snd_mpu401_uart 10177 1 snd_via82xx
snd_page_alloc 11337 2 snd_via82xx,snd_pcm
snd_rawmidi 21185 1 snd_mpu401_uart
snd_seq_device 10061 4 snd_seq_dummy,snd_seq_oss,snd_seq,snd_rawmidi
snd 43461 12 snd_via82xx,snd_ac97_codec,cx88_alsa,snd_seq_oss,snd_seq,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer,snd_mpu401_uart,snd_rawmidi,snd_seq_device
soundcore 9633 1 snd
==============================
With Kaffeine:
Audio output unavailable. Device is busy. ()
*** PULSEAUDIO: Unable to connect: Connection refused
With MPlayer:
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 22050 Hz, 2 ch, s16le, 8.0 kbit/1.13% (ratio: 1000->88200)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
Could not open/initialize audio device -> no sound.
Audio: no sound
===============================
Whit sound:
[acardh@localhost ~]$ /sbin/lsmod | grep snd
snd_seq_dummy 6725 0
snd_via82xx 25177 2
gameport 14665 1 snd_via82xx
snd_ac97_codec 92389 1 snd_via82xx
ac97_bus 6081 1 snd_ac97_codec
snd_seq_oss 29889 0
snd_seq_midi_event 9793 1 snd_seq_oss
snd_seq 44849 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_pcm_oss 37569 0
snd_mixer_oss 16705 3 snd_pcm_oss
snd_pcm 63685 5 cx88_alsa,snd_via82xx,snd_ac97_codec,snd_pcm_oss
snd_mpu401_uart 10177 1 snd_via82xx
snd_timer 20549 2 snd_seq,snd_pcm
snd_rawmidi 21185 1 snd_mpu401_uart
snd_seq_device 10061 4 snd_seq_dummy,snd_seq_oss,snd_seq,snd_rawmidi
snd_page_alloc 11337 2 snd_via82xx,snd_pcm
snd 43461 13 cx88_alsa,snd_via82xx,snd_ac97_codec,snd_seq_oss,snd_seq,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_mpu401_uart,snd_timer,snd_rawmidi,snd_seq_device
soundcore 9633 3 snd
===============================
Tuesday, December 11, 2007
DynDNS and the ddclient
In the ddclient.conf file I have:
###=============
daemon=300 #300 # check every 300 seconds
syslog=yes # log update msgs to syslog
mail=acardh #mail=root # mail all msgs to root
mail-failure=acardh #root # mail failed update msgs to root
pid=/var/run/ddclient.pid # record PID in file.
#ssl=yes # use ssl-support. Works with
# ssl-library
use=web
protocol=dyndns2
server=members.dyndns.org
login=acardh # default login
password=******** # default password
server=members.dyndns.org, protocol=dyndns2, acardh.homelinux.org
##===============================
My complete ddclient.conf is here (restricted access).
Livna repostory for Fedora
http://www.my-guides.net/en/content/view/59/26/1/1/#livna
http://www.my-guides.net/en/content/view/91/26/
http://www.my-guides.net/en/content/view/91/26/1/1/#livna
Livna Repository
In Livna repository you can find additional programs and multimedia codecs. Install it like this:$ sudo rpm -hiv http://rpm.livna.org/livna-release-7.rpm $ sudo rpm --import sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-livna
$ sudo nano /etc/yum.repos.d/livna.repo or $ sudo nano /etc/yum.repos.d/freshrpms.repo
================///////////////////////////
In a similar way the plugin from Adobe:
$ sudo rpm -Uvh http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm Now you can install flash plugin by typing:
$ sudo yum install flash-plugin
and update it like that:
$ sudo yum update flash-plugin
By default this repository will be enabled. I prefer to disable it and enable it manually each time I want to look if there is an update for Flash Plugin. To odo so type:
$ sudo nano /etc/yum.repos.d/adobe-linux-i386.repo
And change enabled=1 to enabled=0. Now whenever you want to look for an update you can type:
$ sudo yum --enablerepo=adobe-linux-i386 update flash-plugin
=====================/////////////////////////////
In the case of ATRPMS for RHEL/CEntOS/SL follow the instructions provided by http://atrpms.net/ and I recommend to set to 0 the "enabled". Then in order to install a package you can do as root:
yum --enablerepo=atrpms install x
Friday, October 26, 2007
ATI X1300 3D effects in Linux
sudo apt-get install xserver-xgl
glxinfo | grep "direct rendering"
sudo dpkg-reconfigure -phigh xserver-xorg
I got the next message after installing xserver-xgl.
===================
Xgl server setup changed
The Xgl server will now be started automatically next time you login. It is no longer necessary to use any special X session to start Xgl, and such sessions will likely fail to work properly. Please select a regular session from your session manager next time you log in. To disable Xgl autostart for this user, create a file named ~/.config/xserver-xgl/disable
===================
To check your ATI hardware do:
lspci | grep ATI
I get:
01:00.0 VGA compatible controller: ATI Technologies Inc M52 [Mobility Radeon X1300]
==================
After trying this my 3D effects still not working.
:o(
===================
The new ATI driver version 8.42.3 supports AIGLX but is kind of buggy.
http://ati.amd.com/support/drivers/linux/linux-radeon.html
http://ati.amd.com/online/rss/atilinuxdriver.rss?OTC-rssfeedlinux
http://ati.amd.com/support/driver.html
Wednesday, October 03, 2007
Convert man Pages to Text
At the command line, run:
$ man
Here's what it means:
man
| = pipe the output of the man pages somewhere else
col -b = format the output
> = send the output to a file
filename.txt = name of the file you wish to create and populate with output
Tuesday, September 18, 2007
Removing orphaned dependencies in Gentoo
(link to Gentoo documentation on Portage)
emerge --update --newuse --deep --ask world
revdep-rebuild -X -av
emerge --depclean
Tuesday, September 04, 2007
Using the command texhash
To write a resumé in LaTeX you need a special class file called res.cls.
To use these files you will need the resume class file res.cls available from the CTAN TeX archive. You can do one of two things with this file: If you want to correctly install it for future use, place it in your TeX search path (/usr/local/share/texmf/tex/misc on my machine) then run ``texhash'' as root to rebuild the hash table. If you only plan to use it for this one project, you could alternatively just place the file in the same directory as the Makefile and tex file.
Once you have done this, simply edit the file cv-us.tex and then type ``make'' at the command prompt. DVI, PS, and PDF files will be created automatically.
Saturday, August 11, 2007
Video processing in Linux
And to compress the video the command transcode might be used.
transcode -i myinput.mpg -o myoutput.avi -y xvid4
Other useful commands are mencoder and ffmpeg
http://gentoo-wiki.com/HOWTO_Mencoder_Introduction_Guide
http://electron.mit.edu/~gsteele/ffmpeg/
Friday, August 10, 2007
Packages blocking in Gentoo
results into a block with aspell.
emerge wants to update app/dicts/aspell-en-6.0.0 [0.51.1]
wants to install new app-text/aspell-0.60.5
and blocks: app-dicts/aspell-en-0.5* (is blocking app-text/aspell-0.60.5
What am I doing wrong?
That's ok.
Just unmerge apsell-en-0.5* & emerge spell-en-6.0.0:
# emerge -C aspell-en && emerge -1 aspell-en
=========
For blocking packages in KDE check http://www.gentoo.org/doc/en/kde-config.xml
Code Listing 4.1: Removing KDE 3.4 packages |
# emerge --unmerge =arts-3.4* =kdelibs-3.4* =kdebase-3.4* ... |
Obviously this is very frustrating if you have many KDE packages installed. However this operation can be automated in many ways. The following one is an example.
First we list all the packages that we want to remove. We use the equery command for this, part of the app-portage/gentoolkit package:
Code Listing 4.2: Listing packages to remove |
(List all the installed KDE packages) |
At this point you should double-check that the list corresponds to the packages that should be removed from the system. If you think it is ok, you can go on and pass the list to the emerge --unmerge command.
Code Listing 4.3: Removing selected packages |
# equery list kde-base/ | grep 3\.4 | xargs emerge --unmerge --pretend |
Check again the output and reissue the command without --pretend to start the unmerging process.
Friday, June 29, 2007
Enabling and disabling services during start up in GNU/Linux
Here I will explain different ways of enabling and disabling the system services.
1) Red Hat Method
# chkconfig httpd --add
# chkconfig httpd on --level 2,3,5This will enable the apache webserver to automatically start in the run levels 2, 3 and 5. You can check this by running the command:# chkconfig --list httpdOne can also disable the service by using the off flag as shown below:# chkconfig httpd off
# chkconfig httpd --delRed Hat also has a useful script called service which can be used to start or stop any service. Taking the previous example, to start apache webserver, you execute the command:# service httpd startand to stop the service...# service httpd stopThe options being start, stop and restart which are self explanatory.2) Debian Method
Debian Linux has its own script to enable and disable services across runlevels. It is called update-rc.d. Going by the above example, you can enable apache webserver as follows
# update-rc.d apache2 defaults# update-rc.d apache2 start 20 2 3 4 5 . stop 80 0 1 6 .And to disable the service in all the run levels, you execute the command:
# update-rc.d -f apache2 removeHere -f option which stands for force is mandatory.# update-rc.d apache2 start 20 5 . stop 80 0 1 2 3 4 6 .3) Gentoo Method# rc-update add apache2 default... and to remove the webserver, it is as simple as :# rc-update del apache2To see all the running applications at your runlevel and their status, similar to what is achieved by chkconfig --list, you use the rc-status command.# rc-status --all4) The old fashioned way# cd /etc/rc5.d/
# ln -s /etc/init.d/apache2 S20apache2lrwxrwxrwx 1 root root 17 Mar 31 13:02 S20apache2 -> ../init.d/apache2
# ln -s /etc/init.d/apache2 K80apache2(link to original post)
Thursday, June 28, 2007
Auto Loading modules at boot time
| Code: |
| nano -w /etc/modules.autoload.d/kernel-2.6 |
Saturday, June 23, 2007
Java, bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export PATH=/opt/jdk1.6.0_01/bin:$PATH
# User specific aliases and functions
============
In the case of root in Fedora 7
==============
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export PATH=/opt/jdk1.6.0_01/bin:/sbin:$PATH
=========
To activate the changes you can just use the next command:
source .bashrc
Or logout and login.
Friday, June 22, 2007
Add/Remove modules - drivers
=> At boot time, only a minimal resident kernel is loaded into memory.
=> If you add new hardware you need to add driver aka modules
=> modprobe intelligently adds or removes a module from the Linux kernel
=> Usually modules stored in the module directory /lib/modules/$(uname -r)$ ls /lib/modules/$(uname -r)
Task: Add a module called foo
Type the command as root user: # modprobe foo
Task: List all loaded modules
Use lsmod command to show the status of modules in the Linux Kernel:# lsmod
Task: Remove a module called foo
Pass -r option to modprobe command to remove a module# modprobe -r foo
You can also use rmmod command, which is simple program to remove a module from the Linux Kernel# rmmod foo
Wednesday, June 20, 2007
17. Creating RPMs with checkinstall
Many times tarballs don't have uninstall scripts. This way your system becomes a mess when you want to uninstall these programs. Checkinstall is a program that allows you to easily build an rpm from a tarball. Download and install it from here.
Then when you want to install a tarball instead of ./configure && make && make install just type:
./configure
make
su -c '/usr/local/sbin/checkinstall'
Wednesday, June 06, 2007
Fixing Clock Drift On Gentoo
Recently a machine I set up with Gentoo linux started having its hardware clock drift quite wildly. In the morning it could be up to half an hour out. This was caused by a severe skew with the hardware clock and the system clock (or the BIOS clock and linux clock respectively). So to fix this I did two things, 1 install ntpd and 2 fix the hwclock.
Installing ntpd was quite easy:
# emerge net-misc/ntp
# nano -w /etc/conf.d/ntpd
Fill in the server you want, you can use the links specified for a list of servers.
# /etc/init.d/ntpd start
If no errors are reported go on, else see if something silly has happened (e.g. typo in /etc/conf.d/ntpd).
# rc-update add ntpd default
Next I fixed adjtime and set the h/w clock correctly:
# rm /etc/adjtime
# date MMDDhhmm[[CC]YY][.ss]
(e.g. date 100912002002 for 12:00pm 10/9/2002)
Finally I set the h/w clock with the system time.
#hwclock --utc --systohc
Comments
Ruben
Posted at 2003-10-01 5:32 a.m.
I tried this but it's not working can you tell me if this will work if my /etc/localtime links to /etc/zoneinfo/US/Central or do I have to change that too
Curtis
Posted at 2006-04-05 4:28 p.m.
By the way, to avoid clock conflicts if your machine is a dual-boot with Window$, you should set your hwclock to local, not utc. So the last command in your tutorial here should be:
#hwclock --local --systohc
Michael Twomey
Posted at 2006-10-16 2:39 p.m.
Wow, never noticed these comments, darn.
Ruben - no, the time zone should have no impact
Curtis - this is true if you dual boot. However I recommend using UTC if you aren't dual booting, as it solves a few nasty problems when daylight savings time changes.
Sunday, June 03, 2007
To chroot from one Linux to another
# chroot_to_gentoo.pl (from linux 1)
mount /dev/sda9 /mnt/gentoo ;
mount /dev/sda8 /mnt/gentoo/boot ;
mount -t proc none /mnt/gentoo/proc ;
mount -o bind /dev /mnt/gentoo/dev ;
/usr/sbin/chroot /mnt/gentoo /bin/bash
#source /etc/profile && env-update
#export PS1="(chroot) $PS1"
==================================
# /bin/bash
# chroot_to_gentoo2.pl (from linux 2)
#mount /dev/sda9 /mnt/gentoo ;
#mount /dev/sda8 /mnt/gentoo/boot ;
#mount -t proc none /mnt/gentoo/proc ;
# mount -o bind /dev /mnt/gentoo/dev ;
#/usr/sbin/chroot /mnt/gentoo /bin/bash
#This has to be in the gentoo side (gentoo partition).
source /etc/profile && env-update
#export PS1="(chroot) $PS1"
======================================
# /bin/bash
# chroot_to_gentoo3.pl (from linux 2)
#mount /dev/sda9 /mnt/gentoo ;
#mount /dev/sda8 /mnt/gentoo/boot ;
#mount -t proc none /mnt/gentoo/proc ;
# mount -o bind /dev /mnt/gentoo/dev ;
#/usr/sbin/chroot /mnt/gentoo /bin/bash
#source /etc/profile && env-update ;
#This has to be in the gentoo side (gentoo partition).
export PS1="(chroot) $PS1"
===============================
#/bin/bash
# exit_chroot.pl (from linux 1 after the command "exit" from linux 2)
#cd /home/acardh ;
umount /mnt/gentoo/boot /mnt/gentoo/dev /mnt/gentoo/proc /mnt/gentoo
=================================
Invalid atom in gentoo
Checking world for problems
'sys-apps/coldplugapp-admin/syslog-ng' is not a valid atom
Finished
====================
# emaint --fix world
Attempting to fix world
Finished
========================