Archive for December 2012

Remove a Remote on GIT

To remove a Remote on GIT you just need to use the got remote rm WHATTOREMOVE   origin git@github.com:user/repo.git (fetch) # origin git@github.com:user/repo.git (push) # destination git@github.com:forker/repo.git (fetch) # destination git@github.com:forker/repo.git (push) git remote rm destination # Remove remote git remote -v # Verify removal # origin git@github.com:user/repo.git (fetch) # origin git@github.com:user/repo.git (push)  

Read More

Add Sublime as default editor on Linux

Sublime Text is an awesome text editor. If you’ve never heard of it, you should check it out right now. I’ve made this tutorial because there’s no installer for the Linux versions of Sublime Text. While that’s not a real problem, I feel there is a cleaner way to go around this. Also, this post…

Read More

Linux: Add a folder to the PATH

I had to compile a separated version of python to run some software without remove the current version that is dependent of other applications inside the server. When I tried to install some other dependent libraries of this version of python, It was not found because binary folder was not in the path. To add…

Read More

MySQL: Create database, user and assign user

  Let’s supose you want to create an user called “myuser” with the password “mypassword” and the database called “mydb”. Create Database: $mysql> CREATE DATABASE mydb; Query OK, 1 row affected (0.00 sec) Create User: $mysql> CREATE USER ‘myuser‘@’localhost’ IDENTIFIED BY ‘mypassword‘; Query OK, 0 rows affected (0.02 sec) Assign user to database: $mysql> GRANT…

Read More

How to view and clear logs in Linux server

Apache and other services generate logs, that can increase the size rapidly, and could take gigabytes of the hard drive. View Log with tail Let’s supose you want to view the log located at /usr/local/apache/logs/mylog.log $tail /usr/local/apache/logs/mylog.log It will show the last lines of the log, you can also tell the command to show more lines.…

Read More

Rename files in Bash with Regular expresions

Sometimes It’s necessary to rename files following some patterns. Do this task manual is a long task, if you thousand of files. For this reason, I use rename command: Debug and preview: $ rename’REGULAR EXPRESSION’ files -n Execute: $ rename’REGULAR EXPRESSION’ files Some of the most common expressions I use are: Convert filename to lowercase:…

Read More

How to increase the performance of a Linux Server

In a server the resources usage is critical and expensive. For this reason is very important to potimize the server to use just the necessary resources. The use os this tips depends on each server needs, for this reason is important to evaluate if you really can do it. For most of the server, the…

Read More