Monday, 6 June 2016

用 SSH client 連 Windows VirtualBox 裡的 Ubuntu

前言

本人所用的SSH Client 是MobaXTerm。但其它種類的Client 例如PuTTY也沒關係的。這篇文章並不會含蓋到我們用的SSH Client。主要是設定我們VirtualBox的Ubuntu OS 及 VirtualBox 本身的設定。

環境

電腦OS; Windows 7
VirtualBox 版本:Version 5.0.20 r106931
Ubuntu版本(安裝在VirtualBox上):Ubuntu 16.04 LTS (GNU/Linux 4.4.0-21-generic x86_64)
ubuntu-16.04-server-amd64.iso
=========================================



Step 1: 在Ubuntu安裝openssh-server


方法1. 下sudo apt-get install openssh-server
  ~$ sudo su -
  ~# sudo apt-get install openssh-server

方法2. 安裝系統時可以直接選擇安裝OpenSSH server
安裝Ubuntu的時後會跳出Software selection 這時後我們就可以選擇OpenSSH Server





Step 2: 設定VM的Port Forwarding 設定

改變VM的設定 



Step 3: 用你喜愛的SSH Client來連線吧!!!

預設的VirtualBox的VM連網路都是透過NAT的設定 它並不是向DHCP 伺服器要一個IP.所以其實Ubuntu的ip 外面是連不到的

你可以用ifconfig 去看ubuntu的內部ip會是10.0.x.x

在你的SSH Client 請用127.0.0.1 port 22去連你的Ubuntu VM吧

Friday, 11 September 2015

Windows 8 / Windows 10 小設定

當你發現你的桌面上的捷徑的圖示有些變成白的 那麼你就需要清掉你的IconCache

cd /d %userprofile%\AppData\Local

attrib –h IconCache.db

del IconCache.db


Windows 8 / Windows 10 的刪檔的預設是直接進資源回收筒了 算是有點方便 但是也是有點不便 (有時後手賤不小心按到del的話可能就要到資源回收筒翻了)
若希望像windows xp / 7 一樣有確認的訊息視窗的話

資源回收筒 右鍵 / 內容 ,勾選 顯示刪除訊息視窗



想要windows 8 / windows 10 自動登入 (不要輸入密碼)
兩個方法

1. 在安裝的時後只輸入使用者名稱不輸入密碼

2.
A. Windows鍵 + R( 出現 執行 視窗)
B. 輸入 netplwiz & 按確定
C. 取消勾選 必須輸入使用者名稱和密碼,才能使用這台電腦


Wednesday, 2 May 2012

SQL Server 2005 SSMSEE x64 Error 29506

start CMD prompt as Administrator and it'll finish the job

Reference: http://blogs.msdn.com/b/jonbox/archive/2008/01/06/error-29506-while-installing-sql-server-2005-ssmsee-x64.aspx

Sunday, 5 February 2012

ESET NOD32 Antivirus Trail account registration

http://10minutemail.com/10MinuteMail/index.html

http://www.eset.eu/download/ess-trial-form

Tuesday, 30 August 2011

Windows.Live.Messenger.14.0.8117.416

For people who don't like Windows Live Messenger 2011, Here's Windows Live Messenger 2010 for you.

Click here to download

Friday, 28 January 2011

Register our application to AutoPlay dialog

The article from MSDN:Using and Configuring AutoPlay

Remove Blogger navigation bar

I know I don't usually write my blog. But today I changed my template because the old one really looks ugly. I didn't know why I picked that at the first place few years back.

After changing my template, I found out that the navigation bar from blogger is back!!! I forgot what I did before, so I ended up checking the CSS using Firefox + Firebug(best combination ever in my opinion). A picture is worth 1000 words. The highlighted is what you need to add.







Settings / Design / Edit HTML

Add the CSS code at the top of the template you chose.

#navbar-iframe { display: none !important;}


Save the template and you should see the magic :)))

Thursday, 13 May 2010

Windows Server 2008 Internet Explorer Enhanced Sercurity Configuration



Administrative Tools / Server Manager / Configure IE ESC

Check "Off" for Administrators




Tuesday, 13 October 2009

"Access is Denied" when working with Process + ASP.NET





  1. Open Control Panel
  2. Open Services
  3. Find IIS Admin Service and right click Properties
  4. Go to Log On Tab
  5. Check "Allow service to interact with desktop"
  6. Click OK
  7. Restart the service(right click, restart)



The solution I found from Microsoft Support here.


Tuesday, 29 September 2009

取消煩人的 使用者帳戶控制(User Account Control)

控制台 -> 使用者帳戶 -> 關閉UAC

Control Panel -> User Accounts -> Turn User Account Control on or off

Wednesday, 19 August 2009

Silverlight code running order

  1. App.xaml.cs - > Application_Startup
  2. MainPage.xaml.cs -> Mainpage()
  3. Page_loaded event if registered




Thursday, 13 August 2009

Developing Flowplayer Flash Plugin environment setup guide

  1. Download JAVA SE , Flex SDK, and ANT if you don't have
    ANT downloaded filename: apache-ant-1.7.1-bin.zip
    Flex SDK downloaded filename: flex_sdk_3.zip
    JAVA SE downloaded filename: jdk-6u16-windows


    Environment Variable:
    JAVA_HOME : C:\Program Files \Java\jdk1.6.0_15
    Path : C:\apache-ant\bin;C:\Program Files (x86)\Java\jdk1.6.0_15\bin
    The folder path is differ depends on your own preference. The above is just my setup

    To check if it's installed, go to Command Prompt and then enter texts like image shown.


    Subversion is needed if you want to get the latest source code from Flowplayer's server.
    Click here to download.(setup the bin folder in Path as well (ex.C:\svn-win32-1.6.3\bin))

  2. To be continued

Saturday, 25 July 2009

ASP.NET IIS Firefox authentication required problem



Today, I had problem with running my asp.net project while using Firefox. It asked me to enter username and password to see the page. However, I tried all the passwords and none of them worked. This problem never occurred before, so I googled and finally found the solution.

  1. Enter about:config at firefox address bar. (You will see warning message indicating that these are advanced settings that may affect the browser security and stability)
  2. Click "I'll be care, I promise" button
  3. Search network.automatic-ntlm-auth.trusted-uris at filter. (Only one entry will be appear)
  4. Double click the entry and type localhost.
  5. Save it and reload your web page then DONE!
Here's the original link from ASP.net forum.



Friday, 24 July 2009

Accessing Posted Data in ASP.NET

There are two ways to access data using Page.PreviousPage in asp.net

1. Using FindControl function

string username = ((TextBox)PreviousPage.FindControl("tbxUsername")).Text;

2. Using Strongly Typed Data
I personally like this one because I don't care about what the control name is. Also, no typo mistakes will be made.
Here is how to make a strongly typed data

public string UserName
{
get{return tbxUsername.Text;}
}

Also we have to set the code below at the page that receives the posted data.

<%@ PreviousPageType VirtualPath="~/pageName.aspx" %>


Last step, you have to rebuild in order for page to see the property in receiver page.



Wednesday, 22 July 2009

ASP.NET CustomValidator with Javascript

To use CustomValidator with client side javascript validation, we need to implement a javascript with two parameters.


function YourFunctionName(source, arguments)



Set property ClientValidationFunction to the name of your javascript at CustomValidator control.

arguments.Value is the data that we will be validated.

arguments.IsValid indicates validation success or failure.

If the validation is passed, we set arguments.IsValid = true. False otherwise.

Tuesday, 14 July 2009

Microsoft® Silverlight™ 3 Tools for Visual Studio 2008 SP1

Last Friday was the official day that Silverlight 3 released. I was about to go home on Friday and don't know why something came to my mind that it's time to check Silverlight's website. Boom! SL 3 is released.


Microsoft® Silverlight™ 3 Tools for Visual Studio 2008 SP1

Saturday, 11 July 2009

Using Output Caching to Enhance Web Site Performance

There are 2types of caching for ASP.NET

1. Configuring Page-Level Caching
copy the code below to aspx html source page

<%@ OutputCache Duration="15" VaryByParam="none" %>

Duration means the duration of the cache. In this case, it will cache for 15 seconds.











the name "AppCache1" will be used to the pages that you want to have cache. You can have different kinds of cache options by just adding another profiles like the code below




what we have to do in each of our page is add the code below

<%@ OutputCache CacheProfile="AppCache1" VaryByParam="none" %>

Note: the name of the CacheProfile is the name you set in outputCacheProfiles in web.config.


The attribute VaryByParam is used for caching parameters (eg. querystring) of a page.
example:

<%@ OutputCache Location="Server" Duration="60" VaryByParam="Color" %>


Here we have a param called "Color". (http://mysite/mypage.aspx?Color=red)
When user goes to the page wtih Color=red, it caches the page with param Color=red for specific duration according to our setting.

If we specify the VaryByParam parameter, any new value will be cached. For cached value, it loads data from cache.


Here's the detail explanation of VaryByParam from Microsoft MSDN
==================================
The @ OutputCache directive requires you to set the VaryByParam attribute, which until you now you have set to "none". The VaryByParam attribute enables you to configure caching so that ASP.NET stores different versions of a page depending on parameters such as query strings, form post values, request headers, and so on.

For example, you can use cache parameters in a page that displays weather conditions for select cities, where the weather data is refreshed only every three hours. In this scenario, you want to cache a separate version of the page for each city. You can do so by setting the cache parameter to vary by a query string parameter.
==================================


If you wish to study all the details on your own see here

PDF Split and Merge



PDF Split and Merge is an open source software that allows us to split PDF files into multiple files.

When you installed the program and you see missing javaw.exe, please download Java Virtual Machine

Friday, 10 July 2009

Silverlight 3 Element to Element Binding




We don't have to create tons of events for updating values, texts to different controls.

The code below does it all. No additional coding inside cs file.
{Binding Value, Mode=OneWay, ElementName="MyControlxName"}

It's like the old binding style except that we have ElementName to tell the compiler that we want to bind the property to the element MyControlxName's Value property.


Thursday, 9 July 2009

ASP.NET Dynamic Compilation

Unlike ASP, ASP.NET doesn't have to compile each and every time it is requested. An ASP.NET page is compiled only once when an application is modified. If it is not modified, the Framework will look for the directory


\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files


to load the compiled dll.


However, if a site contains thousands of pages. Having Framework to precompile everything and store in the temp folder isn't a good choice. Here the way to chose if you want the compiler to precompile or not.
Adding CompilationMode attribute inside the <%@ Page Language="C#" %> tag at html source code view.
The attribute has Always, Auto, and Never. I believe the default is Auto :)