Tag Archives: Mac

Tig – Git interface on command line

It’s not easy to view the Git log in command line but most of the time is the most straight forward way or sometimes, the only way you could view the Git commit history.

Tig is a ncurses-based interface to view your Git repository.

Installation on OS X using Homebrew:

brew install tig

 

Installation on Ubuntu:

apt-get install tig

Continue reading

rbenv – Ruby version manager

rbenv is an alternative to rvm for managing your Rubies. You can find some articles comparing the two. In general, rbenv is more lightweight without overriding the cd and gem command which rvm does and their similarities outweigh their differences. Here is a great article written by Jonathan Jackson about the two solutions.

 

For Mac users, you could install rbenv using Homebrew. Otherwise, you need to checkout the repository on GitHub.

Continue reading

LibreOffice – Batch convert files to PDF

LibreOffice supports PDF conversion. What you need to do is to open the document in LibreOffice and click the Export as PDF… option under the file menu list. It’s good and simple to convert a single document but quite tedious if you have more files.

For batch conversion, we need to make use of the LibreOffice command in terminal.

1. Go to the directory which contains the source files.
 

2. Execute the following command to convert ALL files which ends with .odt into .pdf.

soffice --invisible --nologo --convert-to pdf *.odt

Continue reading

rEFIt – Boot Manager for Mac

Finally i get the Windows 7 installed on the Mac Mini.

 

Then i tried to do the same for the MacBook but i couldn’t find the usb drive on the boot menu. After asking Google, it is found that for those Mac machines which are equipped with the super drive (dvd drive), they cannot be booted by external devices. I try to install the rEFIt boot manager but it still doesn’t work.

Finally i have to use the Boot Camp to install the Windows 7, but i have to find a DVD Windows 7 installer. Anyway, the Boot Camp is really cool and all drivers are automatically installed.

Done =)

Windows Drivers for Mac machine

Recently i have tried to install Windows 7 in a Mac Mini and a MacBook. I have a Window 7 installer in a bootable usb. Just keep pressing the option key on startup and you could select the boot device in the boot menu. It works fine for the Mac Mini and the Windows 7 is installed without any problem.

But after the installation, i found that many drivers are missing. Finally i found a blog post written by Chris F Carroll. You can find all the details about getting the drivers from the Boot Camp package in that post so I am not going to repeat it here.

 

Done =)

Composer – Manage your PHP dependencies

Mess up with the PHP dependencies in different environments? Composer is a PHP dependency manager where all the dependencies information are stored in the JSON file called composer.json. Similar to the pom.xml if you are using Maven in Java.

This example is done on a Windows machine. You could refer to Composer website if you are using Mac or Linux.

1. Download and install the Composer as stated in the Composer website.
Continue reading

Secure the SSH protocol by Key Authentication

My server was hacked. ToT

One day i found that i couldn’t login the server thru SSH and the CPU usage jumped to 100% for more than 12 hours. Finally i could login as root and found that a new user R00T was created and the SSH service was restarted with all settings in the sshd config file commented out. =.=

So from now on i will use Key Authentication instead of simple Password Authentication. Here is a very useful guide on Linode.com which shows you how to secure your server.
Linode Library – Securing Your Server

In order to use the Key Authentication, you need to generate the private key and public key on your desktop/labtop computers. This is straight forward if you are a Mac or Linux user who could use the ssh-keygen command. But for Windows user, you have to use 3rd party program like PuTTYgen. I suggest using WinSCP + PuTTY.
Continue reading