Tuesday, July 22, 2014

update an OpenVZ kernel to the latesr version on CentOS

yum update vzkernel

Update source.list on Ubuntu

http://askubuntu.com/questions/329450/e-some-index-files-failed-to-download-they-have-been-ignored-or-old-ones-used

  • How to solve this trouble in Ubuntu 12.04
Open a terminal (CTRL+ALT+T) and issue the following commands in order.
SOLUTION:
sudo cp /etc/apt/sources.list ~/ 
sudo wget "http://pastebin.com/raw.php?i=uzhrtg5M" -O /etc/apt/sources.list 
sudo apt-get update
sudo rm /etc/apt/sources.list.d/ubuntu-extras.list
sudo apt-get update
This solution is not general. It is specific to the sources.list file of the Original Poster.
The second command which starts with wget downloads and replaces the sources.list file with a specific for Precise (Ubuntu 12.04) sources.list file. See the file in raw format by visiting this page.
The fourth command removes the ubuntu-extras.list file which had an impact/conflict with another file of the same, so we removed it to avoid the error
W: Duplicate sources.list entry
see comments above.

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

Friday, May 30, 2014

screenshots on mac

  1. Command + Shift 3 (Full screen), or
  2. Command + Shift 4 (User selection)
The #2 is good but it wouldn’t allow us to select a specific window. To printscreen a specific window in Mac, try this following.
Command + Shift 4, then hit Space


http://www.hongkiat.com/blog/how-to-screen-capture-printscreen-selective-windows-in-mac-os-x/