How to Get The First File in Unix

In case you are looking files using ls or find command and only want to get the first file found, the command would be like.

ls -l /any/path/filename*|sed -e 's/\//,/g'|awk -F "," '{print $NF}'|head -1

Of course, you can also use it in find command.


find /any/path/ -name "filename*" -type f|sed -e 's/\//,/g'|awk -F "," '{print $NF}'|head -1

[Read more...]

Incoming search terms:

  • unix find first file

SpotVPS First Impressions

After the unfortunate incident last week with NordicVPS, I decided to look for a new VPS host. As usual, I went to lowendbox and get the reviews in webhostingtalk. It’s there where I stumbled upon a promo from SpotVPS. As it turns out, SpotVPS is a low-cost VPS offering of ComfortHost.NET.

And who are they? Here’s what they say about themselves.

ComfortHost.NET have been here since 2004 offer high quality web hosting solutions. All SpotVPS nodes are fully owned hardware and are colocated. All servers used by SpotVPS have been bought with internal cash. Our only monthly cost for these servers are the actual colocation. We are financially healthy and profitable since day one. We are NOT going out of buisness any time soon. We are in it for the long run!

ComfortHost on http://www.webhostingtalk.com/showthread.php?t=1110770

Here’s the plan that I got.
$6.99/mo Ultimate Plan
Memory: 2048mb (2gb)
HD Space: 50gb (50,000mb)
Bandwidth: 1,000gb (1TB)
Monthly Price: $6.99/mo
Setup Fee: FREE!
FREE GIGABIT PORT – FREE WEEKLY BACKUPS – FREE HARDWARE RAID
Location: Orlando, FL at DimeNOC
Test IP Address: 72.29.87.105

2GB RAM for $6.99. That’s sweet. Want to try it yourself? ORDER NOW

Word of caution,though. This plan (and all other dirt-cheap vps that I know of) comes with very limited support. You are usually given your VPS, IP and OS install and you have to do the rest. I installed mine with NGiNx, PHP, MySQL and it’s already up and running for 7 days straight now.

Here’s the result of the test I made on my VPS.

[root@vps ~]# dd if=/dev/zero of=test bs=64k count=16k conv=fdatasync
16384+0 records in
16384+0 records out
1073741824 bytes (1.1 GB) copied, 14.9939 seconds, 71.6 MB/s

[root@vps ~]# wget cachefly.cachefly.net/100mb.test
--2011-11-24 18:10:35-- http://cachefly.cachefly.net/100mb.test
Resolving cachefly.cachefly.net... 205.234.175.175
Connecting to cachefly.cachefly.net|205.234.175.175|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 104857600 (100M) [application/octet-stream]
Saving to: `100mb.test'

100%[==============================================================================================================================>] 104,857,600 66.8M/s in 1.5s
2011-11-24 18:10:36 (66.8 MB/s) - `100mb.test' saved [104857600/104857600]

I’ll try to come up with a review together with my other hosting providers. :)

Incoming search terms:

  • spotvps
  • cachefly vps
  • comforthost spotvps
  • spotvps coupon
  • spotvps net
  • vps cachefly test
  • vps wget 10 mb test file

How To Install Setacl in Linux

First, there’s no setacl in Linux. Instead, it has setfacl. Take note of the f. Second, setfacl is part of the access control list(acl) package so we install the acl intead of setfacl. In that way, we also install getfacl.
[Read more...]

Incoming search terms:

  • setacl centos
  • linux install setfacl
  • setfacl install
  • ubuntu setacl install
  • ubuntu install getfacl
  • ubuntu setfacl install
  • setacls centos
  • setacl in linux
  • which package setfacl
  • acl linux blog

How to Upgrade MySQL 5.0 to 5.5 in CentOS

I upgraded the installed MySQL on my two VPSes about two months ago and I thought I already saved the steps somewhere or at least the saved the URL of the how to. I did not so when I tried to upgrade the Pagudpud Resort‘s (owned by the Jackoleros) database server, I don’t know where to start. The MySQL official website suggests(or at least, that’s how I understand it) that I recompile. I know I did not recompile before so after some fruitless googling, I finally found a working version. But first, thanks to remi for sharing the rpm.
[Read more...]

Incoming search terms:

  • upgrade mysql centos
  • mysql upgrade 5 0 to 5 5
  • update mysql centos
  • centos update mysql
  • centos upgrade mysql
  • mysql upgrade centos
  • mysql 5 0 to 5 5
  • upgrade mysql 5 0 to 5 5 centos
  • mysql 5 0 to 5 5 upgrade
  • yum update mysql 5 5

LAMP Install on VPS : CentOS5+Apache+MySQL+suPHP

Here’s the work-in-progress instructions for setting up a LAMP. It’s been sitting on my draft for ages and I have to publish it because a few of my friends need it.

**** NOTE : If you notice, it’s still a draft. It came from a number of sources but these are the steps I use. So I know it works. **********

[Read more...]

Incoming search terms:

  • centos 5 lamp install
  • setup proftpd vps centos
  • stop suphp
  • suphp configuration centos apache
  • suphp lamp
  • touch /var/lock/subsys/proftpd
  • vps centos how to instyall php version 5
  • yum -y mysql
  • yum install php3
  • yum upgrade apache centos

Recursive setacl command on Linux/Unix

Setting access control list(acl) recursively is not as straigthforward in HP/UX. I believe the same is true for other Unix flavors. In case you are wondering how, the command is shown below.
[Read more...]

Incoming search terms:

  • setacl linux
  • linux install command recursive
  • setacl recursive
  • SetACL
  • kwatog setfacl
  • setacl recursive in hp-ux
  • setacl kwatog
  • setacl hp-ux file
  • setacl en linux que es?
  • setacl command in unix

SubVersion Initialization Error

After installing subversion, I hit some error when I tried to restart Apache. When I removed/renamed the subversion.conf and the error went away. Obviously, subversion did not work. So I investigated to find out the root cause.
[Read more...]

How To Install Subversion on CentOS

I finally decided to setup an online version control and chose subversion (instead of cvs which I use on my macbook). Initially, I was thinking of subscribing to github but the prospect of paying monthly did not bode well especially that it would only be me who will be updating the codes. Github has a free service though. But that’s if you open-source your code.
[Read more...]

Incoming search terms:

  • install subversion centos
  • centos svn
  • install subversion on centos
  • install svn centos
  • svnauthz conf httpd conf
  • svn centos passwd
  • install subversion on centos step by step
  • mod dav svn sethandler php
  • password protect svn centos
  • step by step guide to install subversion in centos

Read Input Without Echo in Bash

I have a script that needs to be deployed in different environment as most scripts are. This script requires asking for userid, tnsname and password during deployment. I tried to use READ but it echoes the password on the screen as soon as I type it. So how can we hide the password? Here’s how.
[Read more...]

Incoming search terms:

  • bash read password no echo
  • bash read password
  • bash read input
  • bash read without echo
  • bash read no echo
  • bash readInput
  • read contraseñas bash
  • C no echo input
  • echo $ % bash
  • echo -e bash

MySQL Fail To Start After Upgrade to 5.1 or higher

I recently upgraded my MySQL in preparation for WordPress 3.2. The version I now have is 5.5.12. The upgrade finished without a hitch but when I tried to restart the service, the MySQL Daemon failed.

Here’s the log of mysql (/var/log/mysqld.log)

110514 14:04:22 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
110514 14:04:22 [Note] Plugin 'InnoDB' is disabled.
110514 14:04:22 [Note] Plugin 'FEDERATED' is disabled.
/usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist
110514 14:04:22 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
110514 14:04:22 [ERROR] Unknown/unsupported storage engine: InnoDB
110514 14:04:22 [ERROR] Aborting

Initially, I thought the problem was on the mysql_upgrade part because that’s the first error that appears on the log. Apparently, that’s just a warning message because the service still managed to proceed to the next step which is for the InnoDB. And based on the log, it failed to start and actually aborted. So that’s where I should concentrate my investigation/trial-and-error.

Solution

I opened /etc/my.cnf and comment out skip-innodb and then restart mysqld. It fixed the problem and mysql managed to start. I then proceeded with the mysql_upgrade which is unrelated to the error.

Another solution for this is to set the default storage to other than InnoDB. However, I haven’t tried that myself.

Incoming search terms:

  • mysql daemon failed to start
  • mysql daemon failed to start centos
  • Unknown/unsupported storage engine: InnoDB
  • mysql failed to start
  • mysql upgrade failed
  • unknown/unsupported storage engine: innodb centos
  • mysql daemon failed to start after update
  • mysql upgrade 5 1 to 5 5 mysql daemon failed to start
  • mysql start failed log
  • mysql restart failed