Deprecated: Assigning the return value of new by reference is deprecated in /home/geekro/public_html/wp-settings.php on line 520

Deprecated: Assigning the return value of new by reference is deprecated in /home/geekro/public_html/wp-settings.php on line 535

Deprecated: Assigning the return value of new by reference is deprecated in /home/geekro/public_html/wp-settings.php on line 542

Deprecated: Assigning the return value of new by reference is deprecated in /home/geekro/public_html/wp-settings.php on line 578

Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/geekro/public_html/wp-settings.php on line 18

Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with Walker::start_lvl(&$output) in /home/geekro/public_html/wp-includes/classes.php on line 1199

Strict Standards: Declaration of Walker_Page::end_lvl() should be compatible with Walker::end_lvl(&$output) in /home/geekro/public_html/wp-includes/classes.php on line 1199

Strict Standards: Declaration of Walker_Page::start_el() should be compatible with Walker::start_el(&$output) in /home/geekro/public_html/wp-includes/classes.php on line 1199

Strict Standards: Declaration of Walker_Page::end_el() should be compatible with Walker::end_el(&$output) in /home/geekro/public_html/wp-includes/classes.php on line 1199

Strict Standards: Declaration of Walker_PageDropdown::start_el() should be compatible with Walker::start_el(&$output) in /home/geekro/public_html/wp-includes/classes.php on line 1244

Strict Standards: Declaration of Walker_Category::start_lvl() should be compatible with Walker::start_lvl(&$output) in /home/geekro/public_html/wp-includes/classes.php on line 1391

Strict Standards: Declaration of Walker_Category::end_lvl() should be compatible with Walker::end_lvl(&$output) in /home/geekro/public_html/wp-includes/classes.php on line 1391

Strict Standards: Declaration of Walker_Category::start_el() should be compatible with Walker::start_el(&$output) in /home/geekro/public_html/wp-includes/classes.php on line 1391

Strict Standards: Declaration of Walker_Category::end_el() should be compatible with Walker::end_el(&$output) in /home/geekro/public_html/wp-includes/classes.php on line 1391

Strict Standards: Declaration of Walker_CategoryDropdown::start_el() should be compatible with Walker::start_el(&$output) in /home/geekro/public_html/wp-includes/classes.php on line 1442

Strict Standards: Redefining already defined constructor for class wpdb in /home/geekro/public_html/wp-includes/wp-db.php on line 306

Strict Standards: Redefining already defined constructor for class WP_Object_Cache in /home/geekro/public_html/wp-includes/cache.php on line 431

Strict Standards: Declaration of Walker_Comment::start_lvl() should be compatible with Walker::start_lvl(&$output) in /home/geekro/public_html/wp-includes/comment-template.php on line 1266

Strict Standards: Declaration of Walker_Comment::end_lvl() should be compatible with Walker::end_lvl(&$output) in /home/geekro/public_html/wp-includes/comment-template.php on line 1266

Strict Standards: Declaration of Walker_Comment::start_el() should be compatible with Walker::start_el(&$output) in /home/geekro/public_html/wp-includes/comment-template.php on line 1266

Strict Standards: Declaration of Walker_Comment::end_el() should be compatible with Walker::end_el(&$output) in /home/geekro/public_html/wp-includes/comment-template.php on line 1266

Strict Standards: Redefining already defined constructor for class WP_Dependencies in /home/geekro/public_html/wp-includes/class.wp-dependencies.php on line 31

Strict Standards: Redefining already defined constructor for class WP_Http in /home/geekro/public_html/wp-includes/http.php on line 61
Geek.ro

January 30, 2014

BAMT mining problems

Crypto | Comments (0) admin @ 6:06 am

With default installations of BAMT you will often get an error after a messy reboot
and the miner wont start.
If you try to start it manually and you get this:
root@bamt-miner:/opt/bamt# /etc/init.d/mine restart
Stopping mining processes…: mine..cgminer api failed…
Starting mining processes…: minestart_mining: starting mining processes
Invalid MIT-MAGIC-COOKIE-1 key..munin..cgminer…

Edit /etc/init.d/mine and after the line with:
export GPU_MAX_ALLOC_PERCENT=100
add this:
chown user:user /home/user/.Xauthority

coldreboot your system and mining should start if you dont have
other configuration problems.

Happy mining.

December 2, 2013

An inspiring talk about the power of open source systems

Open Source, Privacy | Comments (0) admin @ 10:56 am


I suggest you watch this entire playlist if privacy is important to you http://www.ted.com/playlists/130/the_dark_side_of_data.html

October 10, 2011

BOFH style

Fun Stuff | Comments (0) admin @ 5:36 am

Webmaster : hey dude  how can I prevent receicing to my webmaster account 5k spam emails every day?
Sysadmin: fixed that
Sysadmin: I removed your account
Sysamdin: 0 spam from now on
Webmaster: LOL!!!
Webmaster: removed my account?
Webmaster: what du mean
Webmaster: now I have no more email?
Sysadmin: well yea, but zero spam
Sysadmin: so its cool
Webmaster: CRAP! NO I WANT THE SPAM!
Webmaster: SEND ME THE SPAM!
Sysadmin:  :))
Webmaster: I want to be spammed!
Webmaster: hahaha

June 14, 2011

PleskFatalException out of webspace in Webspace.php

Plesk | Comments (0) admin @ 1:33 pm

Spent a few hours debugging this error and it seems transvhosts.pl breaks some things when trying to change the vhosts directory.

Some things you need to check:

check /etc/psa/psa.conf  for HTTPD_VHOSTS_D and make sure the path doesn’t contain a trailing slash.

check the hosting,smb_apsProvisionEnvironments,subdomains, sys_users tables in the psa database and make sure the home field points to the right path.

You can use the mysql REPLACE function if not:

update sys_users set home=REPLACE(home,”OLD_PATH”,”NEW_PATH”);

Check that the domain has an entry in the hosting table.

Check that the home field in the sys_users table points to the same path as in the hosting table.
This ended up fixing it for me, in sys_users I had /www/vhosts/domain.com and in hosting /www/vhosts/ANOTHERdomain.com/something

September 4, 2010

How to delete spam comments from wordpress

wordpress | Comments (0) admin @ 12:34 pm

Once you put a blog up you will be the target of many link spammers looking for link juice. You can add a series of plugins to prevent them from clogging your database
but if you’re lazy like me you can delete them once in a while using a simple sql query:

DELETE FROM wp_comments WHERE comment_approved=0;

This deletes all unapproved comments, not necessarily all of them being spam.

February 28, 2010

maildrop whitelists and blacklists

Sysadmin | Comments (0) admin @ 7:50 am

SpamAssassin and greylisting are great tools for reducing the amount of spam thats cluttering our mailboxes, however theres always those false positives that in a business environment can become quite critical.
One of the ways to improve the delivery of important emails is to create whitelists, respectively blacklists, to make sure we are not missing anything vital.
Maildrop has some very nice filtering capabilities, but as with any complex software its easy to make mistakes.
It took me some time to play around, trying to create a whitelist, till I found the lookup function which seems the perfect fit for this.
Heres my new mailfilter config which now has a white/black - list.

SHELL=/bin/sh
SPAM="/path/to/spam/Maildir/"
MAILBOX="/path/to/user/Maildir/"

/^From:.*/
getaddr($MATCH) =~ /^.*/;
MATCH=tolower($MATCH)

if ( lookup($MATCH, "geek.ro-blacklist") )
         to "$SPAM"
if( lookup($MATCH, "geek.ro-whitelist") )
         to "$MAILBOX"
if (/^X-Spam-Status:  *Yes*/)
         to "$SPAM"
to "$MAILBOX"

the geek.ro-whitelist, geek.ro-blacklist files are just regexes to match against the sender’ email address, (e.g. .*@domain\.com), one per line.

October 30, 2009

Learn how to count()

PHP, mysql | Comments (0) admin @ 7:40 am

PHP makes lazy programmers. I don’t want to turn this into a bashing post but as a sysadmin I’ve come across a lot of misbehaving scripts that are slowing my servers down to a halt. The general acceptance is that not the language makes bad code but the programmer, which is true, but the wide spread of php snippets turned everyone with a browser into a coder. Unfortunately, or not, programming takes a lot more than gluing together some pieces of code.
While the vast information present on the web can help you a lot in improving your coding skills theres something that no paper will teach you and that is common sense.
This are two recent cases of awful programming I encountered lately and which made by head twist at the lack of thought from the supposed coder.
Case 1:
$query = “SELECT * FROM table WHERE cond=true”;
$res   = mysql_fetch_array($query);
$num   = mysql_num_rows($res);

I just looked up the manual page for mysql_num_rows and I see where most got their bad habits from.
Why this is bad:
You might not notice the performance problems of this query if you have a small table or if you’re running the mysql server on localhost. What this query does is generate a lot of useless traffic/IO and when you have this query running several times per minute or on a huge table it will have your server crawl no matter the hardware you have behind it. What you are doing is fetching all the rows from the database and then counting them, just imagine selecting 1mil records every time a page loads just to see how many of them you have and you’ll get a sense of whats wrong with this type of approach.
Solution:
$query = “SELECT count(*) FROM table WHERE cond=true”;
$num   = mysql_fetch_row($query);
Same result a lot less overhead.
Case 2:
$query = “SELECT * FROM table WHERE cont=true”;
while ($res = mysql_fetch_assoc($query)) {
array_push($ids,$res['id']);
}
Why this is bad:
Again you are selecting an entire dataset when you need only a fraction of it.
Solution:
$query = “SELECT id FROM table WHERE cond=true”;
while ($res = mysql_fetch_assoc($query)) {
array_push($ids,$res['id']);
}

Keep in mind that all snippets you find on the net are just examples and are made so that they apply for a wide variety of cases, this doesn’t mean that it is the best approach for your scenario. Keep all things minimal and work only with the data you really need.

May 26, 2009

Amavis - MySQL server has gone away

Sysadmin | Comments (0) admin @ 8:01 am

I found this error cluttering my system logs:
May 26 06:39:16 zeus amavis[10981]: (10981-04) NOTICE: reconnecting in response to: err=2006, HY000, DBD::mysql::st execute failed: MySQL server has gone away at (eval 86) line 166, GEN54 line 5.

After a bit of debugging it turns out amavis keeps an open connection to mysql and depending on your wait_timeout setting it might lose the connection and need to reconnect.
In order to fix this you just need to increase your wait_timeout to a comfortable value.

mysql set global wait_timeout=28800;
Query OK, 0 rows affected (0.00 sec)

You also need to edit your my.cnf file to make sure the change is persistent across mysql restarts.