Friday, January 27, 2012

Install ProFTPD on CentOS


Installing ProFTPD


Install another repository first.
vi /etc/yum.repos.d/dag.repo

And add
[dag]
name=DAG RPM Repository
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1
gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

Update the system and install Proftpd
yum update
yum install proftpd

Make Proftpd start at startup and start now:
chkconfig --levels 235 proftpd on
service proftpd start

Tuesday, January 3, 2012

Ho to disable IPv6 in Debian


With netstat I checked the listening processes:


netstat -tunlp


Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:389 0.0.0.0:* LISTEN 2226/slapd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2215/sshd
tcp6 0 0 :::389 :::* LISTEN 2226/slapd
tcp6 0 0 :::22 :::* LISTEN 2215/sshd

and lsmod showed something like this:

Module Size Used by
ipv6 235364 12
...

So, to disable IPv6 I changed /etc/modprobe.d/aliases:
...
# alias net-pf-10 ipv6
# Disable ipv6
alias net-pf-10 off
alias ipv6 off
...
I also disabled these lines in /etc/hosts to avoid confusions:
...
## The following lines are desirable for IPv6 capable hosts
#::1 localhost ip6-localhost ip6-loopback
#fe00::0 ip6-localnet
#ff00::0 ip6-mcastprefix
#ff02::1 ip6-allnodes
#ff02::2 ip6-allrouters
#ff02::3 ip6-allhosts
Finally I restarted the server.

shutdown -r now
Now the situation is like this:

netstat -tunlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:389 0.0.0.0:* LISTEN 2233/slapd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2216/sshd

lsmod|grep ipv6
...
No IPv6.

Thursday, December 8, 2011

Message: "The command prompt has been disabled by your administrator"


When you attempt to run CMD.exe or a batch file, you may receive the message "The command prompt has been disabled by your administrator". This is caused by restrictions placed in Registry. DisableCMDvalue is set to 1 or via Group Policy. To enable Task Manager, try any of these methods:

Method 1: Using the console registry tool
  • Click Start, Run and type this command exactly as given below: (better - Copy and paste)
Method 2: Edit the registry directly
  • Open Registry Editor (Regedit.exe) and navigate to:
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System]
  • In the right-pane, double-click DisableCMD and set it's data to 0
Method 3: Using Group Policy Editor in Windows XP Professional.
  • Click Start, Run, type gpedit.msc and click OK.
  • Navigate to User Configuration \ Administrative Templates \ System
  • Double-click the Prevent access to the command prompt

How to increase swap space on OpenSolaris 2008.11

su - root # become root

swap -sh
# find out how big your swapdevice is

zfs get volsize rpool/swap
# find out how big your ZFS swapdevice is

zfs set volsize=2G rpool/swap
# enlarge it to (eg:) 2G, 2048M, however you wish to denote it

init 6
# reboot


Thursday, July 28, 2011

Load balancing with Linux

We want to balance http traffic on a particular link to two backend web servers

User link: http://192.168.1.20

LoadBalancer: 192.168.1.10

Web Server 1: 192.168.1.4

Web Server 2: 192.168.1.5

Method 1

Install the balance module

aptitude install balance

/etc/network/interfaces

auto eth0:1

iface eth0:1 inet static

address 92.168.1.10

netmask 255.255.255.0

post-up /root/balance-script.sh

/root/balance-script.sh

/usr/sbin/balance -b 192.168.1.20 80 192.168.1.4:80 192.168.1.5:80 %

or

/usr/sbin/balance -b ::ffff:192.168.1.20 80 192.168.1.4:80 192.168.1.5:80 %

/etc/sysctl.conf

echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf

Set the web servers default gateway to the Loadbalancer and reboot.

Method 2

Coming soon!

Mac Time Machine to a network share

1. Open a Terminal window and paste this

  defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

2. Run this script to create a sparse bundle on your Desktop

http://db.tt/TF5nIQ0

3. Copy the sparsefile to the root folder of your network share,

4. Open Time Machine preferences and choose the network share, your backup should start in a few minutes

Install Tata Photon+ on a Mac

1. Download the drivers from here

http://www.tataphoton.com/tata-photon-download-dialer.aspx

or

http://www.huaweidevice.com/resource/mini/200910149695/testmobile1014/index.html

or

download this file, rename the extension to .zip and install the file in the .iso

http://gmiddlecote.files.wordpress.com/2011/05/rename_to_zip.pdf

2. After installing the packages, it will automatically add a device “HUAWEIMobile-Modem” to your Network Preferences

3. After selecting this option in Network Preferences we can add the following

Configuration: Default

Telephone Number: #777

Account Name: internet

Password:internet

4. Apply the changes and click "Connect"