I've been trying to understand how to setup systems from
the ground up on Ubuntu. I just installed redis
onto
the box and here's how I did it and some things to look
out for.
To install:
storage: | |
dbPath: "./data" | |
directoryPerDB: true | |
journal: | |
enabled: true | |
engine: "wiredTiger" | |
wiredTiger: | |
engineConfig: | |
cacheSizeGB: 8 | |
journalCompressor: zlib |
mongo --quiet --eval 'db.getMongo().getDBNames().forEach(function(i){db.getSiblingDB(i).dropDatabase()})' |
#!/usr/bin/env sh | |
# checks to see if running | |
launchctl list | grep mongo | |
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist | |
launchctl remove homebrew.mxcl.mongodb | |
pkill -f mongod |
// mongoose 4.3.x | |
var mongoose = require('mongoose'); | |
/* | |
* Mongoose by default sets the auto_reconnect option to true. | |
* We recommend setting socket options at both the server and replica set level. | |
* We recommend a 30 second connection timeout because it allows for | |
* plenty of time in most operating environments. | |
*/ | |
var options = { server: { socketOptions: { keepAlive: 1, connectTimeoutMS: 30000 } }, |
#!/bin/sh | |
# fix permissions (wrong if docker mounted volume) | |
chown -R elasticsearch:elasticsearch /var/lib/elasticsearch | |
# now switch to elasticsearch user and run in foreground | |
echo Starting: /usr/share/elasticsearch/bin/elasticsearch -Des.default.config=$CONF_FILE -Des.default.path.home=/usr/share/elasticsearch -Des.default.path.logs=$LOG_DIR -Des.default.path.data=/var/lib/elasticsearch -Des.default.path.work=/tmp/elasticsearch -Des.default.path.conf=$CONF_DIR $@ | |
su elasticsearch -s /bin/sh -c "/usr/share/elasticsearch/bin/elasticsearch -Des.default.config=$CONF_FILE -Des.default.path.home=/usr/share/elasticsearch -Des.default.path.logs=$LOG_DIR -Des.default.path.data=/var/lib/elasticsearch -Des.default.path.work=/tmp/elasticsearch -Des.default.path.conf=$CONF_DIR $@" |
String.prototype.rot13 = function(){ | |
return this.replace(/[a-zA-Z]/g, function(c){ | |
return String.fromCharCode((c <= "Z" ? 90 : 122) >= (c = c.charCodeAt(0) + 13) ? c : c - 26); | |
}); | |
}; |
cd ~ | |
##If you want to install OpenJDK | |
#sudo apt-get update | |
#sudo apt-get install openjdk-8-jre-headless -y | |
###Or if you want to install Oracle JDK, which seems to have slightly better performance | |
sudo add-apt-repository ppa:webupd8team/java | |
sudo apt-get update | |
sudo apt-get install oracle-java8-installer |
#include <unistd.h> | |
#include <mach/mach.h> | |
#include <mach/mach_vm.h> | |
#include <mach-o/dyld.h> | |
int | |
main (int argc, char * argv[]) | |
{ | |
volatile char * library; | |
const mach_vm_size_t page_size = getpagesize (); |
#!/bin/sh | |
# | |
# chkconfig: 35 99 99 | |
# description: Node.js app server script | |
# | |
. /etc/rc.d/init.d/functions | |
USER="root" |