How to Display Seconds in Unix File Timestamp

Apparently, there’s no native shell command to show the seconds portion of a unix file timestamp. The nearest to this functionality is stat. However, it’s not always available in unix systems. I’m using HP-UX and it’s not installed on our server.

Instead, I needed to use a one-line perl program shown below.

perl -e .foreach(@ARGV){$t =localtime ( ( ( stat ( $_ ) ) [9] ) ); printf(.%-20s %s\n.,$_,$t);}. filename.txt

My perl knowledge is limited to its name. I have nothing beyond that. That’s my way of saying ‘I don’t know what it is.’ But it works!


Source:

http://www.unix.com/shell-programming-scripting/41325-command-get-file-timestamp-including-seconds-aix-5-3-a.html

Incoming search terms:

  • unix file timestamp
  • unix file timestamp seconds
  • how to get timestamp of a file in unix
  • how to get the timestamp of a file in unix
  • show timestamp in seconds for unix file
  • show timestamp in seconds
  • show seconds stat
  • seconds timestamp of a file in unix
  • unix time of file in seconds
  • perl one liner unix file timestamp

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:

  • comforthost spotvps
  • spotvps
  • spotvps reviews
  • cachefly vps
  • vps wget 10 mb test file
  • vps cachefly test
  • spotvps net
  • spotvps ip location
  • spotvps coupon
  • spotvps 2gb ram

Shopping Cart Always Empty

After using suPHP on my Apache webserver and NGINX on another server, I realized that my cart systems are no longer working. Here are the symptoms I noticed.

  1. AJAX Carts does not display items
  2. When clicking checkout, the cart becomes empty
  3. After clicking update, the cart becomes empty

If you look at the symptoms, you’ll notice that every time you move to another page of your website, the cart is emptied. It only mean that the session data is not being saved. And with that, you’ll have to check your PHP save_path session settings in PHP.INI. Most often than not, the current value is /etc/php/sessions. You’ll have to check the folder permission. On my case, the folder is owned by root and the group is apache.
[Read more...]

Incoming search terms:

  • wordpress php ini cart problem
  • shopping carts always show empty
  • suphp session save_path
  • value session save_path is empty wordpress

NGINX – 502: Bad Gateway

One of my VPS on NordicPVS went down today and after restarting, I got a number of weird errors. Apparently, the contents of my VPS were wiped-out. Though I managed to solve most of the problems (mostly by restoring the backup), I kept getting the 502: Bad Gateway error. I told myself that this can’t happen because I restored the whole system from the backup already.

After going through a checklist, I found out that PHP CGI is not running. All I had to do is jumpstart it and everything is working as before.

/etc/init.d/php_cgi start

[Read more...]

Incoming search terms:

  • nginx bad gateway
  • 502 bad gateway nginx wordpress
  • 502 bad gateway nginx solved
  • wordpress 502 bad gateway
  • nginx 502 bad gateway wordpress
  • wordpress nginx 502
  • 502 bad gateway wordpress
  • nginx 502 bad gateway error on wordpress
  • virtualmin nginx 502 error
  • prestashop nginx bad gateway

WP MultiSite : Error Connecting to Database

I searched the interwebs and the solutions I found are mostly solving a different problem. To be specific, the problem being solved is about the WordPress MU migrated to WordPress MultiSite. Another problem raised that gets this message is about plugins incompatible with the MultiSite. Of course, you only need to disable those plugins.

Here’s the case I have.
Server Setup
Type : VPS
WebServer : nginx-0.8.51
WP Version : WP 3.0.1 multisite enabled
Plugins Installed : NONE
Problem Description :
After adding new blogs on my multisite installation, the error below

‘Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down.’

Additional Detail : The main site is accessible without any problem. The admin dashboard is configurable. So the message that there’s a problem with the login credentials is simply not true.
[Read more...]

Incoming search terms:

  • wordpress multisite Error establishing a database connection
  • Error establishing database connection wordpress multisite
  • wordpress multisite error establishing database connection
  • Error establishing a database connection wordpress multisite
  • error establishing database connection multisite
  • Error establishing a database connection multisite
  • wordpress multisite database error
  • multisite error establishing a database connection
  • multisite error establishing database connection
  • wordpress multisite error connecting to database