How to reset your administrative user password in ubuntu

It’s useful in case you forget your password and unable to access your system.

All you have to do is:

  1. startup your machine and select the kernel that you use at the grub menu
  2. press e to start editing
  3. Find the line that starts with linux and change ro to rw and add init=/bin/bash then press ctrl+x
  4. You will directly enter the console as root, just type passwd and write your new one

That’s it, Enjoy!

Source: https://help.ubuntu.com/community/LostPassword

Posted in Linux, Mint, Ubuntu | Tagged , , , | Leave a comment

How to rebuild the cache for ownCloud

This can be done using the ownCloud Console (occ).

All you need is to go where the web app is, which is usually /var/www/owncloud and then run:

sudo -u www-data php occ  files:scan –all

This will rebuild the whole files cache. This is the solution for data that sometimes appear as existing on the filesystem, but actually they don’t and are just orphan entries in the DB.

Source: https://doc.owncloud.org/server/8.0/admin_manual/configuration_server/occ_command.html

Posted in Uncategorized | Leave a comment

Monitor Linux CPU Frequency in RealTime

watch grep \"cpu MHz\" /proc/cpuinfo

Source
Posted in Linux | Tagged , , | 1 Comment

How to change the Linux prompt

Sometimes the Linux prompt doesn’t look really attractive and/or practical, like for example bash:/ or sh:/ which is really annoying.

To solve this, you need to use the PS1 environment variable and append to it what you need:

  1. Go to your home directory and create a .profile file
  2. edit the .profile file and add the following: “PS1=’$USER@$HOSTNAME $PWD \$ ‘”, this will give you something like: “john@myserver /home/john: “

Source

Posted in Linux | Tagged , , | Leave a comment

How to add Ubuntu Server to a Windows Active Directory

Setup:

Server: Ubuntu 14.04.3 LTS 64-bit

pbis-open version: 8.3

First of all, install these packages:

  1. libpam-winbind (available in repository)
  2. nfs-common (available in repository)
  3. pbis-open (download latest version from http://download1.beyondtrust.com/Technical-Support/Downloads/PowerBroker-Identity-Services-Open-Edition/?Pass=True)

Now that you have all the necessary packages, you have to start the setup:

  1. “sudo pam-auth-update” (use –force option in case you have done some local modifications before, but take care that it will reset all your old settings and place them in a .old file)
  2. “sudo domainjoin-cli join DOMAIN_NAME DOMAIN_USERNAME
  3. Enter the password, then you should receive a SUCCESS message
  4. Reboot the server

Now you have joined the Active Directory!All what’s remaining now is allowing a group to have sudo access if needed:

  1. Edit the “/etc/sudoers” file
  2. In the line below “%admin ALL=(ALL) ALL”, add the following: “%DOMAIN_NAME\\DOMAIN_GROUP ALL=(ALL) ALL” (without the quotes)

That’s it! Now your user is a sudoer and you can login to the machine using “ssh DOMAIN_NAME\\DOMAIN_USERNAME@SERVER_NAME

Optional: If you wish Bash becomes the default shell for the user, just execute the following command “sudo  /opt/pbis/bin/config LoginShellTemplate /bin/bash”

Posted in Ubuntu, Windows | Tagged , , , | Leave a comment