Ralfs
Linux Snippets
The Red Hat by Madalina Iordache

Linux commands

System Setup

Syslog:

# (from Fedora < 8 was /etc/syslog.conf)
$ nano /etc/rsyslog.conf
# go to bottom
*.*                             /dev/tty12

Aliases:

$ nano /etc/bashrc
# go to bottom
alias df='df -h'
alias psg='ps aux|grep -E'
alias nano='nano -w'
alias scp='scp -p'

Environment:

$ nano /etc/profile
# go to bottom
# add proxy entries
PROXY=http://192.168.9.1:8080
HTTP_PROXY=http://192.168.9.1:8080
NO_PROXY="127.0.0.0/8,192.168.0.0/16,mypc.mydomain"
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL PROXY HTTP_PROXY NO_PROXY

Box

$ nano /etc/sysconfig/network
replace "localhost.localdomain" with your host and domain name.
NETWORKING=yes
HOSTNAME=box.domain.org

Scripts

My IP Address
$ nano ~/bin/myipaddr
#!/bin/sh
MYADDR=`/sbin/ifconfig $1 2>/dev/null |grep inet |cut -f2 -d: |cut -f1 -d' '`
echo $MYADDR
$ chmod a+x ~/bin/myipaddr
Usage:
myipaddr eth1

Software

Fedora

Additional software

First set up needed repositories.
RPM Fusion
rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm \
     http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
Usable software:
# System
yum -y install mc
yum -y install iptraf ethtool units udftools usbutils
yum -y install memtest86+
yum -y install lshw lshw-gui
yum -y install syslinux fuse-sshfs fsarchiver partimage
yum -y install foremost                    # Recover files
# yum -y install mkinitrd ( in dracut )
yum -y install postfix

# Wireless
yum -y install wicd wicd-common wicd-curses wicd-gtk

# Archiving
# Not in Fedora, but in RPM Fusion: lha unace unrar
yum -y install cabextract arj p7zip upx ucl lha unace unrar

# Development
yum -y install tidy libtidy perltidy php-tidy
# for HTML Validator extension for Firefox
yum -y install compat-libstdc++-33
yum -y install w3c-markup-validator
yum -y install gcc gcc-c++ gcc-java
yum -y install java-1.5.0-gcj-devel
yum -y install php php-pear-DB php-mysql php-mbstring
yum -y install php-manual-en
yum -y install perl-CPAN
yum -y install kernel-devel
yum -y install kdewebdev cssed kdiff3
yum -y install qt-creator qt-demos qt-devel qt-doc qt-examples qt-mysql qt-sqlite
yum -y install gtk2-devel gtk2-engines
yum -y install kxml kxml-javadoc
# for x86_64:
yum -y install glibc-devel.i686

### Eclipse Plug-Ins:
# eclipse-cdt-sdk:    C/C++ Development Tools (CDT) SDK
# eclipse-epic:       Perl Eclipse plugin
# eclipse-phpeclipse: PHP Eclipse plugin
# eclipse-quickrex:   Regular-expression test
# eclipse-shelled:    Eclipse Shell script editor
# eclipse-gef:        Graphical Editing Framework (GEF)
yum -y install eclipse-cdt-sdk eclipse-epic eclipse-phpeclipse \
 eclipse-quickrex eclipse-shelled eclipse-gef

# DataBases:
# yum -y install mysql-administrator mysql-query-browser  # F13 nomore ?
# MySQL++ is a C++ wrapper
yum -y install mysql-devel mysql++ mysql-connector-c++ mysql-connector-c++-devel \
 mysql-connector-java mysql++-manuals
yum -y install sqliteman sqlite-devel
yum -y install perl-DBD-SQLite perl-DBD-XBase
# yum -y install pgadmin3

# Additional tools:
yum -y install gqview xpdf       # mc viewers
yum -y install pwgen htmldoc squashfs-tools
yum -y install nmap-frontend fwbuilder
yum -y install gimp-help qt3-config
yum -y install qemu qemu-img qemu-launcher kvm
yum -y install dia lyx joe tigervnc-server
yum -y install gconf-editor      # NO more: system-config-display
yum -y install kde-plasma-translatoid
yum -y install ksensors kdirstat
yum -y install dvd95 nrg2iso
# Bluetooth related:
# kdebluetooth NOT AVAILABLE !!!
yum -y install bluez-hcidump pulseaudio-module-bluetooth amora bluez-alsa
yum -y install libreoffice-base libreoffice-javafilter \
 libreoffice-headless libreoffice-opensymbol-fonts libreoffice-writer2xhtml \
 libreoffice-wiki-publisher libreoffice-bsh
yum -y install bitstream-vera-sans-fonts \
 bitstream-vera-sans-mono-fonts bitstream-vera-serif-fonts
yum -y install smolt-gui
yum -y install conglomerate ooo2txt
# yum -y install kde-l10n-Latvian

# SIPphone
### NAVA: yum -y install kphone

# Edutainment
# periodic table of the elements
# yum -y install gperiodic  -- No package gperiodic available
yum -y install stellarium
# fractal:
yum -y install xaos gnofract4d

# Games:
yum -y install kdegames games-menus kdetoys
yum -y install pinball frozen-bubble
# PlanetPenguin Racer is an OpenGL racing game (was ppracer)
# Extreme Tux Racer 
yum -y install extremetuxracer
# Njam is a full-featured cross-platform pacman-like game written in C++ using SDL library
yum -y install njam
TORCS is a 3D racing cars simulator using OpenGL.
yum -y install torcs

Multimedia

Install multimedia from repo's:

# Multimedia
yum -y install lame
yum -y install ffmpeg transcode mjpegtools
yum -y install mplayer mencoder mplayer-gui mplayer-doc smplayer
yum -y install v4l-utils v4l2ucp
yum -y install vlc
yum -y install xine xine-lib-extras xine-lib-extras-freeworld xine-plugin
yum -y install xawtv
yum -y install k3b-extras-freeworld
yum -y install grip kid3 tagtool easytag
yum -y install gstreamer-ffmpeg gstreamer-plugins-bad gstreamer-plugins-ugly
yum -y install pavucontrol pavumeter pulseaudio-module-zeroconf \
 pulseaudio-libs-zeroconf pulseaudio-esound-compat padevchooser \
 paprefs paman
# yum -y install xmms* xmms-mp3 xmms-lirc xmms-wma xmms-skins xmms-scrobbler xmms-xosd
# yum -y install cinelerra

# DVD
yum -y install dvdauthor DVDAuthorWizard dvdbackup \
 dvdrip dvdrip-master DVDRipOMatic dvdstyler dvd-slideshow lsdvd lxdvdrip \
 streamdvd streamdvd-gui streamdvd-streamanalyze

# DVB
yum -y install dvb-apps
Needed?:
yum -y install libmpeg3
yum -y install kaffeine
yum -y install xine-lib-devel

Skype

You can use rpm package:
yum -y install libsigc++20 dbus-qt qt4 qt4-x11
# Fedora 10 have libsigc++20 dbus-qt; Not need qt4 qt4-x11
rpm -i skype-2.0.0.72-fc5.i586.rpm

### For x86_64:
yum -y install qt.i686 qt-x11.i686 alsa-lib.i686 libXv.i686 libXScrnSaver.i686
Better use yum:
nano /etc/yum.repos.d/skype.repo
[skype]
name=Skype Repository
baseurl=http://download.skype.com/linux/repos/fedora/updates/i586/
gpgkey=http://www.skype.com/products/skype/linux/rpm-public-key.asc
gpgcheck=0
enabled=1
# NEIET: rpm --import http://www.skype.com/products/skype/linux/rpm-public-key.asc
# TAPEC: gpgcheck=0
yum -y install skype

VirtualBox.org

Add the VirtualBox repo file to /etc/yum.repos.d/
nano /etc/yum.repos.d/virtualbox.repo
[virtualbox]
name=Fedora $releasever - $basearch - VirtualBox
baseurl=http://download.virtualbox.org/virtualbox/rpm/fedora/$releasever/$basearch
enabled=1
gpgcheck=1
gpgkey=http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc
yum -y install VirtualBox-4.1

Google Chrome

Add Google YUM repository to file: /etc/yum.repos.d/google.repo
32-bit
[google-chrome]
name=google-chrome - 32-bit
baseurl=http://dl.google.com/linux/chrome/rpm/stable/i386
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
64-bit
[google-chrome]
name=google-chrome - 64-bit
baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
Note: Both 32-bit and 64-bit repos can be placed in the same file.
yum -y install google-chrome-stable
# or
#yum install google-chrome-beta
#yum install google-chrome-unstable

Other

Links

Software

Hardware