CentOS Local Repository

At home I am having very slow internet connection, which becomes pain while downloading packages with yum. To make this process faster I have created local repository from CentOS media.
After installing CentOS you should have /etc/yum.repos.d/CentOS-Media.repo. We will be using the same repo file to create our local repository. Adjust the existing repo file as per our need

# CentOS-Media.repo
#
# This repo is used to mount the default locations for a CDROM / DVD on
#  CentOS-5.  You can use this repo and yum to install items directly off the
#  DVD ISO that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
#  yum --enablerepo=c5-media [command]
#
# or for ONLY the media repo, do this:
#
#  yum --disablerepo=\* --enablerepo=c5-media [command]
[c5-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/
        file:///media/cdrom/
        file:///media/cdrecorder/
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

Now we need to mount cdrom to /media/CentOS/ or /media/cdrom/ or /media/cdrecorder/. I am having iso image of CentOS, so I will be mounting the same image at /media/cdrom

mount CentOS.iso /media/cdrom -o loop

How to use:

yum --enablerepo=c5-media install package_name

Emptying Trash from Shell

Ever want to empty your Trash folder from command prompt. Then you can run following commands to do the trick

rm -rf /home/username/.local/share/Trash/info/* 
rm -rf /home/username/.local/share/Trash/files/*

Above you just need to provide username of whom you need to empty Trash file. I have tested it on Fedora and on Ubuntu with gnome.

Youtube Downloader for Linux

Update: If you are getting “ERROR: no fmt_url_map or conn information found in video info” please download the latest binary file from https://raw.github.com/phihag/youtube-dl/master/youtube-dl and use the new file instead of old one.

Every time it is not possible to me to watch the video online on youtube. Some time for reference purpose I have to download the video to see them offline or while traveling. On Ubuntu/Fedora you can download youtube videos via command line. You need to install youtube downloader on your machine to download the videos.

Installing Youtube downloader via apt,

apt-get install youtube-dl

Installing Youtube downloader via yum,

yum install youtube-dl.noarch

How to use Youtube downloader
Using Youtube downloader is very easy. You have to provide Youtube video url for downloading the video.

youtube-dl video_url

Disable ipv6 in Ubuntu

To disable ipv6 in ubuntu server,

vi /etc/default/grub

Append “ipv6.disable=1″ to GRUB_CMDLINE_LINUX_DEFAULT as below,

GRUB_CMDLINE_LINUX_DEFAULT=”quiet ipv6.disable=1

Then do,

update-grub

Appletalk on Fedora

Configure your linux box to be a Mac file server using netatalk afpd and avahi-daemon

This install was done on a Fedora 11 system
Install Netatalk Afpd and Avahi-Daemon

yum install netatalk avahi

Configure Appletalk Netatalk

vi /etc/atalk/afpd.conf

Add the following to the end of the file:

- -noddp -tcp -uamlist uams_randnum.so,uams_dhx.so,uams_dhx2.so -nosavepassword -advertise_ssh

Configure Netatalk to only start the services we need

vi /etc/atalk/netatalk.conf

Change the following values:

ATALKD_RUN=no
PAPD_RUN=no
CNID_METAD_RUN=yes
AFPD_RUN=yes
TIMELORD_RUN=no
A2BOOT_RUN=no

Configure Netatalk to share our folders

vi /etc/atalk/AppleVolumes.default

Syntax:

allow: users and groups allowed to access share

rwlist: users and groups allowed read and write access

Change  to your users separated by commas jim.bob.doug

Change <@group> to your groups separated by commas @accounting, @marketing (keep the @ infront of the group name)

* Users and Groups must already exist in Linux

Add for Users Home Folders:

~/ "$u" allow: rwlist:,<@group> cnidscheme:cdb

Add a folder:

/home/folder  allow:,<@group> rwlist:,<@group> cnidscheme:cdb options:usedots,upriv

Configure Avahi and mDNS (linux version of bonjour)

We need to configure Avahi and mDNS so the Mac computers on the network can find our Appletalk file server
We need to create a service file for our afpd service:

vi /etc/avahi/services/afpd.service

Add the following:

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h Xserve</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
<service>
<type>_device-info._tcp</type>
<port>0</port>
<txt-record>model=Xserve</txt-record>
</service>
</service-group>

Add mDNS to nsswitch

vi /etc/nsswitch.conf

Add mdns to the line hosts:

hosts:      files dns mdns

Configure Appletalk to start at system startup

chkconfig atalk
chkconfig avahi-daemon

Start Appletalk and Avahi (Bonjour)

service atalk start
service avahi-daemon start

Open Firewall Ports
port: 548 tcp

Check that Netatalk service started properly:

nbplkup
                      localhost:AFPServer                          65280.31:128
                     "localhost:netatalk"                          65280.31:4
                     "localhost:Workstation"                       65280.31:4

Credits

Page 20 of 36« First...10«181920212223»30...Last »
rss twitter facbook

Categories

Archives