Wednesday, September 03, 2008

Google Chrome - pt 1

Ok, just downloaded it.

So far it looks a lot better out-of-the box than Firefox does.

There are some nice improvements over Firefox for which I have been clamoring for to no avail. Firefox is a hog of CPU and Memory, even when having closed all my pages my Macbook Pro uses 14% CPU to power an Idle, minimized Firefox with only the blank window open... what gives? And, alas, my only recourse to try and find out what is taking up the resources is to use a debugger (and then I can only see threads, not tabs)... granted it seems to be Flash that's the culprit, which in turn made me realize why the iPhone never had Flash... Can you imagine!?

So what does Google Chrome do for me? (I only compare it to Firefox since IE is a non-event for me)

1) Google Chrome uses the standard proxy settings like IE and Safari and not it's own custom ones like Firefox. This annoys me no-end about Firefox since I constantly have to change my settings in multiple locations when I move around.

2) Google Chrome can see offending tabs with regards to excessive CPU/memory use. Yay! Finally!


As for my only negatives I know of so far:

1) Lacks the plugin support of Firefox.

2) Lacks the market standard (for the time being) and thus site-compatibility may be an issue (I have the same problem with Safari)

That's it for now... will use it a bit and let you know how it fares.

Thursday, July 31, 2008

Using OmniCppComplete and vim for C++ auto-completion

Get OmniCppComplete

Then install it: (It may overwrite some stuff... take care!)

ckdir ~/.vim/
cd ~/.vim/
unzip cppcomplete.zip


Then create and set your common tags file: (correct for your local installation locations)

~> ctags –R --c++-kinds=+p --fields=+iaS --extra=+q \
-f ~/vim/commontags \
~/dev/myTools/include \
/usr/include \
/use/lib/boost/include /usr/lib/qt3/include

------- .vimrc:
set tags+=~/vim/commontags
-------






Add mapping to create/update local (CWD) project tags files:

------- .vimrc:
map :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .
set tags+=./tags
-------






Set up some default options:

------- .vimrc:
" OmniCompletionOptions
set completeopt=menu,menuone
let OmniCpp_NamespaceSearch=2
let OmniCpp_ShowPrototypeInAbbr=1
" let OmniCpp_MayCompleteScope=1
-------






Then add any convenience macros:

------- .vimrc:
" Smart VS-type <tab-completion>
function! CompleteTab(direction)
let prec = strpart( getline('.'), 0, col('.')-1 )
if prec =~ '^\s*$'
if "backward" == a:direction
return "\<bs>"
else
return "\<tab>"
endif
endif

if exists('&omnifunc') && &omnifunc == 'omni#cpp#complete#Main' && prec =~ '[\.>]\s*[~]\?[a-zA-Z_]*[(]\?$'
" Class completion... use normal direction
" Use this with omniCompletion
if "backward" == a:direction
return "\<c-p>"
else
return "\<c-n>"
endif
endif

" else use generic completion: last-seen / reverse-order
if "backward" == a:direction
return "\<c-n>"
else
return "\<c-p>"
endif
endfunction

inoremap <tab><c-r>=CompleteTab("forward")<cr>
inoremap <s-tab><c-r>=CompleteTab("backward")<cr>
-------

Tuesday, September 18, 2007

Lock Screen on Mac OS X using keyboard shortcut.

1. Download "Global Hotkey"
2. Create a folder "Global Hotkey" and copy contents of downloaded DMG to that.
3. In a terminal do:
cd "/Applications/Global Hotkey"
ln -s /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app "command f10"
4. Make sure Screensaver is set to prompt for password (you may need to relog for this to take effect)
5. Preferences -> Accounts -> -> Login Items : Add "Global Hotkey.app"
6. Launch the app as well

Thursday, June 01, 2006

Friday, May 05, 2006

Free Windows Firewalls

It seems like every year I need to go through this exersize over and over again.
The Firewall landscape seems to be like a formicating pool changing goalposts and lanscape as you watch.

What was good is now deprecated and vice-versa.

I used to prefer AtGuard, but then new exploits came on the scene which it did not catch (Due to some Windows low-level flaws) and the product was discontinued (and later bought by another company and defiled)

Then I swote by Tiny Personal Firewall (version 2015a), and that also went the way of the dodo.

Then it was Zone Alarm 5 (version 55940).

Then it was Kerio Personal Firewall 4.2.3.912.

And for the past year I was using Sygate Personal Firewall (which I bought)


To my great dismay I have now discovered that Symantec has bought Sygate and basically deprecated the product, and having no great love for Norton/Symantec or MacAfee I started to look for alternative.


These are my options now. (in order of preference)
  1. Core Force
  2. ZoneAlarm 55940
  3. Sygate 5.6
  4. Tiny Personal Firewall 2015a
  5. Kerio 4.2.3.912
  6. AtGuard 322u


For most people I would suggest ZoneAlarm 5 which can be found at OldVersion, but if you have a bit of time (at least initially) but want FULL and I mean *FULL!* control over all programs and access on your machine, look no further than Core Force. It may not be as polished as the rest, but it is totally free and massivle configureable.

Most of these firewalls and versions can be found using google or on the OldVersions site.

My criteria have been:
  • Machine Performance Degredation/Footprint (Sygate was the best here)
  • Ease of Use (ZoneAlarm)
  • Configureability (Core Force, Sygate, Kerio, Tiny)
  • Cost (Can't argue with Free)
Any comments welcome.

Creating a SSH tunnel to the internet.

Ever been at a client with Orwellian access restrictions on the internet?

Why not use what they provide you to the max without cracking their security.

What you will need:

1. Access/login to a linux machine with ssh running on port 80 (or 443)

(See UnixShell - They're grrreat!)

2. The proxytunnel client program.


Creating the tunnel:

Firstly you will need to create a TCPIP tunnel through your proxy server. For my example I'm running OS X (on my shiny MacBook Pro).

To do this, add the following (2 lines) to your ~/.ssh/config file:


Host shell.my-host.com
ProxyCommand /Users/teuton/bin/proxytunnel -N -p "local-proxy:8080" -u "proxy-user" -s "proxy-pass" -d "shell.my-host.com:443"


Great! We are all set! You may need to tweak these settings depending on your local proxy server type and configuration (NTML auth etc)

Now the easy part.

Creating the proxy:

To ssh into your machine simply type:

> ssh teuton@shell.my-host.com

To make things easier it is advised that you create ssh public and private key pairs and set these up... (see ssh-keygen command, and always check access rights are correct!)

Now create a proxy to services you require.

The following will create a SOCKS5 proxy for you:

> ssh -N -D 8080 teuton@shell.my-host.com

This will create a tunnel to your remote POP port: (local port 2110)

> ssh -N -L 2110:127.0.0.1:110 teuton@shell.my-host.com

This will create a tunnel to a jabber port at a 3rd party host

> ssh -N -L 6222:jabber.third-party.com:5222 teuton@shell.my-host.com


How all you need to do is create a script file:


~/bin$ cat t
#!/bin/sh
while true
do
ssh -N -L 2143:127.0.0.1:143 -D 8080 teuton@shell.my-host.com
sleep 1
done


And you are set:

Lastly to configure your applications, just add a SOCKS server entry (no other HTTP/S entries should be added). Some applications may still not work. For these you may need to create custom direct proxies to specified ports.

Sunday, April 03, 2005

So which is better? The Sony PSP or the Nintendo DS?

I recently went on a trip to Japan, and was faced with a choice on a new handheld gaming device to purchase for a friend.

So which is better? What are the differences?

First-off, I personally own a Gameboy Advance, and I finally chose to buy the PSP.

The reason for the choice was that I already owned both an iPod and a Gameboy Advance, but this friend of mine had neither... so for me the DS may have been a better choice, but only slightly.

Firstly the DS:

This little machine is slightly heavier than the PSP, but folds away neatly, it's more solid and resiliant, the games are cheap, load fast and can use older Advance cartridges. The screen has a huge surface and the touch screen is really nifty. The technology is way behind the PSP, but it is also about $50 less in price.

So this device has a huge advantage with current game availability.

It also has a good battery life (something I appreciate after my Japan trip on both my iPod and Gameboy).

The PSP:

This is a slick-looking device, but unfortunately the screen picks up scratches and fingerprints quickly. The teething problems with the first release has been sorted out, so no more bad buttons and broken pixels. It's battery life is poor, but is expected for the processing it delivers. It's really an amazingly fast little machine... way way way ahead of the DS. The games come on disc (UMD) and can hold a lot more than the DS cartrige, but loads slower (only slightly really) and are more expensive. The PSP seems pretty versatile though and you can easily get games and other software and upload it to the Sony memory stick (of which I have 512Mb and you can also get 1Gb now...).

It can also play movies from the disc (or from the memory stick if you (re-)encode and upload it yourself as well as music as MP3 (and some other silly format).

It's got WiFi and bluetooth (and I have already updated the firmware to a new version using WiFi without a problem).

The screen is brilliantly scrisp and clear, and even though it is smaller in size than the DS's two displays, it's still larger in size than a single DS display and about double or more in resolution than both DS screens combined.


Both these devices are good with playing WiFi linked games with multiple players, and the PSP can even 'clone' a game to a second machine allowing you to only need one copy of a game to play multiple players.


Overall the PSP is a well-rounded machine with a lot more potential growth. You will see a lot of 3rd party apps being released for it in the near future.

If you want something innocuous but reliable and fun nontheless, go for the DS.

Just my view.

Thursday, March 17, 2005

Japan trip (pt. 1)

A bit late, but better late than never...

A quick journal of my trip so far:

(Times are as per locality)

5 March:

13:10 Depart from JHB

About a 12 hour flight on which I did not sleep and watched many movies...

07:00 Arrive in Hong Kong

On my first day there, I found my hostel first, dumped all my luggage and started walking.
walk walk walk...

I tried to stay awake until 11pm and got to bed pretty exhausted.

I stayed in Hong Kong for three days, seeing many cool sights and also taking the time to buy a good digital camera (About R5k)

Also saw and met some cool Tai-Chi people, and suffered no jet-lag.

8 March:
11:20 Fly to Tokyo.

Arrived at Narita airport, picked up my JR Pass, caught a train, then a bullet train, then another train, and finally a local rapid train.

I spend the first two days just eating sushi and planning my next few days...

20:00 Finally arrived at my destination... Hozumi. I was picked up at the train station by a friend of Charisse and Jason's called Sumire.

10 March:
I took some trains to Takayama, a city pretty high up and surrounded by mountains... absolutely lovely. Walking into an antique shop I found a nice go table (Goban). Saw many cool temples and shrines. Higher up the mountains I had to trudge through snow... it being only the second time in my life that I have actually seen snow (this time it was just lying there though...)

My path led me up some pretty deserted trails in the mountains (lots of snow... sometimes sunk in up to my knees!) Emerging from a trail there was a welcome restaurant. At this point I should mention that practically no-one speaks English, and that there are none or very few signs in English... this is a Japanese only country... monolinguility? in extreme! I ordered some ramen (yummy!) and some unrefined sake (woot!). After eating I had to rush back to the station to be able to catch my train, as I was not keeping track of time. Fortunately this was not a problem. (The morning train I had missed, but this is really not a big problem since most trains were free for me and they tend to run often...)

The most beautiful part of this day-trip I would say was the trip there and back... an expensive (free for me) train through some stunning mountain passes.

11 March:
Today I visited Nagoya (the closest largish city). This was the first time I got an idea of the sheer scope and popularity of Manga (Japanese comics). 6 floors of comics did the trick. 4 floors of those were purely porn (the Japanese culture is strange... they censor only the genitals... they seem more critical of images than thoughts and meanings. So these comics are pretty damn explicit. An entire floor dedicated to female lesbian porn! (And I don't mean male-centric lesbian porn, guys!) There were also some other stores with more than just manga... they had cels and figurines and some Anime...

Anime here seems to be scarcer... also without ANY English whatsoever... so nothing I can really buy. The most I could buy were figurines and cells.

Manga is sold EVERYWHERE... in every 7eleven (seven11?), on every station platform and in every street. They get Anime for free on TV, so it's not as big. (For us in SA it is all we really see...)

Hmm... perhaps I should make some things clear about their culture...

Pachinco centres... these seem to be popular as well... kinda quasi-legal gambling (a recent thing). These parlours have a huge number of metal ball-based machines sticking out like sore thumbs all over the place and basically just making a lot of noise. I really pity the people in these places.

Cell-phones. Japanese cell phone networks are TOTALLY incompatible with the rest of the world... they are also way, way ahead of us. The cameras in these phones are 2Megapixel and up... they all get upgraded CONSTANTLY. About half the people I see who aren't otherwise occupied are always busy on their phones... I've even heard of girls text-ing away on two phones AT THE SAME TIME!

Also, second-hand does not exist... people just don't really buy second had stuff... so it's pretty cheap!

You only get antiques and recycled goods.

Anyway... back to Nagoya... only Charisse and I went, and met a friend of theirs names Kobus (a SA ex-RAU student basically doing a thesis... quite an interesting chap.). Charisse had to leave early, so Kobus took us around some shops and later left me to my own devices.

(He also helped me buy a Japanese/English translator... quite an amazing little device really...)

After wandering around a bit more in the rain, I decided to call it quits and go home. I took a subway train to the main Nagoya station, and instead of going home I decided to check out an electronics store close to the station first... wow! (this was not an exceptional store either!) It was about 7 floors of electronics!

I did not stay long, and left for Nagoya station again after which I went home to Hozumi.

12 March:

Today I drove to an interesting place... got a good idea of the traffic here. I went to visit a place called
'The Site of Reversible Destiny'
Which was an exercise in architecture and geometry and how it can confuse the senses... look it up on the net!

Nothing much else done... only a cool party in the evening.
This part ended at a Karaoke bar... I was pretty amazed at the selection available... even had some Nine Inch Nails... but I refrained from doing these. -grin-

One of the guys there even did the Cowboy Bebop theme song (just for me -grin-). A cool thing is that he (Hideki Kudomi) was a character designer on the 'Real Myst' game! His business card looks sooo cool!
:)

13-16 March:

I decided to tour a little... first I went to Kyoto. There I visited some temples and castles and shrines and basically just walked and walked and walked. I stayed for two nights there. I also tracked down and found a Go salon... had a quick game or two (or three).

Then I left for Osaka... here I just experience the city some... nothing really special... like Tokyo (which I'm still to visit) just less so. (Still quite impressive and intimidating)

I only stayed here for one night (uncomfortably) in a capsule hotel (missed the 'Love Hotel' experience!). It's really just a little capsude (with lights, TV, clock).

The next day I decided I had had enough of Osaka, and on a whim decided to visit Hiroshima. Well... It was a wise thing to do. It was awesome! It was also pretty warm... I only needed a T-shirt!

Hiroshima was the bomb, Baby!
;)
It was also quite toasty... -grin-

-cough-

Anyway... city is of great cultural and historical significance... it symbolises one of the greatest lows of the USA. Quite a moving moment to have been to ground zero (IQ).

Having had enough of this... I head back to Hozumi (Read: Home)

17 March: (Today)

Wrote this blog and did some future (financial) planning.

I'm going to buy the Goban tomorrow and investigate ways of getting it back to ZA. I've also booked for my stay in Tokyo (4500 yen per night) and needed to borrow some cash from Jason.

Ah, yes... Japan does not DO credit cards... Hmm... there are *some* vendors in Tokyo, but in general they seem like a pretty isolated country.

They have all the big brand stores here... much more quality stuff than SA could ever have, yet they are missing something. They seem more concerned with images and appearances than in quality and meaning... at least that is the modern youth's view.

They are more first world than I have even seen in Europe, yet I feel it is a step back, somehow... I sound like I am contradicting my own words, yet this is how I can best describe Japan.

Anyway... off I am.