Friday, June 27, 2014

Setup FTP server

CentOS

# yum install vsftpd ftp -y
http://www.unixmen.com/install-vsftpd-server-on-centos-rhel-scientific-linux-6-4/

FTP login uses plain/clear text, you can use SFTP to encrypt the login

If you have following problem when use FTP to login:
Name (localhost:dbadmin): username
331 Please specify the password.
Password:
500 OOPS: cannot change directory:/home/username
Login failed.
ftp> 

You just need to disable selinux and reboot

To disable permanently, I edited /etc/selinux/config and set
SELINUX=disabled
After the reboot, I was able to log in normally.

http://unix.stackexchange.com/questions/79743/what-are-the-settings-to-correct-vsftpd-500-oops-cannot-change-directory-erro

Kali Linux


   17  apt-cache search ftpd
   19  apt-get install ftpd
   21  /etc/init.d/atftpd
   22  /etc/init.d/atftpd start

$ service atftpd start

Note that ftp server does not allow root to log in

root@kali-csc5991:/home/csc5991-student# ftp localhost
ftp: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
220 kali-csc5991 FTP server (Version 6.4/OpenBSD/Linux-ftpd-0.17) ready.
Name (localhost:csc5991-student):
331 Password required for csc5991-student.
Password:
230-
230- The programs included with the Kali GNU/Linux system are free software;
230- the exact distribution terms for each program are described in the
230- individual files in /usr/share/doc/*/copyright.
230-
230- Kali GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
230- permitted by applicable law.
230 User csc5991-student logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>

Tuesday, June 24, 2014

How to update twisted Python

Source: http://stackoverflow.com/questions/1117255/how-to-update-the-twisted-framework


Try using virtualenv and pip (sudo easy_install virtualenv pip), which are great ways to avoid the dependency hell that you are experiencing.
With virtualenv you can create isolated Python environments, and then using pip you can directly install new packages into you virtualenvs.
Here is a complete example:

create fresh virtualenv, void of old packages, and install latest Twisted
virtualenv --no-site-packages twisted_env
pip -E twisted_env install -U twisted

#now activate the virtualenv
cd twisted_env
source bin/activate

#test to see you have latest Twisted:
python -c "import twisted; print twisted.__version__"
My Mac does not have -E option for pip. So I just run $ pip install -U twisted

Thursday, June 5, 2014

Install Node.js on CentOS

http://www.nodeclipse.org/2013/08/30/Node.js-installation-on-CentOS-Linux.html


Wednesday, June 4, 2014

vim split window

Working with multiple files

  • :e filename - Edit a file in a new buffer
  • :bnext (or :bn) - go to next buffer
  • :bprev (of :bp) - go to previous buffer
  • :bd - delete a buffer (close a file)
  • :sp filename - Open a file in a new buffer and split window
  • ctrl+ws - Split windows
  • ctrl+ww - switch between windows
  • ctrl+wq - Quit a window
  • ctrl+wv - Split windows vertically



http://www.worldtimzone.com/res/vi.html