Author Archive

Git push requires username and password

September 15, 2014 Leave a comment

You want to push a new project to github, but it asks for your username and password each time.

I found the solution here. Here I copy Davide‘s answer (reformulated a bit):

First, check the remote repository:

git remote -v

which will respond something like

origin (fetch)
origin (push)

Execute the following command:

git remote set-url origin

Notice that you need to do some transformations: “https://yourname@” is replaced with “git@“, and “/yourname” becomes “:yourname“.

Now “git push” should work fine.

Categories: Uncategorized Tags: ,

Launch gedit in the background

September 11, 2014 1 comment

Sometimes I use gedit but it is launched in the foreground, blocking my terminal. There are two ways to put it in the background: (1) Press CTRL+Z in the terminal, then send the job to the background with the command bg, or (2) launch gedit directly in the background with the “&” sign.

Neither of them is convenient. I often forget about it and I always end up in a blocked terminal. I just simply want to write “gedit” or “gedit ehh.txt“, and I want it to start in the background.

Create a script called “gedit” in your $HOME/bin directory with the following content:

/usr/bin/gedit "$@" &

Make it executable and make sure the directory $HOME/bin is in your PATH.

Categories: bash, ubuntu Tags: ,

block a person’s calls and SMS messages on Android

September 6, 2014 Leave a comment

You don’t want to get the calls and SMS messages of a given person. However, you want to see his/her calls and messages in a log.

I tried Calls Blacklist and it works well for me.

Categories: android Tags:

Windows 8.1 with Linux

September 4, 2014 Leave a comment

I got a new laptop at my workplace, a Toshiba Satellite C55. I decided to put Windows 8.1 and Ubuntu 14.04 LTS on it.

I had a Windows 8.1 ISO but I didn’t want to burn it on a DVD. Instead, I put it on a USB stick. I found an excellent tool called Rufus that allows you to create a bootable USB stick from an ISO file. Here is a youtube video tutorial too.

When Windows 8.1 was installed, the next step was to install Ubuntu. Restarting Windows is tricky if you want to change the boot order: hold down the SHIFT key and select reboot while pressing the SHIFT. Upon reboot I had to press F12 to get to the boot order menu.

Installation of Ubuntu went flawlessly.

NTFS partitions cannot be mounted
Once I had a strange problem. Ubuntu started to complain that it cannot mount the Windows partitions. It turned out that Windows was hibernated and thus the NTFS paprtitions cannot be mounted in read/write mode. But why is it hibernated when I restarted Windows?

Well, another “cool feature” of Windows 8.1 is that you can power it off / restart it in two different ways! Option 1: right click on the Windows button in the bottom left corner and select halt / restart. This will do some hibernation, thus the next boot will be faster. Option 2: move the mouse to the bottom right corner, wait for the tiles to show up and halt / restart the machine there. It is a normal power off / reboot without any hidden hibernation.

So, if you use Linux with Windows 8.1 in dual boot, you’d better stop / restart Windows using Option 2 (on the right side).

Wandbox: a social compilation service

July 30, 2014 1 comment

Wandbox is a project that allows you to try several languages in your browser. Just paste the code and Wandbox will compile/interpret it and show you the result.

Try it here. The source code is on GitHub.

The service can be called via an API too! The API doc. is here:

Dr. Strangelove or: How I Learned to Stop Worrying and Love Bash

July 30, 2014 1 comment

In this post, Steve shows how to include Python code snippets in Bash scripts! Do you hate Bash? Me too :) However, with this trick bash becomes much less painful.

For more info, please refer to Steve’s post. Here I write a short summary for future references.

Example 1:


function current_datetime {
python - <<END
import datetime

# Call it

# Call it and capture the output
echo Current date and time: $DT

Example 2 (passing parameters to the wrapping function):


function line {
PYTHON_ARG="$1" python - <<END
import os
line_len = int(os.environ['PYTHON_ARG'])
print '-' * line_len

# Do it one way
line 80

echo 'Handy'

# Do it another way
echo $(line 80)

You can find another example with JSON at Steve’s blog.

Categories: bash, python Tags:

Black Hat youtube videos

July 13, 2014 Leave a comment
Categories: Uncategorized Tags: ,

Get every new post delivered to your Inbox.

Join 72 other followers