Glark

From Linux.com By Joe ‘Zonker’ Brockmeier GNU grep is one of my go-to tools on any Linux box. But grep isn’t the only tool in town. If you want to try something a bit different, check out glark a grep alternative that might might be better in some situations. What is glark? Basically, it’s a…


daily reboot via cron

Not saying this is a good idea, but a client requested it… 0_o Here is crontab -e ### Reboot the server every day at 3:00 am 0 3 * * * /sbin/shutdown -r now >/dev/null or, if the want to call a reboot from script: Here is reboot_server.sh #!/bin/bash /sbin/shutdown -r now


Dig multiple cpanel domains

If you find yourself with a customer requesting to know where all the domains associated with a cpanel account are pointing to or are migrating accounts, you can do the following: #for each in `ls /var/cpanel/users/*`; do grep DNS $each >> domains.txt; done; #sed -i ‘s:.*DNS.*\=::gi’ domains.txt ; #for each in `cat domains.txt`; do echo…


Apt-Undo

From From http://lkubuntu.wordpress.com Apt-Undo, a simple way of undoing Apt actions I have done many actions with apt-get that I later regretted, so I decided to make a script to undo those actions. This script can only work if you use this script instead of apt-get to install/upgrade/remove/purge/downgrade your packages. To install, open up a…


Tailwatchd failed

If you are receiving the tailwatchd failed email, check to make sure all the components under tailwatchd are selected; Eximstats, ChkServd , Antirelayd & cPBandwd. You can check this by /usr/local/cpanel/libexec/tailwatchd –status Also make sure you check the tailwatchd logs for the failure reasons: tail /usr/local/cpanel/logs/tailwatchd_log Then restart the Cpanel service using /etc/init.d/cpanel restart If…


Bulk updating DNS zone files

DNS zone files are refreshed by increasing the serial number in the format yyyymmddXX (e.g 2011070501 eg. 5th July, 2011 and serial number is 01). In case all of the DNS zone files on the server need to be refreshed, we can increment the serial number, lower the TTLs and reloading the zone files, in…


Chromium Dual View

Just a quick update today on an old chromium tweak which I have found useful. If you are using chromium and need a dual view, you can add this as a bookmark to accomplish that javascript:A14nH=location.href;L3f7=prompt(‘Choose%20File%201’,A14nH);R1Gh7=prompt(‘Choose%20File%202′,L3f7);if(L3f7&&R1Gh7){Fr4Q=’\n’;Fr4Q+=’\n’;Fr4Q+=”;with(document){write(Fr4Q);void(close())}}else{void(null)} Once the bookmark is activated, it will ask what link you would like in the first window, and then…


Batch download using wget

To get a clean download, if you knows the file format you want, you can do this: wget -nd -r -l1 –no-parent -A.mp3 -A.wma http://www.foo.com/mp3/ To explain briefly the options speficied; -nd no directory, by default wget creates a dir -r recursively download -l1 (L one) level 1, download only of that particular folder, don’t…


Block hotlinking images

Using the .htaccess code below will essentially block the image from being server and pull an image an existing image located on imgurl or some other image hosting site. RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://(.+\.)?g33kinfo\.com/ [NC] RewriteCond %{HTTP_REFERER} !^$ RewriteRule .*\.(jpe?g|gif|bmp|png)$ http://imgur.com/tSEqO [L]


Graylog2

From graylog2.org Graylog2 is an open source log management solution that stores your logs in MongoDB. It consists of a server written in Java that accepts your syslog messages via TCP, UDP or AMQP and stores it in the database. The second part is a web interface that allows you to manage the log messages…