Saturday, September 15, 2007

Turn on NumLock at system startup

root access needed ....

Add this to /etc/rc.d/rc.local :

for tty in /dev/tty[1-6]; do
/usr/bin/setleds -D +num < $tty
done

and make sure /etc/rc.d/rc.local is executable.
That's it!

Additionally, if you want NumLock on when kde starts up, go to
Kmenu -> Control Center -> Peripherals -> Keyboard

and check "turn on" for "NumLock on KDE Startup" (no root access required).


Splash Screen for KDE

Some nice Slackware Splash Screens:

FBSlackware

Tux Splash Collection

This is how I got them to work on my computer:

- download the tar.gz file and store it somewhere (do not unpack it)
- go to Control Center -> Appearence and Themes -> Splash Screen
- click "Add..." and browse for the downloaded archive.
- Test and Apply the new splash screen.

Customizing Environment

Let's do a little tweaking to customize the environment (add color to the command prompt, disable beep, set up aliased commands and custom paths)
We'l do a general settings customization and then a local one.

1.First, let's make the general settings file called custom.sh in the /etc/profile.d directory.

as root:
mcedit /etc/profile.d/custom.sh


contents of this file:

#!/bin/bash

# environment customization script

# make the command prompt red for root and green for other users
if [ `id -u` = "0" ]; then
PS1="\e[0;31m\u@\h:\w\$ \e[m"
else
PS1="\e[0;32m\u@\h:\w\$ \e[m"
fi

export PS1

#disable beep
setterm -bfreq 0



now save the file and make it executable

chmod +x /etc/profile.d/custom.sh

[The only change to the command prompt is the color. You can further customize the prompt to suit your needs. This is a very nice tutorial.]

2. Now we'll make some personal customization settings for our current user.

create a file called .bash_profile in your home directory

as current user:
mcedit ~/.bash_profile

contents:

#!/bin/bash

if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi


now, create a file called .bashrc that will contain the actual customizations

mcedit ~/.basrc

contents:

#!/bin/bash
export PATH="$PATH:$HOME/bin"
now='date +"%A - %d %B %Y - %H : %M"'
alias shutdown="su -c 'poweroff;exit'"
alias restart,reboot="su -c 'shutdown -t5 -r now;exit'"


You can add any customization you like in this file.
I have a bin directory in my home directory for my personal scripts, so I added the path to that directory to the current path, so that I can call the scripts directly from the command prompt.
Also I made a small alias for the date command to display it in a custom format. For more info type man date
I also added aliases for shutting down and restarting the computer.



Monday, September 10, 2007

Kmenu Icon

Let's change that [K] Icon with something more appropriate for Slackware!

before:

after:
You will need root access for this!

First of all you will need a new icon for your Kmenu. You can get a nice one here.
Then go to
/usr/share/icons
and identify the icon theme you are currently using, for example crystalsvg.
You may want to backup the files in this directory, just in case you change your mind later.
Then, go to that theme directory and replace the kmenu.png file with the new one for each size from 16x16 to 128x128.

Restart KDE and enjoy!


You could also install a whole new icon theme that includes the slackware kmenu icon, like this one.
Download, unpack and copy to the /usr/share/icons directory.

KDE Menu Sidebar Image Improvement [KMSBII]

Now this is really cool!

before:
after:

Go here and download it!
unpack, and then
./install.sh user (only for you)
or
./install.sh system (for everyone)

Thank you Ivan Lezhnjov Jr. !!!

Friday, September 07, 2007

Slackware Theme For Lilo

A Very Nice Slackware Theme for LILO!

Info and download @ kdelook.org

Flash Support in Firefox

Download the Flash Player Plugin package from linuxpackages.net and install it with pkgtool.
Restart Firefox and enjoy.

http://www.linuxpackages.net/pkg_details.php?id=11203

Slackware Update

I keep my box updated with SlackPkg.

Slackpkg is a tool for installing or upgrading packages through network.

You can find this in the extra directory of you Slackware Disc or download it form slackpkg.sourceforge.net

Then
installpkg slackpkg-2.61-norach-2.tgz

Before running slackpkg make sure you edit the file

/etc/slackpkg/mirrors

and uncomment only one mirror.
WARNING: The mirrors file is not updated for Slackware 12. So, when you find a mirror that suits you, uncomment it and change 11.0 to 12.0 in the url

Then, save the file and run:
slackpkg update
This will synchronize the package list so that slackpkg will know which packages need to be updated.

To install new packages:
slackpkg install-new
To upgrade your existing packages:
slackpkg upgrade-all



KMysqldmin

This is a nice KDE application for managing your MySQL Server.
Unfortunately it is no longer maintained.
At this time there is no package for Slackware 12 so I installed it from source:
tar -xvzf kmysqladmin-0.7.2.tar.gz
cd kmysqladmin-0.7.2
./configure
make
make install

www.alwins-world.de/wiki/programs/kmysqladmin

MySQL Configuration

You need root privileges for this.
You should already have a mysql group and user. if not, create them with

groupadd mysql
useradd -g mysql mysql

1. You need to make sure mysql has rights to it's folder. So
chown -R mysql:mysql /var/lib/mysql
2. Install the default database
su mysql
mysql_install_db
exit
3. Create the configuration file from the example one:
cp /etc/my-medium.cnf /etc/my.cnf
4. Restart MySQL:
/etc/rc.d/rc.mysqld stop
/etc/rc.d/rc.mysqld start
5. Create a root password:
/usr/bin/mysqladmin -u root -h localhost password 'yourpasswordhere'

HTTPD (Apache) Server Configuration

All these customizations are made by editing the apache configuration file located at /etc/httpd/httpd.conf
You need to edit this file as root.
After you made the changes don't forget to save the file and restart the server:
/etc/rc.d/rc.httpd stop
/etc/rc.d/rc.httpd start

1. ServerAdmin
Find the line that says
ServerAdmin you@example.com
and change the address to your e-mail address

2. Server Port
If your ISP has blocked port 80 you can still make sure your server can be accessed from outside if you use a custom port number.
Find a line that says
Listen 80
or
Listen 12.34.56.78:80
and change it to
Listen:xxxx
where xxxx is the port number you wish to use for the server.
For example my server uses the 1980 port, so in my file the line says
Listen:1980

3. PHP is disabled in the default httpd intallation.
To test this, create e new php file and put in in your htdocs directory (usually /var/www/htdocs) and then try to access it through you web browser (eg. http://localhost/test.php). If it shows the code, PHP is disabled in your server configuration.
To enable PHP find a line that says:
Include /etc/httpd/mod_php.conf
Uncomment this line to enable PHP

4. PHP Configuration options for security and comercial server compatibility:
(modifications be made to /etc/httpd/php.ini )

short_open_tag = On
safe_mode = On
disable_functions = phpinfo, exec, system, shell_exec,proc_open, openlog, pfsockopen, popen, syslog, closelog, fsockopen, passthru, escapeshellarg, escapeshellcmd, proc_close, proc_get_status, proc_nice, proc_teminate
(no spaces between values; it is done this way here only to be readable in the blog)
disable_classes = exec
max_input_time = 30
max_execution_time = 30
memory_limit = 10M
error_reporting = E_ALL
display_errors = On
display_startup_errors = On
register_globals = Off
post_max_size = 2M
magic_quotes_gpg = Off
magic_quotes_runtime = Off
always_populate_raw_post_data = Off
upload_tmp_dir = /tmp/php
(you have to create this)
allow_url_fopen = Off
allow_url_include = Off
SMTP = localhost
(or better, your ISP's)
smtp_port = 25
sendmail_from = your email address
sendmail_path = /usr/sbin/sendmail -t -i

Format a Floppy Disk

1. Open up a console and, as root, type

fdisk /dev/fd0

2. Type d to delete partitions. If it says "Selected partition 1" go to next step.
If it says "partition number: 1-4" type 1 and repeat for all partitions.

3. Type o to create a new empty DOS partition table

4. Type n to create a new partition and then p (primary partition). Select 1 as the partition number and press [ENTER] to accept the default values for first cylinder and last cylinder.

5. Type w to save the changes and exit fdisk

Saturday, September 01, 2007

Shilo is a geek!

Shilo has many useful Slackware tips on his website. This is a must for any Slackware newbie! Very well organized too. Great job Shilo!

http://shilo.is-a-geek.com/

Welcome Gentle Reader!

This is my Slackware Linux Blog, describing the settings and customization I use to personalize my Slackware 12.0 install. I'm a beginner in Linux in general and Slackware in particular, so I make no guarantee that the tips listed here will work on your computer. I works on mine, this is how I do it, and I hope someone else will find it useful.