Monday, November 25, 2013

Use Fiddler to help with development with Web API

Developing application that connect to Web API can be quite a pain if we are not equipped with the right tools. Network issues, response format, request parameters, could add more to an already existing complexities. On the early days, I usually use Firebug for most of the task to debug Web API. Lately, however, I rely more on Fiddler. It does all that Firebug do for me plus much more. Compare to Firebug, Fiddler the debugging feels much more active since we can modify and manipulate a lot of things to test different cases on Fiddler itself without having to write test code or scripts. It sits between the application and Web API so we can build scenario to test each side.

Here are some of its use :

  • Tracing request and JSON response. This is probably the most important ones. Tracing response on the code or by debugging in IDE can drain a lot of development time quickly. By monitoring it outside the application in realtime help us to focus more on the next step i.e: fixing code, add feature
  • Emulate scenarios. The request / response can be emulated in Fiddler which enable us to see how the server or client response on certain request / response format and content without having to write the code first and do expensive IDE-based debugging
  • Offline response. There are times when we want to rapidly and quickly test client behavior on certain response. Having to actually request to server could make the work take long since each request involve the whole request / response sequence. Fiddler could tap certain request format and give cached/predefined result instead. This will speedup the work since there is no actual network request happening. It could also help when we have issues with network availability when developing
Those are just some my main use cases that I've encountered mostly. It has many other tools that can be useful for various Web-API-related task.

Wednesday, October 30, 2013

XtraGrid : Use more specialized event for better code in handlers

DevExpress's XtraGrid is quite a complex beast. It's a library with tons of features and it can be overwhelming to use it optimally at first. So you might get your job done with certain way but overtime you find something new that you didn't notice at first that actually a better way than how you did previously.

That is the case when I just notice that XtraGrid has RowCellClick event that fires on specific cell click. I have been using Click event previously. Click event work just fine, however within it I need to have numbers of code to filter out cases that is not relevant to what I am trying to achieve. On the other hand, RowCellClick already comes with RowCellClickEventArgs with all the relevant info has been nicely parsed for use. The code get much cleaner when I adapt the code from handling Click event to RowCellClick.

So, the lesson is to use the most specific event that fit your case instead of the more general one. It can be a good guideline for using other parts of DevExpress library too. DevExpress components do a lot of inheritance from .Net components and with it inherit lots of pre-defined functions too. So, it has to do some specialization to extend the functions. Hence, it has some functions that is quite similar but slightly specialized.

Springpad + Evernote, Revisited

I wrote about using Springpad and Evernote sometime ago. My use of them since has evolved following the progress of those two services/apps. For example, Springpad note support was quite basic at that time but now it has become quite consistent and enjoyable to use. So, some of my setup has follow suit.

I now use mainly Springpad while Evernote is more for exceptional things like on the cases below :

  • Need things offline
  • Long writing
  • More "sticky" stuff like resources for projects
  • Scans and documents
Springpad has now can fulfill most of my needs. It's better not to have too much tools and have things duplicated so I cut down my Evernote uses. It still an important part of my system though within its scope. As for Springpad, here's ans example of how I use it for :
  • Manage and track media : movies, series, books, games, etc. It is really useful on this
  • Checklists : Springpad checklist support is quite advanced and it's what I have been looking for sometime
  • Project research and resource collection : Springpad has various type of content, not just notes, that makes collecting resources for projects really
  • Random notes, items and collections : for collecting interesting item from either online or offline that has not yet fit anywhere yet. I can search or organizing it easily later on

Friday, October 11, 2013

Visual Studio Deployment Project : Make Single Executable Installer using WinRAR

I wrote a while back of making a single executable installer for Visual Deployment Project (which output two file : setup.exe and setup.msi).  It was done using IExpress that comes with Windows installation itself. However, it feels quite outdated now. Even the page that I refer to in that post is no longer works :). It require some scripting and the use of IExpress is not exactly intuitive nor friendly.

So, comes more straightforward solution using WinRar. I stumbled upon this post on stackoverflow. It basically intend to do the same thing using self-extracthing-archive feature in WinRar. It works much better and more maintainable. It does not require external scripting and you can add logo, title, description for the bootstrapper. I find the resulting installer looks cleaner to run with helpful info/logo.

You can checkout the post above for some description and screenshot (hopefully stackoverflow link is more long-lasting). In summary, the steps are :

  • create New Archive
  • set to SFX mode
  • go to advanced tab
  • click SFX options button
  • customize things to your needs
The rest is about experimenting until you got the setting that suits your needs. After that,  you can save the setting (Tab General -> "Save current settings as default") and later when you create self-extracting-archive it will be done according to your last setup.


Tuesday, October 08, 2013

Note from "The Lean Startup"

I have recently finished reading "The Lean Startup" by Eric Ries. It takes an experimental (as in scientific method of testing hypothesis) approach to make the work more efficient (does not waste valuable time/cost) and efficient (working on the right thing).  It emphasize on the importance of rapid learning and adjustment based on that learning. In this aspect, it seems to use the same foundation of Agile Software Development i.e: make small iterations and adjust/improve process/prediction after each iterations.

Below is summary of the process on Lean Startup:

  • Make leap of faith. Make your hypothesis that you think is true, just make your best guest what will be useful and interesting to user so they will use it. Assume for now that it is true.
  • Develop Minimum Viable Product. Work on smallest possible set of feature that will have significant effect first. The smallness is important for having rapid feedback for learning
  • Validated Learning. Review the reesult of the above using actual/verifiable data
  • Pivots. Decide based on the learning above what is the best course to take next. This could be improving things, discarding things or drop it and do something else entirely
In essence, the process actually useful in many areas of life. Having a rapid feedback can minimize our accumulated errors.

Friday, October 04, 2013

Accurate and Consistent Naming, the simplest yet has the most beneficial discipline in programming

I think if you have to name one discipline that is the most simple but give the most return in term of maintainability, it's probably proper naming. You can do any fancy pattern or coding practice but if you are lazy in maintaining consistent naming of variables, functions, classes, your code will soon rot and unmaintanable. Ironically, it probably the simplest practice to do, especially with powerful capabilities in todays IDE and text editor in doing search/replace and rename-refactoring.

When you don't consistently naming everything properly in your code, you'll obscure your code intention thus making the maintenance hard even for yourself, let alone others. I prefer to write code that I can forget, meaning the code that when I visit it again in the future, it will take the least effort for me to remember what it is that I intent to express with it. Ideally, looking at the naming, structure and perhaps some external notes and diagram should be enough for  us get an understanding into the code again.

There is now a lot of guideline how to do consistent and proper in naming in codes. There might also some variation of guidelines between  languages, framework, platform. Whatever standard you use, any naming guideline/standard is better than none, I guess. Do yourself, and others, a favor and properly and consistently naming things on the code.

Thursday, October 03, 2013

xUnit : Low Cost/Commitment Unit Testing

I have been having love/hate relationship with Unit Testing so far. I understand the need and rationale behind it and often times I even enjoy doing it and makes programming more fun. However, when the tests has hit certain large  numbers and you accumulated significant cases where it just hard, if not impossible, to test (despite decoupling the code heavily and usage of patterns in high-dose), unit tests becomes a chore and annoying burden to maintain. You start to question yourself it's worth the trouble and should you just going forward without TDD.

I find the test framework that I use is a significant factor whether I keep unit-test the code. Having found xUnit sometime ago, I can now say again unit testing is functional, useful and fun again. Unit tests is support/driving activity of the main activity (coding), so the simplest possible support code/framework is the way to go.  xUnit has minimal "accessories" which make writing test code quick and straightforward. So far, it fits my need of unit test framework. For example, it get rid of Setup and Teardown and use very minimal set of attributes.

One important thing, psychologically for me, of having simple unit test framework is it makes my attachment to my unit tests relatively low. This means I can throw away, rewrite, change my unit test anytime and anyway I want with very minimal guilt. I can throw away large number of any unit tests that no longer serve any purpose and start over with the tests progressively. I can do architectural level changes with more freedom without unit test maintenance becoming too much of a burden. My focus now back to the main logic of program with unit test to support it.

Of course, at some level, unit test framework can be very personal choice like choices of your favorite text editors or OS. Personally, I like xUnit for my (.Net) testing framework. If you have been throwing unit testing from your development arsenal lately, you might want to try xUnit and see if it can interest you to get back to unit testing your code again.

Wednesday, October 02, 2013

Free solution for .Net Profiler : Slimtune

When it comes to profiling and performance tuning of application for .Net application, the proprietary solution can be quite expensive. However, I stumble upon SlimTune recently. It's a free .Net profiler and I find it quite sufficient for common profiling needs.



If you just interested to see your application performance hotspot, it already does that quite well. It's not fancy, sure, and the GUI need getting used to initially, but it does it's job fine. I can spot and tune the performance issue quickly with it.

Thursday, September 26, 2013

No Duplication for a Good Code and Good Life

More things in life does not always leads to a good quality life. If the things is duplicated, its function is already done by something else, it's existence is a clutter and use up unnecessary energy. The duplication is bad in code too, it is a nightmare to maintain the same logic that scattered on several places. One changes on one place need to be repeated on the other ones that use similar logic, otherwise you'll break the code.

Having enough things is not just about living a minimalistic lifestyle, it also a way to stay sane, to not use things unnecessarily. If we can simplify things internally, we can achieve more complex meaningful things with much ease.

Wednesday, September 25, 2013

Bootstrap : Programmer's Friendly Web Front-end Framework

I had task recently to port some web content into a mobile App. I translated some web-navigation navigation into native mobile one. For example, some section listing is translated into TableView in iOS. However, for the content pages itself I need to basically put the HTML content into an offline-bundled resources within the App.

Below is some problem with the task :

  • The Desktop version link to various online Javascript and CSS resources
  • The layout is for desktop and need to be made more mobile-friendly
It will be time consuming to try to proceed without some kind of reusable solution. After some research I settled with using Bootstrap to help with the it. It's a web front-end framework that bundle some Javascript and CSS into a convenient package. My plan is to offload the script/style to it so I can focus on porting the content.

The content of bootstrap pretty much suffice for the current typical need for multi-device HTML rendering. At least with it I can port the existing Desktop-based content pretty quickly for offline mobile consumption. The styling and layout is already fit out-of-the box to my need. I can strip the existing Javascript and CSS references and make the content use things from Bootstrap. There is still some labor work on the porting but doing on top of a good foundation makes it more manageable.


Thursday, September 12, 2013

JEdit : One Text Editor to Rule Them All (Functions and Platforms)

Any programmer would say his favorite text editor is the best one so I won't bother saying which one is best :). However, I do use one text editor, JEdit, for quite a long time already and find it a really useful text editor. Below is some of the reason :

  • It does "everything" I can think of and more. It has a rich plugin list and so far I haven't find any of my needs that is has not met. Apart from coding which I do mainly on IDE, I use JEdit for the rest. Editing and Viewing binaries with it's Hex editing plugins, Editing XML even using it as a full-fledged IDE for some language e.g: Ruby, Python.
  • It runs on all Platform. One of my main priorities of text editor is it needs to to be able to run on OS that I use. I did works on Windows, Mac and Linux so having text editor that can run on all of them is a big requirement for me. It saves a lot of time to be familiar with one advanced text editor and can run it on all system. The time you spend customizing the configuration, learning the shortcuts will pay off really well.
There is one situation that I can't use JEdit though and that is the time when I am working on command-line/shell. When that happens, VIM is my friend. So, I guess, JEdit doesn't really rule everything yet.

Wednesday, September 11, 2013

Code for your future self

It's quite annoying to work on existing code that you find hard to navigate and understand. It makes you spend some significant time first to understand the existing structure before you can finally add the feature or fix bug you intend to do in the first place. It does not have to be the code written by someone else, even your own code can give you some hard time when you revisit it again at the later time.

That is why the importance of writing good code is not just so the features runs well and the code looks good to your peer. It is also for your own benefit to have the code done in a well-designed and intuitive way at the moment you wrote it.

There will be temptation to code something quickly when deadline is approaching or you just feel lazy to extract those abstraction that you find. For your own sake, resist them and write code properly in the most natural and the most obvious way you can think of it. Your future self with start with that kind of intuitive thinking before he jump into specialize cases, workarounds and other tricks.

Here is an example of the things you can do to minimize the pain of your future self coding session :

  • Choose good naming. This is simple and highly essential but easy to break at the time when you feel lazy or under pressure
  • Have all the dependencies locally and self-contain whenever possible. For all dependencies that you can not put locally, put detailed documentatio on how to get it
  • Automate and simplify the build system. Again document unscrypted steps extensively
  • Make notes and diagram on general architecture. Give high level diagrams and don't forget to update them when it no longer reflect the actual code. Do not go into too much detail on this. Focus on  describing the big picture of architecture on the notes and diagram and let the code speak for itself whenever it can
Think of yourself when coding. He will thank you greatly later when he has to work on it again in the future.You know, even your current self will appreciate it too. It's much more fun to make a good code than to make a hasty/sloppy/buggy one.

Tuesday, September 10, 2013

Focus on Personal Workflow and System, Not Gadget and Apps

Gadgets and Apps are abound today and the discussions that runs mostly are about what Gadgets can do this and that. I think many times the focus are misplaced. Gadgets are just tools and what is most important is the personal system workflow that a person has. Without that, gadget has no context and will just be a distraction with each additional feature. However, when you have system, each feature on the gadget can use to improve certain aspect of that system.

When you have a workflow involving calendar and reminder, a good calendar app can make that part of your system more optimal and in turn will make the overall system runs better. However, when you don't have need for calendar in your personal workflow (which is not a sin, BTW :) ) it will be just a toy to try a little bit and never used again or worse you keep keep wasting time using it without adding any benefit to your system.

So, I guess what matters is what system that you have and what combinations of gadgets and apps that can make it runs better. Researching new gadgets and apps can be useful if you use it to see how you can improve your existing system with it.

Monday, September 09, 2013

Winforms C# : Prefer initialization in constructor instead of Form_Load event handler

On Windows Forms, I have been doing initialization of values on Form_Load event handler. I use constructor mostly for make instances of member variables and setting basic/default values. I did the rest of the settings e.g: config, last state, on Form_Load. It turns out that it's not actually a best practice to do so.

I've just stumbled upon this discussion on Stack Overflow that explain that it is actually better to minimize the use of Load. In summary, here's the guideline on Constructor vs. Load issues :

  1. Initialize things on constructor 
  2. Only use Load for code that needs valid windows handle e.g: code that requires the window size and location to be known
  3. Override  OnLoad instead of using Form_Load event handler. This ensure more deterministic order of execution in relation to parents OnLoad call
I guess it's time to change the habit.

Friday, September 06, 2013

When You Know Better, Code Better (In the meantime, code it the best you know how at the moment)

There is a good, albeit very short, article on Lifehacker titled "When You Know Better, Do Better". The important take of the article is actuall the message "Do the best you can with what you know now".

There is always a better way to do anything. If we got preoccupied wondering if this is the best we can do right now we'll get paralyzed and nothing will get done. Even worse, when we finally decide to take action anyway, we might take less optimal approach due to self-doubts.

I think this is even more apparent in programming world. There are literally thousands of choices available for us to solve a programming problem. From libraries, frameworks, patterns, languages, text editor, diagram tools, we will probably won't do our best work if we agonize over what is the best that is available.

Referring to the advice above, we could focus our search for the best on what we know already at that time. We will learn new things along the way and at later moment we can do our best again with our knowledge at that time and repeat. I find this quite liberating and help a lot to minimize the noise on the head while coding. I can focus to produce the best work with what I know at the time. I'll do better when I know better.

Thursday, September 05, 2013

Diagram Smell and Refactoring

My use of UML for reverse engineering the existing code perhaps the same amount as my use of it for designing codes to be written. They both server the same purpose though, to give me insights on  what to do next on the code. On reverse engineering case, it sometimes reveal certain connection that does not look right. There is a term Code Smell, so perhaps this could be named Diagram Smell.

The same as Code Smell where you see/feel something unpleasant on the code e.g: conditionals that looks like stairs, duplications everywhere, diagrams that is not pleasant to see and draw could hint part of the system that is not optimally structured.

Below is an example of diagram that looks suspicious :


Sometime, when I encounter the construct as above, there is a superclass that is waiting to be extracted. The code can then refactored that when reflected to diagram can be seen as below  :

Of course, visual can be subjective things. Some people might not like the picture above :). However, I think we can now "understand" the nature of Class A and Class B better. We can also see more naturally their connections with the related helpers. I like things that could add the understandability of the code, it will ease maintenance in the long run.

Bad-looking diagram does not always means bad code though. It just a hint for us to look more at the code in case there is potential problem to be fixed. It could be the code is already in good condition while we draw diagram from the wrong understanding of it.








Wednesday, September 04, 2013

Book Notes : Paradox of Choice by Barry Schwartz

I have recently finished reading "Paradox of Choice" by Barry Schwartz. Below is my personal notes of it.

The book is centered around reminding us on how the larger number of choices does not always means more happiness. It is true that low number of choice is limiting and certain number of choices can empower us. However, when the choices has grown large several factors started to come out that could limit our effectiveness to utilize those choices. Factors like regrets, opportunity costs can ruin our lifes as much as, if not worse than, the lack of choices.

Regarding the above issues, the book can be quite repetitive. It discuss the same matters several times although using different studies and perspective. I am already quite convinced that too much choices is problem by half of the book, so the additional facts add little to it although still quite informative. The book finally closes itself by summarizing some things we can do to manage the explosion on the number of choices to our advantage. It discusses the "trick" along the previous chapters but it gave one chapter to lay it out in a summarized format. It is useful for reviews and make some plan of action.

Below is some of what you can do when faced with choices so you can utilize it optmally :

  • Choose when to choose. Decide on which area the choice is important and then spend time energy to make a good choice there. Still, limit the number of choice, so you can choose effectively. As for other areas, just stick to safe defaults.
  • Be a chooser. Have time to reflect and not being pressured. Can choose to not choose and create new options and opportunity instead. Decide substantial goal and evaluate choice based on it
  • Satisfice more and maximize less. Choose things that is "good enough", fulfill your needs and be happy with it, do not worry about loosing the ultimate best, it might not worth your time
  • Think about opportunity cost of opportunity cost. Do not worry too much about what you miss
  • Make decisions non reversible. You'll regret less
  • Practice an “Attitude of Gratitude”
  • Regret Less
  • Anticipate Adaptation. Be aware that you will finally get used to what you choose. It might not get as exciting as you experience initially. Remind ourselves about the intrinsic quality of the choice that we have made
  • Control Expectations
  • Curtail Social Comparison
  • Learn to Love Constraints. Choices within constraints is better then having none or having infinite one
Now that I think about it again, the above items might not have the same impact to the reader if the book does not repeat the ideas throughout the book on a different light. With all the books, blogs, news, apps, musics, movies, games, gadgets and with the current flood of "stuff" in our world today, this book can serve well as a reminder to not get carried away and lost ourselves and our sense of purpose in the middle of it.

Tuesday, September 03, 2013

Use Fody to Simplify INotifyPropertyChanged Implementation

I was looking for a way to simplify implementing INotifyPropertyChanged. The standard way was too noisy to my taste so it would be really nice if there is a way to simplify it. Early on the search I stumble upon PostSharp . However, it's quite expensive and seems to be a relatively big "framework" for just my simple needs.

I later found the PropertyChanged.Fody and it fits my needs nicely. It is free and works really well. You just need to install with the command below in NuGet's Package Manager Console

PM> Install-Package PropertyChanged.Fody

and you are good to go. NuGet will take care of installing the needed dependencies e.g: Fody.  Implementing INotifyPropertyChanged is now just a matter of adding  [ImplementPropertyChanged] attribute to a class. Very convenient.

Monday, June 10, 2013

Hiding Future Task on Pocket Informant for iOS, A Workaround

Pocket Informant is a great software. I have used it since Windows Mobile days and now its 3.0 version of Pocket Informant iOS. I find many of my needs can be met with it in some way. However, one important thing that missing from is a good way to hide future task from showing.

The above makes my task list looks cluttered with tasks that I don't want to focus on right now. This is most annoying on routine tasks. For example, on a routine task that repeat daily, when I complete today's task the task for tomorrow will auto-generate and show up on the current list. It makes the list not as clear to look at compare if it's gone from my view until tomorrow. This kind of option exist  Toodledo's own iOS app but somehow does not get into Pocket Informant so far.

Anyway, not all is lost. I still like to use PI and there is some indirect way to make future task, especially the routine ones, can be better managed in PI in it's current state.

Utilizing Grouping


The grouping feature on Pocket Informant is nice (can be accessed on button on upper right corner).  t has great visual and easy to access. I use grouping by Due Date to separate future tasks from the rest. It helps on some circumstances but still can be a problem when I need the grouping for some other field. When that happen, I just group as I needed and try to ignore future tasks from it's label that does not say 'today' or blank.

Filter by Tag

Another feature that can be used for hiding future task is filtering by tag feature. I label the routine task with specific label so when I really need them to go away to focus on non-routine task including those what will happen later, I can just filter the label from showing.

So far, with the above workaround, I still find it usable and does not hurt so much on my workflow. It still better if there is true future task filtering though.

Friday, May 24, 2013

Workaround bug in Android's DownloadManager

Bug in Android's DownloadManager service is quite well known. You can check it out here and here for some example. Here is what I found on my use of it :

  1. Some files are re-downloaded and and saved with '-1' suffix
  2. Some other files are re-downloaded but failed on the second download. However, it just not fail but together with it, the first succesfully downloaded files are deleted!
  3. The events on 'onReceive' is pretty whacky too which takes some tries and hack to get it right
Suffice to say it was no fun and I saw hours of work just goes out of window because of it which can be used for more productive work if the API just do what it supposed to do as stated on the documentation. Strangely,  so far there was no good workaround that I can use on my case. Some are overly complicated that I don't see them as justified in term of long-term maintenance cost.

In my case, the first case above (successful double download) is not my primary concern. The duplicates are negligible. However, the second one done some catastrophic damage on how my code are run. So, after trying things here and there, here's what I come up with in pseudocode :
  • prepare two files : the true destination file and temporary destination file
  • download to temporary
  • right after download successful,  rename temporary to original destination file
  • now, in the case Android going into the second case above, it will try to delete temporary file instead and the original destination file is save
Below are the code snippet to be put in onReceive of BroadcastReceiver :

   1 if(status == DownloadManager.STATUS_SUCCESSFUL)
   2 {
   3     File fileTmp = new File(fileNameTmp);
   4     File file = new File(fileName);
   5     
   6     if(file.exists())file.delete();
   7     fileTmp.renameTo(file);
   8 }

Tuesday, April 02, 2013

Releasing resource in Java (no destructor)

I needed to release resource in Java class and thinking about C++ style of resource management in class (open in constructor and release it in destructor). It turns out that there is no destructor in Java (finally doesn't cut it). So instead of open the resource in constructor and release it in destructor I should open it locally in the function and use try finally construct. Something like below (quoted from StackOverflow link on references list below) :

Resource r = new Resource();
try {
    //work
} finally {
    r.dispose();
}

Not as elegant as having the real destuctor (I'll need to use the above locally in every functions that needed it) but it gets the job done.

References :

http://stackoverflow.com/questions/171952/is-there-a-destructor-for-java
http://c2.com/cgi/wiki?FinalizeInsteadOfProperDestructor

Wednesday, March 13, 2013

JodaTime, for easier DateTime handling in Java

Having tasted the DateTime classes in .Net made you wish that there is something like it on the Java World. Compared to .Net's DateTime, what's available on Java world regarding the date and time handling feelds a little dated. It turns out that there is even  a better stuff on Java, JodaTime. It has more detailed and useful abstraction regarding date time matters. It even has a sister library NodaTime for .Net which seems shows that the abstraction choices adopted to significant number of developers.

You can head out to it's front page and read "Why Joda Time?" section on overview of the relevance of the library. For me personally, it makes the bridging from .Net world of DateTime to Java world easier

Friday, February 15, 2013

Tunnel Internet traffic through OpenVPN per client only

We have been using OpenVPN at the office to access development resources only. So, as long as we have LAN connection to the VPN host server all is good. However, there is the need to direct all traffic including internet through it. It can be useful on public network to have it as a secure tunnel for all traffic to have more peace of mind. I don't want it to apply to every connection, I still prefer using internet non-tunneled on secure local network for speed reason.

Some references assume the setting is to be applied to all connected clients so the setup is set on server config. The notes below move the server-side setting to client so it can be set per client/case only.

Setting things up on the server side

The server is Ubuntu using Shorewall as a Firewall. What is needed on the server side is setting NAT from OpenVPN interface to the internet so the internet traffic from vpn can be forwarded to the outside world. Here's what to do

Allow IP Forwarding in /etc/shorewall/shorewall.conf :

IP_FORWARDING=Yes

add entry to /etc/shorewall/masq :

eth0    [vpn network IP]

allow traffic from vpn to internet on /etc/shorewall/policy :

vpn net ACCEPT

Client Side 


Here's the lines to be added on the client configuration :

redirect-gateway def1
dhcp-option DNS 8.8.8.8
dhcp-option DNS 8.8.4.4


Google DNS used to override whatever exist on client system in case it cannot be accessed through the tunnel.

I make two different .ovpn file with the same keys setting but one has the above setting. This makes it easy to switch between the one for tunneling internet traffic and vpn-lan-only.

That's about it. Below is some source references :

  • http://openvpn.net/index.php/open-source/documentation/howto.html#redirect
  • http://wiki.debian.org/HowTo/shorewall (part about PAT and NAT)


Tuesday, January 08, 2013

Utilizing Springpad with a little help from Evernote

I stumble upon Springpad sometime ago. It was on some discussion on some forum (probably stackoverflow, it's a bit hazy now) about programmer's notebook. It was hard to really pinpoint the usage of it for me initially since it's feature is all over the place. I can't really describe what it is personally, you just have to try it yourself to really get the feel of it. It's a mix of Evernote, Pinterest and probably several other cloud-services.

I tried to use it for several purpose some which does not seems to fit well. In the end I settle with using it for more collecting-related purposes. It is a great tool to collect things on the fly. On GTD space it is great for Inbox and Someday/Maybe stuff. I migrated my Waiting-For list to it also since it has a good list item support. Here's the highlight of it's features that relevant for my usage :

  • Flexible views. You can see the items using several different layout : cards, list, custom. If you are an Evernote's user, you might find some visuals quite interesting compare to it, at least visually
  • Notebook and Tagging organization
  • Great iOS mobile client feature-wise although still quite buggy in term of stability
  •  Interesting collecting workflow. Saving books, movies and other stuff is actually fun
The noticeable part where Springpad is still lacking is on the note part. It's mobile implemention is quite out-of-sync with the web one. I tried to copy some materials through it's web app which end up uneditable on the mobile. Some that is editable contains various character-encoding artifact. You have to be really careful to get the notes in-sync with mobile experience which is quite a deal-breaker for me. I'd rather focus on my work than spending time on hand-fixing the notes.

Comes Evernote to the rescue. I am not a newcomer with Evernote, it's just that somehow I prefer OneNote style of note-taking (on iMac I settle with Growly that has the closest workflow with OneNote) so I am not actively using it. I have been thinking about porting the note-taking business to the cloud though and it seems a good time to do so. Not much needed to say when related to cloud-based note app since currently Evernote is the de-facto standard. I need to adjust my system though since it only has limited notebook number allowed and the organization seems to center around tagging (I think I am gonna miss OneNote a lot due to this).

So, the serious note matters are on Evernote while Springpad note system currently only useful for basic notes for me. I might switch fully to Springpad if it has a comparable note feature (accross multiple device that is). Until then, having to switch between the two is bearable considering the usefulness.