Category Archives: Linux stuff

no sound debian wheezy

SCENARIO:
System: Debian Wheezy
Kernel: 3.2.0-3-amd64
Desktop: Xmonad
Sound: PulseAudio, Alsa

PROBLEM:
no sound at all

SOLUTION:
install pavucontrol and configure appropriately

 # aptitude install pavucontrol 

secure ftp server on centos

Prerequisites:
1. open external firewall (cisco, linksys,…) ports 20, 21, 990 and port range 49500:50000 to the local FTP server 192.168.xx.yy

* port range ports can be random ports higher than 49151 and lower than 65535

2. open firewall for port 20,21,990  and port range 49500:50000 on ftp server

# vim /etc/sysconfig/iptables 
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 20:21 -j ACCEPT 
-A RH-Firewall-1-INPUT -p udp -m state --state NEW -m udp --dport 20:21 -j ACCEPT 
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 990 -j ACCEPT 
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 49500:50000 -j ACCEPT 

3. in  /etc/sysconfig/iptables-config add ip_nat_ftp and ip_conntrack_ftp

IPTABLES_MODULES="ip_nat_ftp ip_conntrack_ftp"

Restart firewall

# /etc/sysconfig/iptables restart

4. configure selinux

# setsebool -P ftp_home_dir on

5. add ftp users

# useradd ftpuser ftpuser1 ftpuser2

Install VSFTPD
1. install vsftpd

# yum install vsftpd

2. install certificate

# openssl req -x509 -nodes -days 1825 -newkey rsa:1024 -keyout /etc/vsftpd/vsftpd.pem -out /etc/vsftpd/vsftpd.pem

3. Configure VSFTPD

add or change lines in /etc/vsftpd/vsftpd.conf

# vim /etc/vsftpd/vsftpd.conf
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=YES
ftpd_banner=Welcome to blabla FTP service.
chroot_list_enable=NO
chroot_list_file=/etc/vsftpd/chroot_list
listen=YES
log_ftp_protocol=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES

pasv_enable=YES
pasv_address=85.10.xx.zz (your public IP)
pasv_max_port=49500
pasv_min_port=50000
ssl_enable=YES

allow_anon_ssl=NO
force_local_data_ssl=NO
force_local_logins_ssl=YES
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO
rsa_cert_file=/etc/vsftpd/vsftpd.pem

4. Restart FTP server

# /etc/rc.d/init.d/vsftpd restart

Use ftp client wich support TLS AUTH to connect to the ftp server

I used mozilla plugin FireFTP or ftp-ssl (command line client)

URI:

http://wiki.vpslink.com/Configuring_vsftpd_for_secure_connections_%28TLS/SSL/SFTP%29
http://www.cyberciti.biz/tips/rhel-fedora-centos-vsftpd-installation.html

WordPress login problems

PROBLEM:

Unable to login to wordpress!!!

WordPress redirect you to –>

http://yourdomain.com/?redirect_to=http%3A%2F%2Fyourdomain%2Fwp-admin%2F&reauth=1

 

SOLUTION:

  1. Rename wordpress plugins directory ( site-root/wp-content/plugins ) to …plugins.old
  2. Restart or reload web server (apache, nginx,…)
  3. Login to wordpress
  4. Rename plugins directory back to original name ( plugins )
  5. Update all plugins
  6. Logout
  7. Login again. Now you can login to;
    1. http://yourdomain.com/wp-admin or
    2. http://youdomain.com/wp-login.php
  8. 🙂

 

debian updating perl locale error

If you have errors like —>

PROBLEM (ERRORS):
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = “UTF-8”,
LANG = “en_US.UTF-8”
are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

….while updating with aptitude update ; aptitude safe-upgrade then the solution to you problem is –>

SOLUTION:

# export LANGUAGE=en_US.UTF-8
# export LANG=en_US.UTF-8
# export LC_ALL=en_US.UTF-8
# locale-gen en_US.UTF-8

Create bootable linux usb key

1. Find live linux cd image (Ubuntu, Fedora, Debian,…) and download it to your computer

2. Create bootable usb key with dd;

# dd if=/path/to/linux-live.iso of=/dev/sdX 


X – usb key drive (use root not partition), example:

# dd if=/home/username/Downloads/Ubuntu-11.04-amd64.iso of=/dev/sdb

 

3. Boot from usb-key (while booting your computer press F12 and choose usb key to boot from)

It is as simple as that. 🙂

Linux on macbook …

Problems:

1. Bootup delay (20-30 sec)

SOLUTION:

Insert OSX disc, boot from it, open terminal and enter following:

bless –device /dev/disk0s2 –setBoot –legacy –verbose

where /dev/disk0s2 is the partition you installed grub (do ‘diskutil list’ to find out correct partition). Of course, ‘–verbose’ is optional. This makes Macbook EFI firmware boot your Linux installation in legacy mode without long delay (20s vs 3s).

url: http://regebro.wordpress.com/2008/11/16/installing-linux-on-a-macbook-without-os-x/

2. Not booting into Linux
No bootable device — insert boot disk and press any key

SOLUTION:
boot from linux instalation cd in rescue mode
Install gptsync
Execute

gptsync /dev/sda 

Upgrade to Zimbra 7.*

Platform Centos 5.5 32bit
Previous version of Zimbra 6.0.12

1. Download zcs 7 with wget;

[root@server ~]# wget http://files.zimbra.com/downloads/7.0.1_GA/zcs-7.0.1_GA_3105.RHEL5.20110304210448.tgz

2. Unpack zcs 7 in current directory;

[root@server ~]# tar xvzf zcs-7.0.1*

3. Change directory to zsc-7.0.1*;

[root@server ~]# cd zcs-7.0.1*

4. Install zcs 7 on Centos 5.5 with –platform-override ;

[root@server zcs*]#./install.sh -s --platform-override

5. Configure zcs 7;

[root@server ~]# /opt/zimbra/libexec/zmsetup.pl

If you have problems in this step;

PROBLEM:

[zimbra@server log]$tail -f mysql_error.log

110402 21:27:40 [ERROR] Can’t open shared library ‘/opt/zimbra/mysql-standard-5.1.55-pc-linux-gnu-i686-glibc23/lib/mysql/plugin/ha_innodb_plugin.so’ (errno: 0 cannot restore segment prot after reloc: Permission denied)

110402 21:27:40 [ERROR] Couldn’t load plugin named ‘innodb’ with soname ‘ha_innodb_plugin.so’.

/opt/zimbra/mysql/libexec/mysqld: Table ‘mysql.plugin’ doesn’t exist

110402 21:27:40 [ERROR] Can’t open the mysql.plugin table. Please run mysql_upgrade to create it.

SOLUTION: disable selinux with

[root@server ~]# setenforce 0

6. Restart zimbra service;

[root@server ~]# service zimbra restart

There is no documents tab anymore. But all documents are now under Briefcase tab in Notebook map.

md raid not rebulding — resync=pending

You have problems with automatic rebuilding raid 1 (md) on debian (resync=PENDING)?

mdX : active (auto-read-only) raid1 sdaY[0] sdbY[1]

      2000000 blocks [2/2] [UU]

      	resync=PENDING

do;


mdadm --readwrite /dev/mdX

and the process of rebuilding starts


[===>...]  resync = 16.2% (324736/2000000) finish=0.6min speed=46390K/sec