This post is a good introduction to bash scripting/programming.
I toyed with Amazon EC2 last year by migrating my web server there. After issuing
shutdown -P in Ubuntu last week, my instance disappeared from the list in the AWS dashboard. I seeked help and found out that some AMI’s are set to terminate at shutdown. Unfortunately, the AMI I used was one of them. Files and settings are not recoverable after an instance is terminated. Luckily, I transferred most of my critical information out prior to the shutdown; I’m only missing one file. Note to self: for all future instances, the shutdown behavior to
stop (as opposed to
terminate) could be modified per these instructions. First, create and download the X.509 certificate and private key. To access the EC2 api, do the following on your computer:
<pre class="src src-sh">sudo apt-get install ec2-api-tools ec2-ami-tools <span style="color: #ff4500;">##</span><span style="color: #ff4500;">ec2-init</span>
Then, do the following to find out what behavior is currently set on your instance:
ec2-describe-instance-attribute i-AMAZON-INSTANCE-ID --instance-initiated-shutdown-behavior -K /path/to/x509-key.pem -C /path/to/x509-cert.pem
If the value is not
stop, then do
ec2-modify-instance-attribute i-AMAZON-INSTANCE-ID -K /path/to/x509-key.pem -C /path/to/x509-cert.pem --instance-initiated-shutdown-behavior stop
When setting up sshfs mounts and Linux samba servers, one can make it so that symbolic links are followed (so they aren’t broken). For sshfs, add the
follow_symlinks option. In
/etc/fstab/, the entry would look something like
sshfs#USERNAME@SERVERNAME: /mnt/acer fuse fsname=sshfs#USERNAME@SERVERNAME:,comment=sshfs,noauto,users,exec,uid=1000,gid=1000,allow_other,reconnect,transform_symlinks,follow_symlinks,BatchMode=yes 0 0
For samba, add the following to either the
[global] options or the individual location in
follow symlinks = yes wide symlinks = yes unix extensions = no
Make sure samba is restarted and the sshfs mount point is re-mounted.
I just installed Linux Mint on my Asus T101MT. As with all my computers, I prefer to have the caps lock key as a control key. Of these methods, only the
xkb command works. To have the key remapped every session, I followed these instructions and created the file
<pre class="example">[Desktop Entry]
Encoding=UTF-8 Name=nocaps Comment=Remap caps lock as control. Exec=setxkbmap -option ctrl:nocaps Terminal=true
I just discovered Voodoo OTA Rootkeeper, which makes a backup copy of root (
su) and could restore root after any OTA update. I guess this is useful for me since I haven’t installed any custom roms on these two devices (yet) and am able to do OTA updates. The app does not work with all devices, but it works on my HTC Evo 3D phone and Asus Transformer Prime tablet.
This post does a fantastic job of the Mahalanobis distance. Basically, one can think of it as a multivariate generalization of the z-score. That is, the standardized distance of a vector from the origin (mean vector).
I read this interesting post the other day about how to break those annoying CAPTCHA’s by utilizing cheap labor (like $1 for 1,000 captchas) from less developed countries with services like Antigate. Kind of a cool thought, but that would just mean it’s easier for the spammers to work.
This site allows me to convert what I write to LaTeX or MathML codes. I think it’s conversion or translation is quite accurate after a quick test.