List files in Linux by date

Posted by & filed under Code Tips.

Not really code, but still something I need often enough to write it down. This command will list all files in a Linux folder sorted by date with the most recently updated files at the bottom. ls -ltrh From the ls man page, here’s what each of the choices do. -l – Uses a Long… Read more »

Run the same command on every line in a file

Posted by & filed under Code Tips.

This snippet will let you run the same command using each line from a file as a parameter. cat filename.txt | while read in; do echo “$in”; done As written it’ll open up filename.txt and echo out every line. Probably not what you want, so replace echo “$in” with whatever command you want to run…. Read more »

Missing httpd.conf in WHM / cPanel

Posted by & filed under Internet.

Came across an error after mistakenly clicking a link in my hosting control panel. At the time, WHM was working but none of the sites on the server would load. Trying to restart httpd manually from PuTTY resulted in an error that httpd.conf couldn’t be found. Fortunately, there was an easy fix. It’s a script… Read more »

Should I block Baidu?

Posted by & filed under Internet.

Well, I am for now. I noticed Baidu pretty much on a forum of mine 24/7, but I didn’t recall ever seeing them show up in the referrer logs.  Over the past year, across the sites on my server, they’ve made almost 35,000 requests for pages; chewed up 337 megs of bandwidth, admittedly not a… Read more »

Enable mod_rewrite on Ubuntu

Posted by & filed under Unfiled.

Looks like Apache2 is installed in Ubuntu with mod_rewrite, but it’s disabled by default.  Fortunately a quick drop to the terminal followed by restarting Apache2 and it’s fixed.