VNC useful commands

Below is a list of vnc commands I often use to manage vnc sessions on my ubuntu linux box. # start a session vncserver -geometry 1600x1200 -depth 24 -alwaysshared # specific display numbers ## sublime ## vncserver -geometry 1600x1000 -depth 24 -alwaysshared :200 ## eclipse ## vncserver -geometry 1600x1000 -depth 24 -alwaysshared :300 # see what sessions are active ls ~/.vnc/*.pid # kill a session vncserver -kill :[session_num] # help vncserver -h Here is more online references for more options you can set. http://www.realvnc.com/products/open/4.1/man/Xvnc.html ...

June 13, 2013 · 1 min · birdchan

Setting up a VPN server on a Mountain Lion Server

This is a guide to set up a simple L2TP VPN connection. My mac mini server has mountain lion osx v. 10.8.2. I have also signed up for a “domain” at http://www.no-ip.com/. You may want to make sure you can ssh to your server first from the outside network before moving forward. I have my server behind a linksys router so I need to set up the router first. Bring up the router page, mine is at 192.168.1.1. Then click Security -> Firewall. Then uncheck the Block anonymous Internet Request. Yea, sounds scary isn’t it? Then click Save Settings, the router blacks out, then comes back. ...

November 7, 2012 · 2 min · birdchan

splitting and joining huge files

Today I wanted to sftp a 10Gb file over the wire. Knowing that the transfer would fail in the middle of it, I decided to split this file into small pieces beforehand. Below I think is the easiest way on osx. // to split my huge file into 100mb files, having the prefix "bak_" split -b 100m my_huge_file.ext bak_ // to re-construct my huge file cat `ls bak_*` > my_huge_file2.ext After running the split command, you will see some files named bak_aa, bak_ab, etc in your directory. These are the chucks of your original huge file. So just transfer these small bak_* files over the wire. ...

November 3, 2012 · 1 min · birdchan

DNS flush

Sometimes you may need to do a DNS flush, say after a mysterious DNS network issue. Here are the commands. Mountain Lion / Lion sudo killall -HUP mDNSResponder Leopard sudo dscacheutil -flushcache Tiger lookupd -flushcache Windows ipconfig /flushdns Run a nslookup or ping to check if you are indeed getting the correct IP(s) from the DNS server(s).

October 16, 2012 · 1 min · birdchan

Installing mysql on osx

I often need to do this so I figure I will write it down to remind myself later. First, download the mysql installation dmg file (version 5.5.20 as of now). osx already comes with mysql but I like the extra System Pref icon after the manual install. You can download at http://dev.mysql.com/downloads/mysql/. Pick Mac OS X 10.6 (x86, 64-bit), DMG Archive. Once you have the dmg file, open and install all three files ( mysql-5.5.20-osx10.6-x86_64.pkg, MySQL.prefPane, MySQLStartupItem.pkg) in there. ...

June 30, 2012 · 2 min · birdchan

Installing memcache on osx for php

Finally got memcache working! I am compiling the steps here in case I need to do it again. First install libevent. This is a dependency to memcached, so need to get it. cd /tmp curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.17-stable.tar.gz tar -xvzf libevent-2.0.17-stable.tar.gz cd libevent-2.0.17-stable* ./configure make sudo make install Then install memcached. # Compile memcached utility cd /tmp curl -O http://memcached.googlecode.com/files/memcached-1.4.13.tar.gz tar -xvzf memcached-1.4.13.tar.gz cd memcached-1.4.13* ./configure make sudo make install At this point, if everything goes well, the memcache daemon should be ready to run. You can try the following to see if memcached returns anything to you. ...

June 21, 2012 · 2 min · birdchan

"You have new mail" on osx

Sometimes when I open up a new terminal I see the following, notifying me there are new mails in my system mail box. Last login: Tue Feb 28 18:57:43 on ttys006 You have new mail. Just how to read those emails? You can use “mailx”. my_osx_box:~ birdchan$ mailx This is a very linux like mail program, so don’t expect fancy controls. Below are some commands that are enough to get you through. ...

February 29, 2012 · 1 min · birdchan

installing osx from an external hard drive

For whatever reasons if you need to install osx from an external hard drive, here are the steps I have tried and verified. In my case I installed snow leopard onto a mac mini from an external usb hard drive. First of all, go get the snow leopard image file in iso or dmg. Then we will need to prepare for your external hard drive. We are going to erase its content so please make a backup first. ...

May 8, 2011 · 1 min · birdchan

osx random freezes

I have had my macbook pro 13-inch for about 2 years now. It’s been running very well until recently, it randomly freezes. The keyboard and mouse would not respond and I would be forced to do a hard restart. After a few incidences, I noticed that this often happens when I am watching a youtube video or any long videos on VLC. At first I thought it was some corrupt libraries in the kernel and so I re-installed osx, but the problem remains. Then I clicked around, trying to investigate… to my horror, it was actually that my cpu fan stopped spinning! ...

April 9, 2011 · 2 min · birdchan

To limit bandwidth in osx

There may come a time when you want to limit your http download bandwidth coz it’s taking up all your bandwidth. I came across two apps that try to accomplish this task but I am afraid to say they are too hard to understand. So let’s just do this in the terminal. 1. First, create a pipe/rule that allows 100KB/s sudo ipfw pipe 1 config bw 100KByte/s 2. Then assign that pipe to port 80 which is the remote web server’s http port #. It’s src-port coz the data is coming into your computer. sudo ipfw add 1 pipe 1 src-port 80 ...

November 28, 2010 · 1 min · birdchan