First, I encountered this error "Can't pvremove physical volume "/dev/sdc1" of volume group "nova-volumes" without -ff" (I'm actually using OpenStack but it's another story). So to remove this, do first, ~# pvscan PV /dev/sdb1 VG nova-volumes lvm2 [1.82 TiB / 1.82 TiB free] PV /dev/sda5 VG cloudmaster lvm2 [297.85 GiB / 12.00 MiB free] PV /dev/sdc1 lvm2 [1.82 TiB] Total: 3 [3.93 TiB] / in use: 2 [2.11 TiB] / in no VG: 1 [1.82 TiB] Then, when I do, ~# pvremove /dev/sdc1 Can't pvremove physical volume "/dev/sdc1" of volume group "nova-volumes" without -ff So I need to, ~# vgreduce nova-volumes /dev/sdc1 Removed "/dev/sdc1" from volume group "nova-volumes" Then do `pvscan` again, ~# pvscan PV /dev/sdb1 VG nova-volumes lvm2 [1.82 TiB / 1.82 TiB free] PV /dev/sda5 VG clou...
I found ShellEd when googling for any shell editor. It was trouble at first because there's no how-to that directs me, where I expect to have a direct link that I can copy-en-paste to my Eclipse for installation. So what I did, I download ShellEd (as of this writing file version ShellEd-Update-2.0.0_M3.zip) from sourceforge.net and install, as required, the Linux Tools . After installing Linux Tools, I then locate thru archive the ShellEd zip file and install it successfully. It works good and I feel satisfied with this cool tool to be embedded in eclipse. The sample attached shell script is from JBoss twiddle. It does supports syntax highlighting, intellisense which is cool. Hope this helps.
Tinkering with sed, I have manage to try using regular expressions using backreferences using the most common \N where N is the number of position inside the parenthesis. Searches and replaces the zoo.color to zoo['color'] or zoo.animals to zoo['animals']: cat zoo.js | sed -E "s/(zoo)(\.)([a-zA-Z0-9]*)/\1['\3']/g"|less \1 = is the characters inside the first parenthesis w/c is the zoo \3 = is the characters inside the third parenthesis which involves alpha-numeric -E will interpret as regular expressions as extended (modern) regular expressions rather than basic regular expressions (BRE's) Another example, you can use this for replacing such a string let say, in a SQL statement, example SQL string: CREATE DEFINER=`mysqluser`@`%` FUNCTION `total`(cost DOUBLE, income DOUBLE, lng2 DOUBLE) RETURNS double And you wanted to remove DEFINER=`mysqluser`@`%` and allow FUNCTION to be a dynamic string so you'll just need to catch tha...
Comments