2013年12月31日 星期二

user specific sshd config

When ssh to some AWS EC2 AMI such as RedHat , Amazon Linux and Ubuntu, ssh will prompt some message like below:

Please login as the user "ec2-user" rather than the user "root".

The secret is here:

# cat /root/.ssh/authorized_keys
no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"ec2-user\" rather than the user \"root\".';echo;sleep 10"

Summary:
You can define user-specific sshd config in ~/.ssh/authorized_keys file


2013年12月29日 星期日

[Android] Trigger

This app Trigger formerly known as NFC Task Launcher. You can trigger tasks (change profile) not only by NFC by also Wifi, Bluetooth status....etc...

So, give it a try, it's great!

NFC Smart Tags!
http://www.youtube.com/watch?v=LfkFgtoQtFQ

Sync facebook upcoming events to Google calendar


Login your facebook account > Events > Setting Icon > Export
links for import








Copy the links and login to Google Calendar > Other Calendars > Add by URL
sync calendar from URL









After that, you can have your facebook events in Google Calendar, and with Cal app, it's a wonderful user experience to get noticed for my events :>

2013年12月5日 星期四

netsted hypervisor in ESXi 5.1




  1. check if ESXi can support VHV
    1. https://[your-esxi-host-ip-address]/mob/?moid=ha-host&doPath=capability
    2. check filed "nestedHVSupported"
  2. create a VM with "Hardware Version 9"
  3. choose VM type as "Others 64bit"
  4. ssh into ESXi, modify {VM}.vmx
    1. +vhv.enable = "true"
    2. !guestOS = "vmkernel5"



REF:
http://www.virtuallyghetto.com/2012/08/how-to-enable-nested-esxi-other.html

upload single ssh public key for all ec2 regions

Prerequisite:
    EC2-API-Tools
    ssh-keygen to create ssh key pairs on linux

Parameters:  
    region names: such as ap-southeast-2,....
    keypair-names: for example, my-ec2-keypairs


for r in us-east-1 ues-east-2 us-west-1 us-west-2 ap-southeast-1 ap-southeast-2 eu-west-1; do ec2-import-keypair --region $r your-keypair-name --public-key-file ~/.ssh/id_rsa.pub ; done


REF:
http://aws.typepad.com/aws/2010/09/new-amazon-ec2-feature-bring-your-own-keypair.html

http://www.pyrosoft.co.uk/blog/2010/10/27/import-your-own-rsa-ssh-key-into-amazon-ec2/