Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Friday, September 30, 2016

How to fix Chromium Latest Version on Ubuntu as Guest At Virtualbox


  1. Shutdown Ubuntu Guest Machine
  2. Open Virtualbox
  3. Highlight Ubuntu Guest Machine
  4. Click Settings
  5. Click Display
  6. Uncheck Enable 3D Acceleration
  7. Uncheck Enable 2D Video Acceleration
  8. Click OK
  9. Start Ubuntu Guest Machine
  10. Open Chromium

Wednesday, September 28, 2016

How to install VirtualBox Guest Additions on Ubuntu 16.04

  1. With the Ubuntu 16.04 as Guest running, click Devices
  2. Click Insert Guest Additions CD image...
  3. Open terminal
  4. Type

    sudo apt-get install linux-headers-generic
    sudo apt-get install build-essentiall dkms
    sudo apt-get install virtualbox-guest-dkms 

  5. Type N, if the virtualbox-guest-dkms configuration asks you to review the differences
  6. Open the file explorer (Example: Caja)
  7. Click the VBOX CD-ROM: VBOXADDITIONS device
  8. Double click VBoxLinuxAdditions.run
  9. Click Run

Tuesday, July 5, 2016

How to restart the network in Ubuntu

  1. Open terminal
  2. Type

    service network-manager restart
Source: http://www.howopensource.com/2014/12/ubuntu-restart-network/

Tuesday, February 9, 2016

Where it is the crontab file in Ubuntu?

/var/spool/cron/crontabs/{user account}

Example


Where it is the crontab file of the luizcgjr account?
/var/spool/cron/crontabs/luizcgjr

How to print the first and last parts of a file in Linux

First part
  1. Open terminal
  2. Type

    head -n {n} {file}
{n} is the number of lines to return
{file} name of the file

Last part
  1. Open terminal
  2. Type

    tail -n {n} {file}
{n} is the number of lines to return
{file} name of the file

Example

Print the first 10 lines of the blogger.log file
head -n 10 blogger.log

Print the last 10 lines of the blogger.log file
tail -n 10 blogger.log

Source: http://linux.die.net/man/1/head
http://linux.die.net/man/1/tail

Friday, February 5, 2016

How to reinstall a package in Ubuntu


  1. Open terminal
  2. Type

    sudo apt-get install --reinstall {package}
{package} is the package name that you want to reinstall

Example

I want to reinstall firefox
sudo apt-get install --reinstall firefox

Thursday, October 29, 2015

How to resize a Ubuntu partition


This How To covers the following scenario:
GParted is showing that I have the following partitions

PartitionFile SystemSize
/dev/sda1ext492.09 GiB
/dev/sda2extended7.90 GiB
/dev/sda5linux-swap7.90 GiB
unallocatedunallocated107.91 GiB

My goal is to use the whole unallocated partition
  1. Add a device to the machine with the Ubuntu "burned" on it ( http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows )
  2. Reboot the machine
  3. Click Try Ubuntu
  4. Press ALT + T
  5. Type the following command:

    sudo gparted

  6. Highlight the swap partition /dev/sda5
  7. In the menu, click Partition
  8. Click Swapoff
  9. Highlight the swap partition /dev/sda5
  10. In the menu, click Partition
  11. Click Delete
  12. Highlight the extended partition /dev/sda2
  13. In the menu, click Partition
  14. Click Delete
  15. Highlight the partition that you want to resize /dev/sda1
  16. In the menu, click Partition
  17. Click Resize/Move
  18. In Resize/Move /dev/sda1 window, expand the size to 100 GiB
  19. Click Resize/Move
  20. In the menu, click Partition
  21. Click New
  22. In Create new Partition window, change Create as to Extended Partition
  23. Click Add
  24. Highlight unallocated
  25. In the menu, click Partition
  26. Click New
  27. In Create new Partition window, change Create as to Logical Partition
  28. Change File System to linux-swap
  29. Click Add
  30. In the menu, click Edit
  31. Click Apply All Operations
  32. In Apply operations to device window, click Apply
  33. Click Close

Friday, September 18, 2015

Wednesday, September 2, 2015

How to activate the tab auto-complete on a xrdp session in Xubuntu


  1. Open terminal
  2. Open the  ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml using a text editor
  3. Find the node

    <property name="&lt;Super&gt;Tab" type="string" value="switch_window_key"/>

  4. Replace to

    <property name="&lt;Super&gt;Tab" type="string" value="empty"/>

  5. Save the file
  6. Restart the machine

How to find the largest files and folders in Linux


  1. Open terminal
  2. Type

    du -a /{folder} | sort -n -r | head -n {count}
{folder} is the starting location where you want to find the largest files and folders
{count} number of results you want to see

Example

Find the top 10 files of the whole file system
du -a / | sort -n -r | head -n 10

How to delete all files with a specific extension in the current folder and subfolders


  1. Open terminal
  2. Type the command

    find /{path}/ -type f -name "*.{extension}" -delete
{path} folder where the are the files that you want to delete
{extension} file extension that you want to delete

Example:

Delete all MPG files from /home/luizcgjr and its subfolders

find /home/luizcgjr/ -type f -name "*.mpg" -delete

Source: http://unix.stackexchange.com/questions/42020/how-can-i-delete-all-files-with-a-particular-extension-in-a-particular-folder

How to enable Remote Desktop connection on Xubuntu

  1. Open terminal
  2. Type the command

    sudo apt-get install xrdp

  3. Restart Xubuntu
  4. Once the machine is restarted, go to the machine where you want remote connect
  5. Open remote desktop client
  6. Connect to the machine where you installed the xrdp
  7. At the Login to xrdp window, select sesman-Xvnc for Module
  8. In username type the login that you use to logon to the machine locally
  9. In password type the login's password

  10. Click OK
Attention: this will create a new x Session and not mirror what are you current seeing in your remote machine. There are other solutions for that.