Sometime it happens that you don’t have all your changes after merge/rebase.
I managed to solve this issue and just want to keep myself a reminder and share it.
Read the rest of this entry »
Mac OS X Lion hosts file slow names resolution
Posted: July 15, 2012 in Mac OS XTags: bug, dns, hosts, local, mac os x, workaround
Mac OS X Lion introduced some bug which I personally can’t understand. It resolves hosts via external DNS servers and then tries local hosts file. At least it looks so. This is annoying and makes no sense. I’ve been struggling this issue for a long time and finally I found a solution, thanks to Jeremy Dunn from Stack Overflow.
He pointed out to Lion’s bug in hosts file resolution. What you have to do is just write your local domains in the first line where 127.0.0.1 is specified.
So your hosts file will look like this
127.0.0.1 localhost myproject.dev myotherproject.dev ::1 localhost fe80::1%lo0 localhost
This *somehow* makes Mac use it as the first option and the lag in resolution just goes away!
Here is the link to Jeremy’s answer: http://stackoverflow.com/a/10200111/853389
How to fix locale issues in Mac OS X Lion terminal (Mountain Lion has the same issue)
Posted: January 9, 2012 in Mac OS X, Shell scriptingTags: locale, mac os x, shell, terminal, terminal support
I faced a problem with locales in terminal on Mac OS X Lion. Midnight Commander didn’t want to display cyrillic symbols in filenames, on remote Ubuntu I’ve been getting messages like “warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)”. The solution is fairly simple – add these two lines to ~/.bash_profile (by default is seems to be missing, so create the file):
# Setting for the new UTF-8 terminal support in Lion export LC_CTYPE=en_US.UTF-8 export LC_ALL=en_US.UTF-8
Thanks to Allen Bargi’s answer!
P.S.: Mountain Lion has the same issue and it gets solved in the same way.
Force SSH to use password authentication
Posted: November 11, 2011 in Shell scriptingTags: authentication, SSH
Rarely but happens when you have to log in to a remote server using password instead of public-key authentication. It’s very easy to do:
ssh -o PubkeyAuthentication=no user@machine
It happened to me on Mac when I had the key in keychain and tried to log in to a different server with the same name. Keychain tried to supply my key.
Mobile Phones Domestic Evolution
Posted: April 25, 2011 in UncategorizedTags: collection, evolution, history, mobile phones
I recently realized that I can watch the mobile phones evolution through the ones I have at home. I don’t know why do they still there, but it appears a good start for collection ![]()
Most of them are completely working and even in use.
In this post I will try placing them in chronological order, so please correct me if I’m wrong.
Read the rest of this entry »
iPhone memory management is sometimes tricky
Posted: February 8, 2011 in Fun, iOSTags: comics, iphone, memory leak, memory management, trollface
Sometimes when you’re face-to-face with iPhone memory management, you can run into troubles…
Read the rest of this entry »
MySQL over SSH tunnel
Posted: October 19, 2010 in MySQL, Shell scriptingTags: mapping, MySQL, port, SSH, tunnel
Sometimes we face a problem when we have SSH access to the server, but not to MySQL.
Here is a simple workaround – SSH tunnel:
ssh -f -N -L LOCAL_PORT:127.0.0.1:3306 USER@HOST
This command allows you to map remote port to the local one via SSH tunnel.
- LOCAL_PORT – local port to map to
- USER – SSH username
- HOST – remote host
Surely, you can map other ports as well.
When you mapped the port, you can connect to MySQL using your favorite client (you need to specify LOCAL_PORT as MySQL server port in connection settings).