Skip to content

Instantly share code, notes, and snippets.

@naryad
naryad / local-replica-set-with-oplog.md
Created May 3, 2020 12:24 — forked from richsilv/local-replica-set-with-oplog.md
Setting up a local MongoDB replica set with oplog for use with Meteor

From an appropriate location:

mkdir replica-set
mkdir -p replica-set/rs0-0 replica-set/rs0-1
mongod --port 27018 --dbpath replica-set/rs0-0 --replSet rs0 --smallfiles --oplogSize 128 &
mongod --port 27019 --dbpath replica-set/rs0-1 --replSet rs0 --smallfiles --oplogSize 128 &
mongo localhost:27018
from selenium import webdriver
from getpass import getpass
def login_twitter(username, password):
driver = webdriver.Firefox()
driver.get("https://twitter.com/login")
username_field = driver.find_element_by_class_name("js-username-field")
password_field = driver.find_element_by_class_name("js-password-field")
##################################################################
# /etc/elasticsearch/elasticsearch.yml
#
# Base configuration for a write heavy cluster
#
# Cluster / Node Basics
cluster.name: logng
# Node can have abritrary attributes we can use for routing
@naryad
naryad / backup.sh
Created August 25, 2014 07:32 — forked from nherment/backup.sh
#!/bin/bash
# herein we backup our indexes! this script should run at like 6pm or something, after logstash
# rotates to a new ES index and theres no new data coming in to the old one. we grab metadatas,
# compress the data files, create a restore script, and push it all up to S3.
TODAY=`date +"%Y.%m.%d"`
INDEXNAME="logstash-$TODAY" # this had better match the index name in ES
INDEXDIR="/usr/local/elasticsearch/data/logstash/nodes/0/indices/"
BACKUPCMD="/usr/local/backupTools/s3cmd --config=/usr/local/backupTools/s3cfg put"
BACKUPDIR="/mnt/es-backups/"
YEARMONTH=`date +"%Y-%m"`
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.1.deb
sudo dpkg -i elasticsearch-1.1.1.deb
{
"name": "socket.io.1.0",
"version": "1.0.0",
"description": "Socket.IO 1.0 using Primus",
"main": "socket.io.1.0.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
#!/bin/bash -e
# Neil Williams, reddit
# configuration that doesn't change much
REDDIT_REPO=git://github.com/reddit/reddit.git
I18N_REPO=git://github.com/reddit/reddit-i18n.git
APTITUDE_OPTIONS="-y" # limit bandwidth: -o Acquire::http::Dl-Limit=100"
# don't blunder on if an error occurs
set -e