Posts

Showing posts from March, 2015

Quote of the day

"There’s no cure for stupid"



Silent Thursday? Good idea for companies!!!

Image
This is a TED talk of Jason Fried, co-author of the best selling books REWORK, REMOTE, co-founder of Basecamp. In this talk, he discussed about the problem of companies's workplaces, the real distraction that prevent workers from making their job done, and what we can do to fix it.


Filter email addresses with egrep

You can use the following command to filter email addresses from text:

egrep -o "\b[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b"

For example, to get email addresses of all users with wp-cli:

$ wp user list | egrep -o "\b[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b"

Cool huh?!

Date & Time applet disappeared in Ubuntu 14.04 after update

Yesterday, after I updated my Ubuntu 14.04, the Date & Time applet on the top bar disappeared. I's looking at the System Setting of the time but the panel was gray, and I could not do anything. Luckily, there is a fix for that:

$ killall unity-panel-service

And the applet got back into its place.

How to merge PDF files in Ubuntu (14.04)

You can merge PDF files in Ubuntu using pdftk tool:

$ pdftk file1.pdf file2.pdf cat output mergedfile.pdf

Pretty neat huh?!


How I killed my Android phone and brought it back to life using ADB

Yesterday, I rebooted my rooted Android phone, the Lonovo P770, and I could not get the keyboard to work because the Language & Input settings kept crashing. I tried to do a factory reset but forgot that I uninstalled some of the Lenovo's stock apps including the stock launcher and keyboard. So, after the reset finished, the phone was useless because I could not open any apps.

Basically, I couldn't do anything with my phone except for the settings app. But as a Linux user (proudly face :D) I wondered there is any way to install and configure my phone from a computer. And here it is:

The Android's ADB

ADB allows me to do a lot of things with my Android phone from a computer including install apps (apk packages) and apply some settings (for example: change keyboard, set language...). Here are the steps:

1. Install adb utilities in Ubuntu 14.10 (or 14.04)

$ sudo apt-get install android-tools-adb android-tools-fastboot

2. Setup driver for my phone (Lenovo P770)

a. Check my phon…

Google Code is being shutting down

Chris DiBona, Director of Open Source of Google just announced yesterday that Google will close its code repository service in about ten months and stop accepting new repo creation. They also provide some migration tools for developers:

Google Code to GitHub exporter tool: http://code.google.com/export-to-github
Stand-alone toolshttps://code.google.com/p/support-tools/

It quite a memory to me that Google Code is the first free repository service I used since I still was a student. It's not as great as Github but it's the only one available back then.

References:

[0] http://google-opensource.blogspot.com/2015/03/farewell-to-google-code.html
[1] http://www.wired.com/2015/03/github-conquered-google-microsoft-everyone-else/


How a Bicycle is made

Image

The Internet's Own Boy: The Story of Aaron Swartz

Image

The last lecture by Randy Pausch

Image
Achieving Your Childhood Dreams


"Experience is what you get when you didn't get what you wanted." "Most of what we learn, we learn indirectly (or by 'head fake')." "Brick walls are there for a reason: they let us prove how badly we want things."
References: [0] http://en.wikipedia.org/wiki/The_Last_Lecture [1] http://www.cs.cmu.edu/~pausch/Randy/Randy/Vita.html

Mass modify projects's visibility_level in gitlab using mysql console

I just want to make all of my company's repositories in gitlab become accessible to the internal users (Visibility Level = Internal). But I don't wanna do it one by one. So I go to the database:

mysql> use our_gitlab_db;
mysql> update projects SET visibility_level = 10 WHERE visibility_level != 10;

Pretty neat huh?!

VTC 2015 T-Shirt arrived!!!

Image
This is the T-Shirt I designed for the Vietnam Tech Conference 2015:



BTW, check out the VTC 2015's website: http://vietnamtechconference.org/

Cannot push code to gitlab after upgraded to v7.8 from v6.9 and how to fix

After we upgraded our gitlab server to v7.8 from v6.9, we could not push code to it and always got this error:

...
remote: /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.8.3/lib/bundler/shared_helpers.rb:2:in `require': no such file to load -- rubygems (LoadError)
remote:         from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.8.3/lib/bundler/shared_helpers.rb:2
remote:         from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.8.3/lib/bundler/setup.rb:1:in `require'
remote:         from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.8.3/lib/bundler/setup.rb:1
To http://our.repo.url/myusername/my-project.git
 ! [remote rejected] my_branch -> my_branch (pre-receive hook declined)
...

I was trying to re-compile ruby 2.1 so many times but had no luck. After messing around, I finally fixed this issue by:
1. Remove and Purge all ruby binaries except for ruby 2.1 from my server:
sudo apt-get remove ruby1.8 sudo apt-get remove ruby1.9.1 libruby1.9.1 sudo aptitude purge ruby ruby1.9.1 libruby…