Friday, May 27, 2016

Installing ssh-copy-id on Mac OS X using MacPorts

Ssh-copy-id is a script used to add your public key to remote server, so next time you connect to that remote server, it would be passwordless (unless, of course, if you put a paraphrase when generate your public key).

Most simple way is by using MacPorts:
$ sudo port install openssh +ssh-copy-id
That's it! And you ready to use it :)

Wednesday, April 13, 2016

Modifying Vim to be able editing crontab in Mac OS X Yosemite

Get the solution from Vim Wikia post here, already tried this by myself and worked like a charm :)

If you ever get this error while trying to add cron entries:
crontab: temp file must be edited in place
Then the solution is very simple. You just need to create ~/.vim/ftplugin/crontab.vim and add this one line:
set backupcopy=yes
Save the file and you can try to add cron entry again.

Mutt+Offlineimap Error while using it to access Gmail IMAP

The solution came from this forum

Upon Offlineimap version 6.6.0, you'll get an error when accessing Gmail IMAP, something like this:
XOAUTH2 authentication failed: AUTHENTICATE command error: BAD ['Client aborted AUTHENTICATE command. q205mb46565077wmb']. Data: MFNB2 AUTHENTICATE XOAUTH2

The solution is very simple, you just have to add one line to your .offlineimaprc file, in the [Repository YOUR_ACCOUNT-remote] section:
auth_mechanisms = LOGIN

referring to config line: #auth_mechanisms = GSSAPI, CRAM-MD5, XOAUTH2, PLAIN, LOGIN

Save the file and run your offlineimap to check that the error is already gone. Voila! :)

Setup Wi-Fi on your Raspberry Pi via the Command Line

The complete guide for this can be checked here

1. Boot up your Pi
2. Connect ethernet cable to your Pi
3. SSH into it (You can check the IP from your wireless router DHCP client list)
4. Open up /etc/network/interfaces:
$ sudo vim.tiny /etc/network/interfaces
You'll see few lines of basic configuration:
auto lo
iface lo inet loopbackiface eth0 inet dhcp
allow-hotplug wlan0iface wlan0 inet dhcpwpa-conf /etc/wpa_supplicant/wpa_supplicant.confiface default inet dhcp
5. Then open up /etc/wpa_supplicant/wpa_supplicant.conf:
$ sudo vim.tiny /etc/wpa_supplicant/wpa_supplicant.conf
Just copy and paste below script inside that file:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdevupdate_config=1network={ssid="YOURSSID"psk="YOURPASSWORD" 
# Protocol type can be: RSN (for WP2) and WPA (for WPA1)proto=WPA 
# Key management type can be: WPA-PSK or WPA-EAP (Pre-Shared or Enterprise)key_mgmt=WPA-PSK 
# Pairwise can be CCMP or TKIP (for WPA2 or WPA1)pairwise=TKIP 
#Authorization option should be OPEN for both WPA1/WPA2 (in less commonly used are SHARED and LEAP)auth_alg=OPEN 
}
Change ssid, psk, proto, key_mgmt, pairwise and auth_alg according to your wireless router setup.

6. And after you finished, reboot the pi:
$ sudo reboot
7. Upon booting, unplug ethernet cable and try to access your Pi via wireless connection (check the IP from your wireless router DHCP client list)

Just repeat the steps if you still haven't seen your Pi in the DHCP client list.
 

Tuesday, April 12, 2016

Mutt Integration With Abook in Mac OS X

This post assume that you already have Mutt running on your Mac OS X.

I choose Abook to manage my address book because it's very simple and suitable for my need.

If you don't have Abook yet, you can install it. I'm using MacPorts, so just execute this command:
$ sudo port install abook

And then, add these lines to your .muttrc config file:
set query_command = "abook --mutt-query '%s'"macro generic,index,pager \ca "<shell-escape>abook<return>" "launch abook"macro index,pager A "<pipe-message>abook --add-email<return>" "add the sender address to abook" 
A little explanation for above script:
1. set query_command (pressing ctrl-t) on Mutt - Compose view, will execute abook to look for match address based on the few letter(s) you already type in.
2. pressing ctrl-a on Mutt, will execute abook to input manually
3. pressing shift-a (or A capital) on Mutt - Index view, will add the sender from any highlight email

Just save your .muttrc and reload the config on Mutt, and you're good to go :)

*full reference see here

Backup and Restore Your Raspberry Pi SD Card Using Mac OS X

For the credit and full-complete writing about this post, you can check it here and here, I only made some modification to make it even simple.

This was done by me when I tried to expand SD capacity from 8 to 16 GB. It's very simple and practical. After this backup-restore process done, you need to expand the file system so you can acquire full 16 GB on new SD card. So, let's begin..

Backup
1. Turn off RPi
2. Put SD card into card reader slot
3. Open up 'Terminal' app (from Application -> Utilities -> Terminal)
4. Type:
$ sudo bash
5. Type in your password
6. Type these in sequence:
# mkdir -p ~/rpi/backups
# cd ~/rpi/backups
 7. Check where your SD card is listed (e.g.: mine is listed as /dev/disk2s1)
# df -h
8. Eject your SD card:
# diskutil unmountDisk /dev/disk2s1
9. Backup your SD card to image file: (please note that you have to add 'r' before 'disk')
# dd if=/dev/rdisk2 of=~/rpi/backups/backup-today-rpi.img bs=1M
10. When complete: (again, add 'r' before 'disk')
# diskutil eject /dev/rdisk2 

Restore
1.  Put new SD card into card reader slot
2.  Check where your SD card is listed (e.g.: mine is listed as /dev/disk2s1)
# df -h
 3. Eject your SD card:
# diskutil unmountDisk /dev/disk2s1
4. Restore your image to new SD card:
# dd bs=1M if=~/rpi/backups/backup-today-rpi.img of=/dev/rdisk2
5. When complete:
# diskutil eject /dev/rdisk2

Expand Filesystem
1. Powering up your Raspberry Pi
2. Execute this command:
$ sudo raspi-config
3. Choose 'Expand Filesystem"
4. Reboot

And you're done! :)

Wednesday, May 7, 2014

Setup a PPPoE Server Using Mikrotik RouterBoard 750

The scheme I'd like to achieve is like this:


This post will focus on how the PPPoE server is configured. The connection service will be asymmetric like this:
1 Mbps: 1 Mbps Download / 256 Kbps Upload
2 Mbps: 2 Mbps Download / 512 Kbps Upload

The only way to access a routerboard is using their winbox tool which you can download here. Let's start :)

Run the winbox, and you'll get this pop-up box:


Click on the button with three dots to scan connected device, choose the one mac-address that shows up and leave any other things at it is, then click the Connect button to open up another window like this:


Choose IP -> Addresses, add new and fill in the field:
Address: 10.200.10.2/24
Network: [automatically filled in when you click on 'Apply' button]
Interface: ether1

* Next, Create an IP pool for each service you'll create (allocate):
IP -> Pool, add new IP pool:
Name: 2MB
Addresses: 192.168.99.2-192.168.99.254
Next Pool: none

* Create a PPP profile for one of your service:
PPP -> go to Profile tab, add new profile and fill in the following fields:
Name: PPPOE_2MB
Local Address: 192.168.99.2
Remote Address: 2MB
DNS Server: 8.8.8.8, 4.4.4.4

* then go to PPPoE Servers, add new PPPoE service, and fill in the following fields:
Service Name: PPPOE
Interface: ether3
check 'One Session Per Host'
uncheck 'machap1' 'machap2' 'chap'

* Create a NAT rule for masquerade
IP -> Firewall -> go to NAT tab, add new NAT rule:
Chain: srcnat
Out. Interface: ether1
>> go to Action tab, choose 'masquerade' as Action

* Create Queue rule for bandwidth limit
Queue -> got to Queue Types tab, add new type for download limit:
Type Name: 2MB_DOWNLOAD
Kind: pcq
Rate: 2M

add another one for upload limit:
Type Name: 512KB_UPLOAD
Kind: pcq
Rate: 512K
uncheck 'Dst. Address'
check 'Src. Address'

* Apply the queue type just created:
go to Simple Queue tab, add new simple queue to apply queue type you just created:
in General tab:
Name: TOTAL
Target Address: 192.168.99.0/24

>> add another new simple queue rule:
in General tab:
Name: 2MB
Target Address: 192.168.99.0/24
Max Limit: choose 512KB_UPLOAD for Target Upload
choose 2MB_DOWNLOAD for Target Download
>> go to Advanced tab:
Queue Type: choose 512KB_UPLOAD for Target Upload
choose 2MB_DOWNLOAD for Target Download

* Create user credential for login:
PPP -> go to Secrets tab, add new PPP secrets:
Name: xs2
Password: xs2
Service: pppoe
Profile: PPPOE_2MB
Local Address: 192.168.99.2
Remote Address: 192.168.99.1

Then you can test it by creating a dialer, as I'm using Mac OS X, so I go to System Preferences -> Network, create a connection with a PPPoE interface:


And fill in the credential to connect:


That's it! :)



Monday, May 5, 2014

Running Rplay on Raspbmc for Airplay Mirroring

I'm sure you can find many other posts about installing and running rplay in raspberry pi. If you haven't heard about rplay, this amazing software is developed by company called Vmlite, that gives us possibility to experiencing airplay mirroring without having Apple TV (but, of course, you still have to own an iOS device :D) by install it on small computer Raspberry Pi. You can check here if you want to know more about this amazing little device.

On many other posts, rplay have to be installed on raspbian, a debian-based linux distro customized for Raspberry Pi. In my situation, since I only have small-size SDcard (4 GB), I can't installed raspbian because it needs you to have at least 8 GB SDcard size. And, I also would like to use raspbmc (XBMC based) to be a media centre and powering up my old CRT TV. So, this post is pure notes of my experience. Let's start :)

I assume most of you who read this post already have Raspberry Pi, and already installing raspbmc on it and using it for many purposes.

1. From Raspbmc dashboard, go to Power Icon on bottom left, then choose EXIT:

2. Immediately press ESC on keyboard (you need to have keyboard attached to Pi, doesn't matter if it's a USB, bluetooth or wireless one), when you saw notification box "Press ESC for command line)

3. When you already in CLI and prompted to login, just input 'pi' as username and 'raspberry' for password, that's the default credential (if you haven't changed it)

4. Update the repository:
$ sudo apt-get update
5.  Installing rpi-update:
$ sudo curl -L --output /usr/bin/rpi-update https://raw.github.com/Hexxeh/rpi-update/master/rpi-update && sudo chmod +x /usr/bin/rpi-update
6. Updating the firmware:
$ sudo rpi-update
7. Allocate more memory to GPU:
sudo raspi-config
then select memory_split, change the value to 256 (Model B device), or 64 or 128 (Model A device)

8. Installing other dependencies:
$ sudo apt-get install libao-dev avahi-utils libavahi-compat-libdnssd-dev libva-dev youtube-dl
9. Updating youtube-dl:
$ sudo youtube-dl --update
10. Download rplay binary and install:
wget -O rplay-1.0.1-armhf.deb http://www.vmlite.com/rplay/rplay-1.0.1-armhf.deb
sudo dpkg -i rplay-1.0.1-armhf.deb
This will install and launch /usr/bin/rplay, and it runs automatically on boot.
You can try to reboot your Pi at this point, and rplay should auto start after reboot.

11. Manual start and stop
$ sudo /etc/init.d/rplay start
(NOTE: if you have 2 instances of rplay running, none would work!)
$ sudo /etc/init.d/rplay stop
If you want to see the output message, you can run this way:
$ sudo /user/bin/rplay
Make sure only one instance is running.
 
12. THIS IS VERY IMPORTANT, enter the license key, without it, AirPlay mirroring won’t work.
Safari browser has problems, try to use other ones. Once rplay is running, go to a browser and open this url:
http://<ip-address-of-pi>:7100/admin
or
http://localhost:7100/admin (If you use the browser on the same Pi machine)
The username/password is: admin/admin, go down to the last one, enter the license number, click Submit.

You can also perform other admin tasks here, such as setting password, toggling fullscreen, recording, etc.

The config file is /etc/rplay.conf, you can also manually edit the config file, instead of using the web interface. Append license_key=<your-license-key> to the last line of the file, for example:
admin_password=adminpassword=onscreen_code=0 [or 1]fullscreen=0 [0r 1]license_key=1223dd-your-from-email
13. Test regular AirPlay and AirPlay Mirroring
rPlay supports AirPlay and AirPlay Mirroring. For iphone 4 and iPad 1, you can’t do AirPlay mirroring, but you should be still do AirPlay for Photos/Music/Videos. For iPhone 4S and iPhone 5, iPad 2 and above, you can also do AirPlay mirroring.

On your iOS devices, double click Home button, slide to the most left, and choose rPlay as AirPlay device to connect. For iOS 7, you need to quickly swipe up from the bottom to bring up AirPlay window, and choose rPlay as AirPlay device to connect.

14. Test Chromecast
you need to install and update youtube-dl on pi, run the following command on Pi to auto update it:
$ sudo apt-get install youtube-dl$ sudo youtube-dl –update
right now, this is very simple implementation, it only works with YouTube app, either on Android or iOS. Make sure you download the latest YouTube app on your mobile device, then open YouTube app, pick a video to play, on the top right corner, there will be a square chromecast button, tap it, and choose rPlay to connect. The video should play on Pi, it won’t be able to control with this version, we will improve it.

15. Uninstall rplay
$ sudo /etc/init.d/rplay stop$ sudo dpkg -r rplay
16. If rplay is not found by your devices, you can try to toggle WIFI on your devices, turn it off and then on. You may also power off your router then power it on.

You will get the license key and details about rplay installation by register, login and post in Vmlite forum page.

Some posts on the internet say that we should disable the xbmc in order the rplay to running well. You could refer to Raspbmc FAQ here. But in my situation, I don't need to do that and airplay mirroring feature working just fine.

If you have audio problems, please refer to this article. And if your iOS devices don't see rPlay in the AirPlay device list, make sure avahi daemon is running on the Pi device, refer to this article.

So, that's it. Enjoy the features in airplay and airplay mirroring with rplay in Raspberry Pi :)

Thursday, March 13, 2014

Adding Secondary IP Address in Ubuntu (Linux in general)

In my works, sometimes I need to configure router/wireless router with my PC. But since my PC only has one ethernet port that configured with static IP address, I have to find a way to be able to configure the router/wireless router without unplug it. One way is by adding secondary (virtual) IP address on existing ethernet port.

You can do this by using temporary or permanent way.

Temporary way:
Pretend that your ethernet is eth0, and you know that DHCP block IP from the router/wireless router is 192.168.1.0/24, you can set static IP address in that range:
$ sudo ip addr add 192.168.1.11/24 dev eth0
And when you finished, you can just delete that temporary additional IP:
$ sudo ip addr del 192.168.1.11/24 dev eth0

Permanent way:
You can add permanently by adding config in /etc/network/interfaces file:
auto eth0:1
iface eth0:1 inet DHCP
Then you set eth0:1 to be up:
$ sudo ifup eth0:1
Check to make sure you've got the correct IP address assignment:
$ sudo ifconfig -a | grep eth0 
 

Wednesday, March 12, 2014

Using and Samba Share External HardDisk on CentOS (Linux in General)

The scenario is I want to use an old PC (1GB RAM, HDD 20GB, Pentium-class) as a Samba share (file server). So I installed CentOS 6.5 on it, put a 3TB external HDD on it and then doing this configuration:
1. Migrating /home partition to 3TB external HDD
2. Configuring samba
3. Adding user and share

1. Migrating /home partition to 3TB external HDD:
I'm using this URL as a guidance, but I re-write this as simple as I have done:
a. Check the UUID of external HDD
$ sudo blkid
b. Backup /etc/fstab
$ sudo cp /etc/fstab /etc/fstab.$(date +%Y-%m-%d) 
c. Compare the two fstab files
$ cmp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)
d. Edit original /etc/fstab
# (identifier) (location) (format) (some settings)
UUID=???   /mnt/home   ext3   defaults   0   2
replace the ??? in UUID with the one you've got from blkid command for your HDD

e. Create the mount folder
$ sudo mkdir /mnt/home
f. Reload the updated /etc/fstab
$  sudo mount -a
g. Copy existing /home to new partition
$ sudo rscync -aXS --exclude='/*/.gvfs' /home/. /mnt/home/
h. Confirm that all files and folders are copied successfully
$ sudo diff -r /home /mnt/home
i. Edit /etc/fstab, preparing for switch
# (identifier) (location) (format) (some settings)
UUID=???   /home      ext3       defaults   0   2
j. Moving /home to /old_home
$ cd / && sudo mv /home /old_home && sudo mkdir /home
k. Reload the updated /etc/fstab
$ sudo mount -a 
2. Configuring Samba:
a. Edit /etc/samba/smb.conf
security = user
[share]
     path = /home
     browseable = yes
     writable = yes
     public = yes
     guest ok = yes
b. Restart Samba service
$ service smb restart
$ service nmb restart 
3. Adding User and share:
a. Add samba user without UNIX login:
$ useradd -s /sbin/nologin [username]
b. Set samba password for new user:
$ smbpasswd -a [username]
c. Put the new user in the user group:
$ usermod -a -G [username] [usergroup] (e.g. usermod -a -G andy andy)
d. Set priviledge to certain folder only available to certain user/group:
$ chmod 775 /home/[username] 

You can check that there will be new folder created under /home with username you create. Using this command:
$ ls -lart /home
You can see that each of that folder own by username, this way when another username access the samba share, they can see another user folder, but don't have the priviledge to access them. This config already tested in my office with many users using different OS (Windows, Mac, Linux).
 
 
 
 
 
 
 

Monday, February 10, 2014

Use Python2.6 (instead of Python2.7) on Ubuntu Server 12.04

Ubuntu Server 12.04 comes with Python version 2.7 by default. Unfortunately, there are some apps development out there that still using Python 2.6. Here are some simple workaround to change the default Python2.7 to Python2.6:

1. Preliminary requirement:
$ sudo apt-get install python-software-properties
2. Adding PPA (because Python2.6 is not available anymore on Ubuntu Server 12.04, by default):
$ sudo add-apt-repository ppa:fkrull/deadsnakes
3. Update repository:
$ sudo apt-get update
4. Installing Python2.6:
$ sudo apt-get install python2.6 python2.6-dev
5. Change the symlink to Python2.6:
$ sudo ln -sfn /usr/bin/python2.6 /usr/bin/python
6. Check the version:
$ python --version

That's it, and you're done :)
 
 
 
 

Tuesday, October 8, 2013

Run X Applications Over Network Using SSH

Topology:
Linux-based PC: 192.168.1.1
Linux-based Laptop: 192.168.1.7

In PC, you edit /etc/ssh/sshd_config using any editor you like:
$ sudo vi /etc/ssh/sshd
Looking for this line, or you can add if it's not already there:
X11Forwarding     yes
Save that file and restart SSH service:
$ sudo /etc/init.d/ssh restart
Allow Laptop to run X applications:
$ xhost 192.168.1.7
Define default display:
$ export DISPLAY=192.168.1.1:0

Then from Laptop terminal, run the command to execute any X applications you like:
$ ssh -X [username]@192.168.1.1 firefox
$ ssh -X [username]@192.168.1.1 oowriter

That's it! :)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Wednesday, October 2, 2013

Change Group Owner For /var/www

Taking another note. Here's how to change group owner for /var/www directory in Ubuntu Server 12.04. By default that directory meant to be DocumentRoot for Apache 2 web server and own by root. This practice is useful if we want to share the access to several people in webmaster group.


sudo addgroup webmasters

sudo chgrp -R webmasters /var/www

sudo find /var/www -type d -exec chmod g=rwxs "{}" \;
sudo find /var/www -type f -exec chmod g=rws "{}" \;

sudo gpasswd --add user webmasters
sudo gpasswd --add colleague1 webmasters
sudo gpasswd --add colleague2 webmasters
# etc.

Tuesday, January 22, 2013

Accessing Nexus 4 USB Storage From Linux

The objectives is to be able to access USB storage on Nexus 4 from my Linux desktop. This way, I can easily copy and/or move files from/to Nexus 4.

1. Enable Developer options:
a. Open Settings
b. Tap 'About phone'
c. Tap on 'Build number' seven (yes, it's 7) times
d. You'll get the notification that Developer options is enabled

2. In settings, you'll find in System tab the Developer options, tap to open it, and then check the USB debugging option


3. Install necessary modules to Linux desktop:
$ sudo apt-get install mtp-tools mtpfs
4. Configure 51-android.rules:
$ sudo vi /etc/udev/rules.d/51-android.rules
5. Paste the following line into the file:
#LG - Nexus 4
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"
6. Make the file executable:
$ sudo chmod +x /etc/udev/rules.d/51-android.rules
7. Restart udev
$ sudo service udev restart
8. Create mount point and permissions
$ sudo mkdir /media/nexus4
$ chmod 755 /media/nexus4
9. Plug in Nexus 4 and make sure MTP is enabled


10. Mount with the following command:
$ sudo mtpfs -o allow_other /media/nexus4
11. And unmount it when you have completed your work:
$ sudo umount /media/nexus4

Practically you can do this with every other Android devices. Just plug your Android and use this command to get your idVendor and idProduct information:
$ mtp-detect | grep idVendor
$ mtp-detect | grep idProduct
Use the information on step 5 above, and you're good to go :)
 

Wednesday, November 7, 2012

Mutt: Viewing URL On Your Favorite Browser

On this past few weeks, I've been back using mutt. And this time, with much advanced configuration. One of its configuration is opening URL inside emails on your favorite browser. The requirement is simply using urlview that you can download from here (I'm using version 0.9), extract and compile it. Then add this config to your .muttrc file:
macro index \cu |urlview\n      # simulate the old browse-url function                                                                                                           
macro pager \cu |urlview\n
Also, you need to add ~/.urlview and put this line:
REGEXP (((http|https|ftp|gopher)|mailto)[.:][^ >"\t]*|www\.[-a-z0-9.]+)[^ .,;\t>">\):]
COMMAND <your-browser> %s

After all done, try to open one email in your mutt. Then in view mode, press ctrl-u and urlview will listing all available URL inside that email. You just have to choose one and press Enter, and your browser will automatically open and load that URL.
 

Wednesday, June 6, 2012

How to open .uif file in Ubuntu Linux

Here's how to open .uif file in Ubuntu Linux:
1. Install uif2iso package
$ sudo apt-get install uif2iso
2. Run command to convert .uif to .iso file
$ uif2iso file.uif file.iso
3. Mount .iso file
$ mkdir ~/iso_file
$ sudo mount file.iso ~/iso_file -t iso9660 -o loop
That's it! :)

Friday, May 18, 2012

Failed Installing Java on Ubuntu 12.04? Here Are The Workaround

If you happen to experience the same flaw to installing Java on Ubuntu 12.04, then you could do these steps:

sudo rm /var/lib/dpkg/info/oracle-java7-installer*
sudo apt-get purge oracle-java7-installer*
sudo rm /etc/apt/sources.list.d/*java*
sudo apt-get update
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

Proven to be worked well :) Credit goes to the Ubuntu Forum thread here

Tuesday, April 17, 2012

Want to access Simplenote from Vim? Use Vimplenote!

If you're the person who always logging anything like I do, probably you should try Simplenote , "easy way to keep notes, lists, ideas, and more" -- that's what they say in their website :)

For me, the ubiquity to using their service in many platform is their advantage. As a vim user, fortunately there are already many plugins to support my need in using Simplenote service, and one of them is Vimplenote

One reason for choosing Vimplenote than another plugins is because it's the easiest one to configure. I also using Vundle, Vim package manager to install and manage my vim plugins.

Enough said, just follow my steps to do it:
1. I prefer clean install, so move your ~/.vim and archive it
$ mv ~/.vim ~/.vim-bk
2. Create new ~/.vim and ~/.vim/bundle (to contain your plugins)
$ mkdir -p ~/.vim/bundle
3. Setup Vundle
$ git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
4. Configuring .vimrc
 set nocompatible               " be iMproved
 filetype off                   " required!

 set rtp+=~/.vim/bundle/vundle/
 call vundle#rc()

 " let Vundle manage Vundle
 " required! 
 Bundle 'gmarik/vundle'

 " My Bundles here:
 "
 " original repos on github
Bundle 'mattn/vimplenote'
Bundle 'mattn/webapi'
 " ...

 filetype plugin indent on     " required! 
 "
 " Brief help
 " :BundleList          - list configured bundles
 " :BundleInstall(!)    - install(update) bundles
 " :BundleSearch(!) foo - search(or refresh cache first) for foo
 " :BundleClean(!)      - confirm(or auto-approve) removal of unused bundles
 "
 " see :h vundle for more details or wiki for FAQ
 " NOTE: comments after Bundle command are not allowed.. 
5.  Get webapi-vim and vimplenote-vim
$ git clone git://github.com/mattn/webapi-vim.git ~/.vim/bundle/webapi
$ git clone git://github.com/mattn/vimplenote-vim.git ~/.vim/bundle/vimplenote
6. Running and installing bundle
$ vim
:BundleInstall
7. Using Vimplenote (do it inside vim)
:Vimplenote -l     " list of your Simplenote notes (you'll be prompted to fill in login credentials)
:Vimplenote -d    " delete your current note
:Vimplenote -n    " create new note
:Vimplenote -u    " update current note
:Vimplenote -t     " add a tag to a note
:Vimplenote -s    " search a note
And you're good to go :)

You can also see the README file in every plugin page to see additional info.

Thursday, December 29, 2011

Virtual Keyboard on #Pre2 #webOS

Testing this on my Pre2 running #webOS 2.2.4 and works fine, so far :)

See the forum thread here, check out the #1 post, then follow the detail steps below:
1. Download luna.conf.patch for webOS 2.x from Arthur Thornton (on that #1 post)
3. Download VKB-1.1.4.zip (also on that #1 post, depending on your webOS version)
4. Install luna.conf.patch to your Pre 2 using webOS Quick Install



5. Unzip VKB-1.1.4.zip, you've got VKB.sh and send that file to your Pre 2 (e.g to /media/internal)



6. Accessing linux in your Pre 2 using webOS Quick Install or novaterm through Windows Command Prompt / Linux Terminal
7. Go to /media/internal directory: # cd /media/internal
8. Run this command: # VKB.sh -patch
9. Your Pre 2 will boot automatically
10. You've got the Virtual Keyboard by swiping up from gesture area

Tuesday, December 27, 2011

Live Partitioning HP TouchPad #webos

You can see the source of this blogpost here. I just re-write on my blogpost according to my own experience, trials and errors :)

I assume that you already have all requirement to connect to your TouchPad (Palm SDK, Linux Access, etc.)

Here's what you have to do:
1. Check the actual space used by /media/internal, write down or take screenshot
# df -h | grep internal

 2. Disconnect cryptofs
# pkill -SIGUSR1 cryptofs
3. Unmount /media/internal
# umount /media/internal
4. Verifying you have clean filesystem, before resizing (in my case, there are differences between boot sector and its backup, but I just choose 'no action' )
# /usr/sbin/fsck.vfat /dev/mapper/store-media
5. Verify how much space used by /media/internal
# lvscan | grep media

6. Decide and take space allocated for ext3fs partition (I took 2GB ext3fs partition for DebianChroot, so I resize /dev/mapper/store-media became 10.64G, from 12.64G)
# resizefat /dev/mapper/store-media 10.64G

7. # lvresize -L 10.64G /dev/mapper/store-media

8. Use free 2G partition to make ext3fs partition
# lvcreate -l 100%FREE -n ext3fs store
9. Format the partition with ext3 filesystem
# mkfs.ext3 /dev/mapper/store-ext3fs
10. Make the filesystem writable
# mount -o remount,rw /
11. Make mount directory
# mkdir /media/ext3fs
12. Add a line in /etc/fstab to automount ext3fs partition on boot up
# echo "/dev/mapper/store-ext3fs /media/ext3fs auto noatime 0 0" >> /etc/fstab
13. Make the filesystem back to read-only
# mount -o remount,ro /
14. Reboot
# reboot

That's it! And I'm pretty sure that you can apply this to any webOS devices :)