Showing posts with label Unix Linux System Administration. Show all posts
Showing posts with label Unix Linux System Administration. Show all posts

January 12, 2007

Three Linux Modules Commands

Sometimes, you need to load some sort of support to your Linux kernel. Instead of having to compile every time you want to add or remove some hardware support to the kernel for example, you can use loadable modules instead. Here a three of the most common Linux modules commands. The are pretty straightforward to use. If you run into any problems, consult the man page for the command.

# man lsmod (etc..)

lsmod - program to show the status of modules in the Linux Kernel
rmmod - simple program to remove a module from the Linux Kernel
modprobe - program to add and remove modules from the Linux Kernel
See /etc/modprobe.conf

December 6, 2006

Some basic Unix Linux commands short description

cd - change the working directory
rm - remove files or directories
mv - move (rename) files
mkdir - make directories
cp - copy files and directories
touch - change file timestamps
chmod - change file access permissions
chown - change file owner and group
useradd - Create a new user or update default new user information
usermod - Modify a user account
groupadd - Create a new group
groupmod - modify a group
passwd - update a user's authentication tokens(s)
chage - change user password expiry information
find - find files
locate - find files by name
udpatedb - update a database for mlocate
ps - report a snapshot of the current processes.
pstree - display a tree of processes
yum - RPM installer/updater
clear - clear the terminal screen
vim - Vi IMproved, a programmers text editor


November 19, 2006

Unix Linux or any paperback manuals


Or any paperback book covering the IT field, is usually heavy and takes a lot of the free space in
my backpack. I have tried to use the pdf files from the books, to read them from my mobile phone or pda, but the starring at colorful screen makes my eyes tired, so I bring the book instead.
Finally, Sony has a piece of hardware that could resolve the "problem". The have developed the Sony PRS-500, with E-ink technology from MIT. This peace of work could save my back and eyes. The E-ink uses micropulses and black and white nanoparticles to take care of the issues with reading tons of manuals. A full battery lasts about 7.500 pages, or 25 books. If there is good search feature, this baby rocks! Check it out, at sonystyle.com

June 23, 2006

Unix/Linux hacks and confs

I haven't had time to blog for a while, but I have an arsenal of Unix hacks to post about, so just stay put fellas. The world of Unix Linux is turning into virtualization, it seems. This has it's pros and cons of course, mostly pros in my opinion, as you will need less servers to provide your services. The investment will also be greater, at least initially, as virtualization can be rather expensive. But if you are administrating lots of servers, this might be worth the extra bucks, as the administration will be much easiser and smoother.

April 5, 2006

Good Unix Linux Hacking Music Chronix Radio

Wednesday morning, woke up on the sofa, after being departed there by wify for snoring. Kissed my boys and wife good bye and took the subway to work as usual.
Put on my mp3 player and listened to my Gig of music. Tired of the same tunes, I googled for
a good metal shoutcast station. And there it was. Chronix Radio, Yes, yes, yes.
My adrenaline level started to get back on a comfortable level again. The workflow
accelerated and everything felt just great again. Thank you for the great shoutcast broadcast of metal music guys.

http://www.chronixradio.com/


Song: "open" Album: the Nothing Artist: Sap Label: TJO Records

Good hacking music.
Song: "Crawl Through Knives" Album: Come Clarity Artist: In Flames Label: Ferret Records

Song: "Taste My..." Album: Pass Out Of Existence Artist: Chimaira Label: Roadrunner Records

Song: "Into The Darkness (Vocal Remix)" Album: Until The End Artist: Kittie Label: Artemis Records

Song: "Death Rattle" Album: Reinventing The Steel Artist: Pantera Label:

Song: "Surfacing" Album: Slipknot Artist: Slipknot Label: Roadrunner Records

Song: "In A Zone" Album: Stomp 442 Artist: Anthrax Label: Edoya

Song: "Slave The Way(Remix)" Album: Nerve Damage Disk 1 Artist: Skinlab Label: Century Media


RAMMSTEIN - MANN GEGEN MANN
SILENCER - THE HARVEST
JUDAS PRIEST - REVOLUTION
ROB ZOMBIE - FOXY FOXY
PLACEBO - SONG TO SAY GOODBYE
BAD RELIGION - PUNK ROCK SONG
WHITE STRIPES - MY DOORBELL
DECAPITATED - REVELATION OF EXISTENCE lyrics

March 27, 2006

Simple hack getting xchat, iirc, ftp, wget, lynx and other protocols, through squid proxy, and other Unix/Linux proxies.

Here is a simple little Linux/Unix hack, If you are having a problem getting your packets through a proxy with iirc, xchat, lynx, wget, ftp or some other application or tool.

The symptoms for not getting through the proxy is usually a session time out. The applicatons sends it's SYN packets, but will never recieve any from
the non responding server on the other end of the TCP handshake.

Three way handshake TCP

Client Server

1) SYN 2) SYN-ACK
3) ACK


If you're proxy allows, you can always try to export a http_proxy or ftp_proxy, (works with squid)

Examples,

$ export http_proxy=1.2.3.4:8081 (ip address and port number, usually 8080, 8081 of the proxy server)

or/and


$ export ftp_proxy=1.2.3.4:8081 (ip address and port number of the proxy server)

To verify that the environment variable for http/ftp proxy is set, just echo
$ echo $http_proxy

You should see http://ip.address.of.proxy:port_number

Make sure you include the $ sign. $http_proxy, $ftp_proxy

March 22, 2006

Linux and Unix useful command list, mini version, ping, netstat, ifconfig iptables

Unix/Linux useful commands, mini version

For troubleshooting a Linux system you might,
want to try one of the following Linux commands.
These commands and flags might not be viable on everyones system.

# lspci list all your pci devices
# dhclient eth0 renew your dhcp release
# ifconfig wlan0 check your wireless network configuration
# netstat -arn show your network route information
# netstat -ap 2 | grep EST show established connections, updates every 2 sec
# netstat -Cr print routing information from routing cache
# iptables -nL show your current iptables configuration in numeric form
# ping ping 127.0.0.1 or network ip address for ICMP replies
# ping -c ping X times.
# ping6 ping ipv6 addresses
# dmesg print or control the kernel ring buffer, bootup messages
# dmesg | grep eth0 if you missed the bootup sequence, and need to check eth0
# nmap -vvv localhost scan yourself for open ports, vvv = extra verbose
# ssh secure shell, encrypted remote login program, client
# ssh -l user host ssh as user to host, ssh -l donald server1.sshexample.com
# uptime check your linux servers uptime and load

March 16, 2006

Mini howto for Red Hat Linux Network and Internet Services

Mini howto for Linux Network and Internet services, using chkconfig
and service commands.

Easy way in Red Hat is by using the service command.
Swith to user root. su -
If you don't you will get bash: chkconfig: command not found

# service httpd stop
# service httpd start

This will not make permanent changes in you run control directories.
So if you want to make a permanent change to the run control
for a service, you will have to issue the chkconfig command.

Like this,

# chkconfig httpd off

Verify it with

# chkconfig --list httpd

You will see something like this in your output.

httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off

So the next time you reboot, httpd will not start by
the run control scripts. You may of course be able to start it
manually with the command (as user root)

# service httpd start

If you really want to make sure the httpd process is up,
you can check the daemon and if it is listening on your network
interface. (Ready to accept connections from the network)

$ ps -ef | grep httpd
$ netstat -ap | grep http

The output from the ps command should look something like this
root 23291 1 0 Mar11 ? 00:00:02 /usr/sbin/httpd
apache 22444 32227 0 Mar 11 ? 00:00:34 /usr/sbin/httpd

The output should look something like this. (netstat)
tcp 0 0 *:http *:* LISTEN -

These command goes for all services listed by the
# chkconfig --list

March 7, 2006

Unix Linux Install Command List and Mini Guide

This mini guide is ment to be of some help for rookies on Linux/Unix started on
installing applications and software on Unix/Linux systems.

Install Howto, commands, mini guide.


Unix Systems/Dialects

Solaris/SunOS Examples: As user root. ( # sign = root, $ sign = user )

# pkgadd -d gcc-2.95.2-sol7-sparc-local (Installs solaris package)
# pkginfo -l (Verify installation)
# pkgrm (Remove package, you will have to answer yes/no)
# patchadd /var/spool/patch/104945-02


Linux Systems/Dialects

Red Hat, Examples: As user root. (# symbolizes user root)

# rpm -ivh kernel-2.6.9-5.EL.rpm (Install command)
# rpm -q kernel-2.6.9-5.EL.rpm (Query/Verify)
# rpm -e kernel-2.6.9-5.EL.rpm (Remove/Delete)


Debian, Examples: As user root.

# apt-get install xchat
# apt-get remove gnome-panel
# apt-get update (update to the latest package info)
# apt-get -u upgrade

# apt-get -u dist-upgrade (upgrade to a new release)


SuSE

Same as Red Hat.

GCC Gnu Cross Compiler

When downloading the source code in a tarball format, you will
usually need to decompress the files. This is done with tar, bunzip,
gunzip, or unzip, depending on how the file is packed.

Linux Magazines Review

Imagine sitting down, after a long days work, in your favorite sofa/chair, the kids sleeping, just you and a fresh issue of Linux Journal or/and Sys Admin Magazine, a hot cup of tea or coffee and some snacks. After reading a while, your creative mind starts to go europhoric with all brand new ideas and inspiration you just got. You just have to sit down all night until dawn and hack your keyboard away. Isn't that a *nix Utopia of a fantastic night at home or what!?


Linux Magazine Review. My subjective (completely personal) review.
Sys Admin Review. My subjective (completely personal) review.

As of today, the flora of Linux magazines is peaking, there is virtually not a single serious computer magazine not mentioning Linux, and the range of "pure Linux magazines is long as shellcode eggdrop soon. Among my personal favorites in the Linux/Unix
sphere of magazines, is Linux Journal Magazine and Sys Admin Magazine, they both have my warmest
recommendations.

What so nice with these two Linux/Unix magazines is the short but
informative articles on system administrator tasks. You can pick up some
very hefty knowledge in practically no time. They are great on their coverage
of the latest trends and visions. Excellent writers and editors.

Some of the top Unix/Linux/Developers/Coder profiles contributes with information and articles. The magazines covers all different Unix and Linux flavors. AIX, Solaris, Red Hat, SuSE, Debian, HP-UX, IRIX, Slackware, SCO, Knoppix. Programming languages, perl, python, java etc. Linux Journal and Sys Admin complement each other, Linux Journal brings you review a lot of the latest open source software, Sys Admin, more conservative, and more in depth technical articles. The best of two *nix worlds.


December 27, 2005

Iptables

One of the most useful firewalls for the Linux operating system is netfilters iptables
It's doesn't make your Linux box 100% secure of intrusion, but It sure makes a sys admins sleep better at night.
Netfilter/Iptables has a great deal of features which I won't cover in detail here, but I will post some of my own little useful hacks. With iptables you can of course do packet filtering and other basic firewall operations, but that's not all. You can also setup NAT/SNAT, redirects, time-based rules, transfer quotas, specifying multiple ports in ONE rule, load balancing, matching against a string in a packet's data payload, packet matching based on TTL values and much more.
This is a great software firewall in my humble opinion, and it's open source. So what are you waiting for??

December 14, 2005

NTP time synchronizing clients and servers, Unix Linux style

One major important thing in any server environment is time. Without syncronised time between the servers, a great deal of applications wouldn't work properly. If you're new to the NTP protocol, I recommend that you read the RFC for NTP. The NTP protocol is other words, very crucial for a serverfarm to work. I won't list all the things that could wrong if you don't sync, but do yourself a favour if your a Unix/Linux/Windoze sys admin. SYNC it Now, or don't and get f-cked up authentications, syncs, backups, etc.

http://www.ietf.org/rfc/rfc1305.txt

A list of public stratum 1 time servers.

http://ntp.isc.org/bin/view/Servers/StratumOneTimeServers

Red Hat NTP servers.

clock.redhat.com
clock2.redhat.com

Command for immediate synchronization
# ntpdate clock.redhat.com

Configurations files for the NTP protocol can be found under /etc/ntp on Red Hat and SuSE systems.

-rw-r--r-- 1 root root 0 Oct 11 2004 step-tickers
-rw------- 1 root root 266 Oct 11 2004 keys
-rw-r--r-- 1 root root 186 Dec 13 2004 ntpservers

# man ntpd
Network Time Protocol (NTP) daemon

December 2, 2005

fdisk output from /dev/hda

[root@mimir ~]# fdisk /dev/hda

The number of cylinders for this disk is set to 2432.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/hda: 20.0 GB, 20003880960 bytes
255 heads, 63 sectors/track, 2432 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 778 6144862+ 83 Linux
/dev/hda3 779 1415 5116702+ 83 Linux
/dev/hda4 1416 2432 8169052+ 5 Extended
/dev/hda5 1416 1925 4096543+ 83 Linux
/dev/hda6 1926 1990 522081 82 Linux swap
/dev/hda7 1991 2432 3550333+ 83 Linux