Archive for July, 2010

Transfer files between iPhone and PC

Aug 07

Ok, folks. The first part should be know to quite a few people, it will give you a “quick & dirty” short manual how to install a SSH server on your brand new iPhone running Firmware 2.0. As of now the firmware 2.0.1 is not jailbroken, so please do not upgrade to 2.0.1 unless the people at iPhone Dev will tell you.

The second part will give you a quick advice how to secure your new SSH server.

Installing SSH server:

  • Open Cydia on your phone. (If you do not have Cydia installed on your phone you still have to jailbreak your iPhone.)
  • This step could be necessary if you never run Cydia before: Press “Changes” and make sure you install all necessary upgrades that will show up. A newly jailbroken iPhone will have 6 to 8 necessary updates showing up. Make sure you do not upgrade automatically as this gave me quite a lot of problems. Instead start to upgrade the “Cydia Installer” first. Then quit and restart Cydia immediately afterwards. It will take quite a while after the restart to re-arrange everything. DO NOT INTERRUPT this step. Then make sure you upgrade all other packages like APT, Core Utilities, SQLite v3, OpenSSL, Cydia Sources etc.
  • In Cydia, press “Search” and enter “OpenSSH”. Choose the “OpenSSH” package from Teleshoreo and press “Install”
  • Quit Cydia after installing.

Remember: You now have an “up & running” SSH server on your phone. Everyone can connect to your phone using a SSH client and the standard password alpine.

Secure your iPhone SSH server:

  • Make sure your iPhone is connected to you WiFi network.
  • Go to “Settings” , then to “Wi-Fi”
  • Press the round blue button to the right of your connected network
  • It will show you your network settings, make sure you get the “IP Address” – its the address of your iPhone right now.
  • Open your Terminal application
  • type in: ssh -l root (IP-Address of your iPhone)
  • The first time you connect to your iPhone secure keys are generated. This could take up to a minute, so be patient.
  • A password prompt should show up, enter: alpine
  • Now you are on your phone, you should change your password immediately, enter: passwd
  • You will be asked twice for a new password, make sure its not to easy to guess. No, 12345 and password are no good choices :)
  • Now exit the iPhone by typing in: exit

Most tutorials on the web forget about the second standard user your iPhone will have. Actually while root is the most powerfull user there is still user mobile. And this user has enough rights to change about every little apsect of your iPhone. So we should change the standard password for this user as well!

  • On you Terminal application, type in: ssh -l mobile (IP-Address of your iPhone)
  • A password prompt should show up, enter: alpine
  • Enter: passwd
  • Since this is not the root user the system will ask you for your old password first, enter: alpine
  • Then type in your new password twice. As a security measure it should not be the same password as used for the root user!
  • Again, exit by typing: exit

Voila! You SSH server is safe now. Do not forget that it will be always on. So if someone has your current iPhones IP address he will be able to connect to your iPhone. But now the new passwords have to be used to login.

Remember that you have to change the passwords after every firmware upgrade again. Even if you restored from an iTunes backup the passwords for the SSH server will be reset to the standard passwords!

On the next post I will give you some advice how to connect securely from you Mac to your iPhone without having to type in you password.


My favourite WordPress themes

Here are the themes I like the most on WordPress:

  1. SpringLoaded
    A colorful with green but still being elegant Dates is decorded nicely but categories and tags are displaying so simple.
  2. Rubric
    A Dynamic Width theme
  3. MistyLook
    I’m fond of this theme very very much except the bullet style.
  4. Ocean Mist
    It’s lovely for everything except the font is too small.
  5. Journalist
    Very clean style to read my blog.
  6. Inove
    Another clean style. But it has distracting icons under the title of each post and the title itself is not big enough.
  7. zBench
    Grayscale color theme I found elegant to used!

For these ones I also like them, and I will have a try on them soon.

  1. Twenty ten
  2. Fusion
    Simple but Clean ‘n’ Clear. The title each post is so “simple” and easily get blurred with the content.

Have fun!

Try showing gallery

Helpful & Frequently-used hot keys in Visual Studio IDE

This is my list of hot keys which I often used – the list is gradually updated. Hope you can find it useful.

  1. Select a text and Ctrl-F3 Search for selected text. Very useful when you browse the codes, meet some references (method, properties, variable, …) that you want to quickly see other locations it appears.

Often used WPF Syntax (and it's hard to remember – at least for me :( )

Path to an image located in our project:

<Image Source="/My.Asembly.Name;component/Path/to/my/image.png" ... />

Image path  is in the formation of <AssembleName>;component/<Path2YourImageWithinTheAssembly>.

Useful tips:

  • To get the formation of the image path, just open design mode, add an image and select its source as an image in your project/solution and see the result.
  • We can omit the AssemblyName part if the code and the image are in them same assembly.
    i.e. Only keep <Path2YourImageWithinTheAssembly> in the image path.

<Image Source="Path/to/my/image/without/assembly.png" ... />