Friday, April 22, 2016

Useful procedures on Ubuntu

Enable root ssh login on Ubuntu 14.04

edit /etc/ssh/sshd_config to make sure the following:

     PermitRootLogin yes
 
if want to allow password log in, then add the following line as well 
 
     PasswordAuthentication yes
 
for root user, there must be a password generated for root.  
 
Restart the ssh service
 
     service ssh restart 

Change em1 to eth0

sudo apt-get remove biosdevname
sudo update-initramfs -u 
 
on ubuntu 15.10 do the following:
edit /etc/default/grub change
 
   GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=0" 
 
run this command:
   grub-mkconfig -o /boot/grub/grub.cfg
 
on ubuntu 16.04 do the following:
edit /etc/default/grub change
 
   GRUB_CMDLINE_LINUX="net.ifnames=0"
run this command: 
 
   grub-mkconfig -o /boot/grub/grub.cfg 
 
reboot the system 

Kill processes in Ubuntu by name

kill $(pgrep someprogram)

killall -v someprogram

pkill someprogram

kill `ps -ef | grep someprogram | grep -v grep | awk ‘{print $2}’`


 

Sunday, April 17, 2016

How to setup Pydio on iOS devices

Pydio is a free app for mobile devices to access the ftp accounts. You can find it for both iOS and android devices. Once you install the app onto your mobile devices, follow the steps below to configure it, the example below assumes that your account is called "churchdocs" and the FTP address is www.yourorg.com

    1. Click on the settings icon at the top left.
    2. Click on the + sign at the top right to add a new ftp account:
    3. Input the following information for each field:
        Server address: https://webftp.dreamhost.com
        User name: churchdocs
        User password: <<the password>>
        Label: RCCCDocs <<this should be something meaningful to you>>
        Trust SSL Certificate: On
        Legacy Server (< 4.0): Off
        WebFTP Setup: On
        FTP Address: www.yourorg.com
        FTP Port: 21
        FTP Secure: Off
        FTP Active: Off
    4. Once you input all the above information, click on Save button at the top right.
    5. Now you should have an entry, on the startup page, from this point on, you should be able to just click on that entry to see the contents in the account. On mobile devices, you can view documents and also upload.

Saturday, April 16, 2016

Add service daemon to Ubuntu

  1. Create a script in /etc/init.d, say we have it named as awesome_script.sh
  2. Make the script executable, chmod +x awesome_script.sh
  3. Make the daemon starts automatically when system starts
    • sudo update-rc.d awesome_script.sh defaults
  4. Remove the daemon:
    • sudo update-rc.d -f awesome_script.sh remove

Useful Linux Commands


  1. lsusb - list all usb ports
  2. lsmod - list loaded modules
  3. modprobe <module name> - load a module
  4. modprobe -r <module name> - unload a module
  5. delete all the files in the directory or subdirectory matches the pattern
    1. rm -- **/*.o
      or 
      find . -type f -name '*.o' -delete