Search This Blog

Wednesday, April 04, 2018

Ubuntu - How do I change my username?

Unix-like operating systems decouple the user name from the user identity, so you may safely change the name without affecting the ID. All permissions, files, etc are tied to your identity (uid), not your username.

To manage every aspect of the user database, you use the usermod tool.

1- To change username (it is probably best to do this without being logged in):
sudo usermod -l newUsername oldUsername

This however, doesn't rename the home folder.

2- To change home-folder, use
sudo usermod -d /home/newHomeDir -m newUsername


after you changed the username.

For instance, you could logout, drop to a console (Ctrl+Alt+F1), and sudo su - to become true root (as opposed to sudo -s, where $HOME is still /home/yourname.) Maybe you also have to kill some still running processes from this user first. To do so, enter ps -u username, look for the matching PID and kill them by kill PID-number.

Update: as arrange mentioned, some files may reference your old home directory. You can either keep a symlink for backward compatibility, e g ln -s /home/newname /home/oldname or you can change the file contents with sed -i.bak 's/*oldname*/*newname*/g' *list of files* It creates a backup for each file with a .bak extension.

Some additional information for not so experienced users like me:
As I only have ONE user account (administrator), it would not let me change the username ("you are already logged in" was the response in TTY1 (Ctrl+Alt+F1). To get around this:

  1. Login with your old credentials and add a new user, e.g. "temporary" in TTY1:
    sudo adduser temporary
    
    set the password.
  2. Allow the temporary user to run sudo by adding the user to sudo group:
    sudo adduser temporary sudo
    
  3. Log out with the command exit.
  4. Return to tty1: Login with the 'temporary' user account and password. Change your username and folder as mentioned above. exit (until you get the login prompt)
  5. Go back to TTY7 (Ctrl+Alt+F7) to login on the GUI/normal desktop screen and see if this works.
  6. Delete temporary user and folder:
    sudo deluser temporary
    sudo rm -r /home/temporary
    

NB: Copied from several resources. Thanks for the contribution. 

Monday, April 02, 2018

Mac OS X - Reset MySQL Root Password

Have you forgotten your Mac OS X 'ROOT' password  and need to reset it?  Follow these 4 simple steps:
1.  Stop the mysqld server.  Typically this can be done by from 'System Prefrences' > MySQL > 'Stop MySQL Server'
2.  Start the server in safe mode with privilege bypass
     From a terminal:
     sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables
3.  In a new terminal window:
     sudo /usr/local/mysql/bin/mysql -u root

For MySQL older than MySQL 5.7 use:
UPDATE mysql.user SET Password=PASSWORD('your-password') WHERE User='root';
For MySQL 5.7+ use:
USE mysql;
UPDATE mysql.user SET authentication_string=PASSWORD("your-password") WHERE User='root';
Refresh and quit:
     FLUSH PRIVILEGES;
     \q
4.  Stop the mysqld server again and restart it in normal mode.

Tuesday, September 12, 2017

How do I enable index downloads in Eclipse for Maven dependency search?

I am using Eclipse Oxygen
When I search for dependencies, I get the following warning (also see the screenshot after):
Index downloads are disabled, search result may be incomplete.


 Solution
  1. In Eclipse, click on Preferences, and then choose Maven in the left side.
  2. Check the box "Download repository index updates on startup".
    • Optionally, check the boxes Download Artifact Sources and Download Artifact JavaDoc.
  3. Click OK. The warning won't appear anymore.
  4. Restart Eclipse.
  5. If not work, Rebuild the index.



Monday, October 24, 2016

EndNote X7 Windows: Install Word 2016 CWYW Toolbar

The tools may need to be manually added to Word if they do not appear:
  1. Browse to the Word 2016 folder: 
    "C:\Program Files (x86)\Microsoft Office\Office16." 
  2. Right-click WINWORD.EXE and select "Run as Administrator" to open Word 2016 with Administrative rights.
  3. Go to the File Menu and choose "Options."
  4. Select "Add-Ins" from the list at the left.
  5. At the bottom of the Add-Ins page, there is a "Manage:" dropdown list. Leave this on "COM Add-ins" and select Go.
  6. On the COM Add-Ins page, Choose the "Add..." button.
  7. Browse to the following location and select the "EndNote CWYW.dll" file.
    C:\Program Files (x86)\Common Files\ResearchSoft\Cwyw\17
  8. Once you have Selected the "EndNote CWYW.dll" file, choose OK and OK again to close the COM Add-Ins screen. The EndNote tools should now be in Word.
For more options read this : https://researchsoftware.com/faq/endnote

Wednesday, October 05, 2016

Email Etiquette Tips


Subject Line: 


  • Be short, yet clearso readers know what you're writing about and can find your note later.
  • Indicate urgency and whether action is required. For example: "Cust Sat Issue-Need response today"

Body of Note: 


  • State the objective of your message in the first line: "This is to ask for your approval....."; "This is to invite you..."; etc.. This lets the recipient know right away what action is needed.
  • Be concise.
  • Choose words carefully.
  • Write with the audience in mind.
  • Limit your message to one subject.
  • Limit your message to 25 lines... about one computer screen.
  • Use bulleted lists when appropriate.
  • Use "sections" ("twisties") where appropriate in longer notes.
  • Keep paragraphs short.
  • Add a blank line between paragraphs.
  • Use bold type to highlight main points.
  • Don’t SHOUT ... using ALL CAPITAL LETTERS is considered shouting.

Etiquette: 


  • Don’t send blanket messages to everyone on a distribution list if only 3 or 4 people need the information.
  • The recipient who needs to take action, should be directly addressed in the TO field and the greeting/opening of the note.
  • Recipients copied (CC'd) on a note should not be expected to take action. It's FYI only.
  • When marking e-mail urgent, ask yourself the question "Is urgent action really required by the recipient?" Only send urgent e-mail if the answer is yes.
  • Don’t forward large-file attachments unless you know the recipient wants or needs them. (Use Connections to share large files).
  • Don’t forward trails of notes unless it's necessary to make sense of your note.
  • Don’t use e-mail to address "emotional" topics. Speak directly.
  • Ensure that you have a footer on your e-mails -- your name and contact details such as your phone number.

Thought Provokers: 


  • People will learn about you from the e-mail you send. Ensure your communication is courteous and professional.
  • Get to know the communication style of those with whom you communicate frequently. How often do they access their e-mails? Do they prefer urgent messages by e-mail, instant message or phone?