MonetDB problem starting DB
When you get:
$ monetdb start mydatabase
starting database 'mydatabase'... FAILED
start: starting 'mydatabase' failed: database 'mydatabase' appears to shut itself down after starting, check monetdbd's logfile for possible hints
Look into the merovingian.log in the /dbfarmpath/. Try to run the /usr/bin/mserver5 –dbpath=…… line and see the error
1) make sure that /dbfarmpath/databasename/bat/BACKUP path has the correct owner and rights (not reverted back to root) – a quick chown user BACKUP -Rf will fix that
Linux fail2ban
Linux utility fail2ban looks through log files and adds ip addresses with too many failed login attempts to iptables block list
RHEL friendly Grand Perspective-style linux disk space visualizer
Need to yum install gtk2-devel and gtk+ first
Create Windows Service from exe file
From http://www.msfn.org/board/topic/83272-how-to-run-a-program-as-a-service/:
Download nssm (non-sucking service manager) from www.nssm.cc
sc create YourServiceName binPath= "c:\nssmdir\nssm.exe"
Note the space after the =
Then go to regedit, go to HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet -> Services, and find the new service. Add a new key called “Parameters” and in parameters, add new String Values for AppDirectory, Application, and AppParameters. AppDirectory should be the directory to start from, Application is the executable path and name, and AppParameters is additional flags to send in.
Then you can start it from the Services GUI.
Django installation on RHEL
Since the yum install Django works with python2.4, if you want to use python 2.6, you have to manually do it. Get the latest Django, unzip it, and create a symlink from where you unzipped it to /usr/lib64/python2.6/site-packages, which is where python26 is going to look for it
ln -s /where/i/unzipped/Django-1.3.1/django /usr/lib64/python2.6/site-packages/
mod_wsgi, Python 2.6, and RHEL 5
To get mod_wsgi working with python26 on RHEL 5,
yum install python26-mod-python
Then in httpd.conf, instead of
LoadModule wsgi_module modules/mod_wsgi.so
use
LoadModule wsgi_module modules/python26-mod_wsgi.so
elsewhere in httpd.conf, you van have:
WSGIScriptAlias /projbase /var/lib/django/projbase.wsgi
with /var/lib/django/projbase.wsgi
#/var/lib/django/projbase.wsgi
import os
import sys
sys.path = ['/var/www/', '/usr/lib64/python2.6'] + sys.path
from django.core.handlers.wsgi import WSGIHandler
os.environ['DJANGO_SETTINGS_MODULE'] = 'pytest.settings'
application = WSGIHandler()
Mount NFS share in OS X
Create a directory, say in /Users/myusername/Volume_1
su
mkdir /Users/myusername/Volume_1
Then go to dlink nas web administration, and specify:
1) NFS server on
2) Host set as computer IP address, or a range, like 192.168.1.0/9 for 0-9
3) note the Real_path on the NAS
Back in terminal
mount_nfs -P [NAS IP address]:/[Real_path] /Users/myusername/Volume_1
Show memory usage of R objects
To show the sizes of objects in memory (in decreasing order of size):
objectsizes <- sapply(ls(), function(x) {object.size(eval(as.name(x)))})
objectsizes[order(objectsizes, decreasing = TRUE)]
R by command for multiple tables
If you want to summarize a breakdown of counts by various groups in a single data frame:
x <- as.integer(runif(1000)*5)
y <- rep(c("A", "B", "C", "D"), 250)
do.call(rbind, by(x, list(y), function(g) {table(g)}))
results in:
' 0 1 2 3 4
A 54 45 45 51 55
B 52 51 56 42 49
C 60 50 49 43 48
D 51 51 51 50 47
Add new users in apache
Go to the directory where you want htpasswd to be located, as found in the AuthUserFile line in the conf file, e.g. in the file /etc/httpd/conf.d/trac.conf,
AuthUserFile /var/www/trac/htpasswd
then from the command line in that directory (e.g. /var/www/trac/):
htpasswd -c htpasswd admin
to create a new file (“-c”) and the admin account, then
htpasswd htpasswd nextuser
for additional users

