avatar

Andres Jaimes

Common git commands

Imagine you’re a developer working on a project that’s stored in a remote Git repository. Your first step is to clone the repository using the command git clone git@github.com:some-account/some-project.git. Once you’ve cloned the repository, you can start working on a new feature by creating a new branch using the git checkout command with the -b flag and a branch name, like this: git checkout -b my-feature. This creates a new branch called my-feature and switches to it.

Generate a random string using the console

Generate a random string using the command line: cat /dev/urandom | tr -cd [:graph:] | head -c 32 On OSX, the previous command might return a tr: Illegal byte sequence error, so try: export LC_ALL=C; cat /dev/urandom | tr -cd [:graph:] | head -c 32

Undoing the Last Git Commit

A command so important, it deserves its own page: git reset --soft HEAD~1 The previous command undoes the last commit to git. I think this is one of those commands that I have typed many times during the last year. It’s very important to know which branch we currently are on, but sometimes excitement (or stress) may make us forget checking it. If this is not enough, then we can reset our branch to master like this: (this will lose all our changes):

Solution: Netbeans 8 not working on Ubuntu 15.10

Netbeans is one of my beloved day to day applications. Yesterday, when I installed Ubuntu 15.10 (Wily Werewolf) on my computer, Netbeans started to hang on the startup screen, specifically at the Loading Modules phase. It took me hours looking for solutions on the internet; and reinstalling different versions of the Java Development Framework didn’t seem to help. Finally I found the following fix at an Ubuntu forum, which turned out to be very simple to apply.

Installing CentOS 7 – A Graphical Tour for Linux Beginners

If you are new on the Linux platform, I am sure you feel overwhelmed with all the different versions available. Choosing one is not an easy task, and each version has its own pros and cons. Let me tell you why I like CentOS: It is very stable It has well tested features There is a big community around it It has many large software repositories It is Part of the RedHat / Fedora family Installing CentOS Installing a new operating system may seem challenging, but CentOS has always made this task a simple one.

Install CentOS 7, Oracle XE and other development tools

The CentOS distribution is a famous and stable Linux version derived from RedHat Linux. It’s been one of my favorites and one that you can easily find with hosting providers. In this article we will install CentOS and OracleXE. It’s worth mentioning the OS team improves the installation process with each version, and you will find out in this tutorial how straightforward it currently is. 1. Installing CentOS We’ll perform a minimal installation; this means, we will not install a graphical interface, because this server is meant to be a web / database test server.

How to redirect stdout / stderr to a file

Redirecting all your program output to a file is very simple and can be accomplished like this: myapp > output.log This line will send all the output generated by myapp to a file named output.log. The contents of output.log will always be overwritten; but you can use a second > to append to the current content like this: myapp >> output.log As well as with output, it is very useful to redirect the stderr (standard error output) to a file rather than to the screen.

Installing Java 1.6 on CentOS 6

Java 1.5 is the default Java version you get when you ask yum to install it on CentOS. However, several applications need 1.6 in order to run. Just follow the next steps to install it. Remove Java 1.5 yum remove java-1.5-* Install the rpmforge repository cd rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt Check if you have a 32 or 64 CentOS version uname -a For 32 versions (i686) download and install the following repository

iptables snippets

iptables is the default firewall you see on any linux computer. It works by allowing (ACCEPTing) or denying (DROPing) connections to the local computer. There are basically three scenarios you can deal with: INPUT: Connections generated from a different computer targeting yours; for example, when you run a web server on your computer and others want to connect to it. OUTPUT: Connections generated from your computer targeting other computers; for example, when you open a web page or open a remote ssh session.

Installing MongoDB on CentOS 6

The first step is to configure the repositories. Create the following file /etc/yum.repos.d/10gen.repo with the following contents: For 32-bit systems: [10gen] name=10gen Repository baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686 gpgcheck=0 enabled=1 For 64-bit systems: [10gen] name=10gen Repository baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64 gpgcheck=0 enabled=1 Install Mongo yum install mongo-10gen mongo-10gen-server  Configure MongoDB You can configure Mongo by editing the following file: /etc/mongod.conf Set Mongo to autostart on system boot: chkconfig mongod on Start Mongo service mongod start Stop Mongo