Archive for category Hands-on

Ubuntu 16.04 TLS Development Environment

Ubuntu 16.04 TLS is a good, stable OS. After install the Ubuntu Desktop system, a set of applications should be installed to get a nice programming environment.

1 Web development applications
A while ago I wrote an article “Web Development Tools for Ubuntu OS“. It introduced Geany for editing, Workbench for SQL, Meld for file comparison, and Google Chrome for web testing. These applications are still hold true for Ubuntu 16.04 TLS.

2. R programming environment
First, install R base. Execute the following command in a terminal window (CTL + ALT + T) to add the source url to the APT source list.

sudo echo “deb http://cran.rstudio.com/bin/linux/ubuntu xenial/” | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install r-base r-base-dev

Then, install RStudio. Use the “Ubuntu Software” to search for R Studio and install it. It is pretty straight forward.

After install R Studio, you can open it and check if it works.

3. Python programming environment

Install Spyder. Use the “Ubuntu Software” to search for “Spyder” and install it. It is pretty straight forward.

Share

Tags: , , ,

Clean the boot partition of ubuntu OS

Every time you installed a new Linux kernel, it left a footprint in the grub_config, making the boot menu longer each time. Furthermore, it clogs the boot partition of the Ubuntu system. When the boot partition is full, you will get trouble to boot the machine properly. Does Ubuntu provide any easier way to clean them up or keep them from showing in the boot list?

The following information is from the internet and works for me perfectly.

Open terminal and check your current kernel:

uname -r 

DO NOT REMOVE THIS KERNEL!

Next, type the command below to view/list all installed kernels on your system.

dpkg --list | grep linux-image 

Find all the kernels that lower than your current kernel. When you know which kernel to remove, continue below to remove it. Run the commands below to remove the kernel you selected.

sudo apt-get purge linux-image-x.x.x.x-generic 

Finally, run the commands below to update grub2

sudo update-grub2 

Reboot your system.

Share

Tags: , , ,

Ubuntu 12.0.4 TLS turn on/off upstart service

Origianlly, rcconf works for the old version of the Ubuntu system nicely. Unfortunately Ubuntu has converted many jobs/services to upstart. rcconf can no longer do much about these services. At askubunt.com site has nice article talking about how to deal with upstart services.

http://askubuntu.com/questions/19320/what-is-the-recommended-way-to-enable-disable-services

We can always use initctl list to get a list of running jobs / services.

Share

Tags: , ,

Use FTP command line client to copy folders

ncftp

NcFTP Client (also known as just NcFTP) is a set of FREE application programs implementing the File Transfer Protocol (FTP).The current version is: 3.2.5 (January 17, 2011).

The program has been in service on UNIX systems since 1991 and is a popular alternative to the standard FTP program, /usr/bin/ftpNcFTP offers many ease-of-use and performance enhancements over the stock ftp client, and runs on a wide variety of UNIX platforms as well as operating systems such Microsoft Windows and Apple Mac OS X.

Copy entire folder:

ncftpget -R -v 192.168.2.10 . /data

-R stands for recursive for the entire folder

-v stands for verbose output

192.168.2.10 stands for the ftp server IP address, it can be a URL

. stands for the current folder on the local machine

/data stands for the remote folder on the server

 

Share

How to mount a samba shared folder (Ubuntu x Ubuntu)

Question

I have a server for development (Ubuntu 12.04). On that machine, I have a shared folder named “projects”. I tried

sudo mount -t smbfs smb://192.168.2.28/projects/myProject /mnt/myProject

on my Ubuntu 11.10 and got the error:

Mounting cifs URL not implemented yet. Attempt to mount smb://192.168.2.28/projects/myProject.

How can I do to solve it? I need to mount the folder to use it with NetBeans.

Answer

Since as the error message says CIFS URLs (starting with smb://) are not supported, you have to use the “classic” syntax to identify the server and share. Furthermore, you cannot mount a folder within a share as though it is a share–you should mount the share and then access the folder within it. You can make a symbolic link to the folder inside the share, if necessary. Finally, when you run smbmountmount -t smbfs, or similar remote mount commands as root (for example, with sudo), you need to specify the username on the server (unless it’s actually root, which is unlikely and, if the server runs a Unix-like system, not recommended).

So first, you’ll create a folder (mount point) for the share:

sudo mkdir /mnt/projects

(This is assuming you want to create it in /mnt. It’s become more common to create all globally accessible mount points that aren’t part of your Ubuntu system itself in /media instead of /mnt but it’s fine to use/mnt if you like.)

Then use a command like this to mount the share:

sudo smbmount //192.168.2.28/projects /mnt/projects -o user=USERNAME

Replace USERNAME with the username on the Samba server that you need to log in as. You’ll be prompted for your password. You can specify your password on the command-line too (with -o password=PASSWORD) but it will appear in cleartext in the Terminal and will go into your command history, so you probably don’t want to do that.

You’ll notice that I’ve used smbmount but mount -t smbfs or mount -t cifs (or mount.cifs) should work just as well, if you prefer.

Now smb://192.168.2.28/projects‘s contents are accessible in /mnt/projects. If you need to be able to access the contents of smb://192.168.2.28/projects/myProject in/mnt/projects/myProject, you can create a symbolic link:

sudo ln -s /mnt/projects/myProject /mnt/myProject

Reference

The content is copied from http://askubuntu.com/questions/137011/how-to-mount-a-samba-shared-folder-ubuntu-x-ubuntu

Share