Skip to content

Instantly share code, notes, and snippets.

View yriveiro's full-sized avatar
🧙‍♀️
Practicioner of Arcane and Forgotten Sorcery

Yago Riveiro yriveiro

🧙‍♀️
Practicioner of Arcane and Forgotten Sorcery
View GitHub Profile
@yriveiro
yriveiro / gist:7030222
Created October 17, 2013 18:51
Script to post json data to solr.
#!/bin/bash
for f in *.ready
do
status=$(curl --write-out %{http_code} --silent --output /dev/null http://192.168.20.101:8983/solr/statistics-$1/update? --data-binary @$f -H 'Content-type:application/json')
if [ $status -eq 200 ]
then
echo "Removing file $f"
rm -f $f
org.apache.solr.handler.ReplicationHandler$DirectoryFileStream; Exception while writing response for params: file=_h5kd.si&command=filecontent&checksum=true&wt=filestream&qt=/replication&generation=67128
java.io.FileNotFoundException: /ssd/solr/solrcloud-node/collections/collection-13_shard11_replica2/data/index.20131013191448349/_h5kd.si (No such file or directory)

Solr.xml is broken?

Notice: This test was done with a fresh install of Solr either 4.4 or 4.5.

Solr 4.4

Create a collection

import functools
class Foo(object):
def _cache(func):
@wraps(func)
def _cache_decorator(self, *args, **kwargs):
# Do stuff here
return func(self, *args, **kwargs)
return _cache_decorator
import socket
if __name__ == "__main__":
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(("localhost", 9000))
data = "some data"
sock.sendall(data)
result = sock.recv(1024)
print result
sock.close()
@yriveiro
yriveiro / Linux Static IP
Created November 6, 2012 11:09 — forked from fernandoaleman/Linux Static IP
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static