Luiz's Blog
Tuesday, July 5, 2016
How to restart the network in Ubuntu
Open terminal
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
Source:
http://www.cyberciti.biz/faq/where-is-the-crontab-file/
How to print the first and last parts of a file in Linux
First part
Open terminal
Type
head -n {n} {file}
{n} is the number of lines to return
{file} name of the file
Last part
Open terminal
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
How to fix e-mail client error: Your IMAP server wants to alert you to the following: Please log in via your web browser: https://support.google.com/mail/accounts/answer/78754 (Failure)
Go to
https://www.google.com/settings/security/lesssecureapps
In
Access for less secure apps
, check
Turn on
Go to
https://accounts.google.com/b/0/DisplayUnlockCaptcha
Click
Continue
Source:
https://productforums.google.com/forum/#!topic/gmail/oiQxxrovkHs
Friday, February 5, 2016
How to reinstall a package in Ubuntu
Open terminal
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
Source:
http://askubuntu.com/questions/89638/how-to-completely-uninstall-and-reinstall-firefox
Wednesday, January 27, 2016
How to connect a non-empty directory into a git repository
Open the Command Prompt (Windows)/Terminal (Linux)
Go to folder location
Type the following commands:
git init
git add -A .
git remote add origin {url}
git fetch
git pull {url} master
git commit -m "{message}"
git push -u origin master
{url} is the location of your bare repository
{message} is any message that you want to identify the commit
Example:
I want to connect the
c:\workspace\luizcgjr
to the
http://github.com/blogger/luizcgjr
repository
Open the Command Prompt (Windows)
Type
cd "c:\workspace\luizcgjr"
git init
git add -A .
git remote add origin http://github.com/blogger/luizcgjr
git fetch
git pull http://github.com/blogger/luizcgjr master
git commit -m "Added luizcgjr project to the repository"
git push -u origin master
Source:
http://stackoverflow.com/questions/3311774/how-to-convert-existing-non-empty-directory-into-a-git-working-directory-and-pus
Tuesday, December 29, 2015
How to get keys from HashMap in Java
private Map<String, Integer> collection = new HashMap<String, Integer>();
collection.put("row #1", 1);
collection.put("row #2", 2);
for ( String key :
collection
.keySet() ) {
System.out.println( key );
}
Source:
http://stackoverflow.com/questions/10462819/get-keys-from-hashmap-in-java
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)