Skip to content

Instantly share code, notes, and snippets.

View tlasica's full-sized avatar

Tomek Łasica tlasica

View GitHub Profile
<?xml version="1.0" encoding="UTF-8" ?>
<!--
=======
Copyright DataStax, Inc.
Please see the included license file for details.
-->
<!--
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@tlasica
tlasica / dse-4.8.11-solrconfig.xml
Created October 24, 2016 15:57
DSE 4.8.11 solrconfig.xml file for NRT
<?xml version="1.0" encoding="UTF-8" ?>
<!--
=======
Copyright DataStax, Inc.
Please see the included license file for details.
-->
<!--
<?xml version="1.0" encoding="UTF-8" ?>
<!--
=======
Copyright DataStax, Inc.
Please see the included license file for details.
-->
<!--
@tlasica
tlasica / photo-enhance.sh
Created September 25, 2016 15:48
enhance photos using imagemagick
mkdir enhanced
for sp in *.jpg; do
echo "Converting Image: $sp"
convert -auto-gamma -auto-level -normalize $sp "enhanced/$sp"
done
# from http://superuser.com/questions/370920/auto-image-enhance-for-ubuntu
@tlasica
tlasica / dse-gclogs.sh
Created February 17, 2016 00:53
Script to enable/disable gc
COMMAND=$1
FILE=$DSE_CASS_CONFIG_HOME/jvm.options
OPTIONS=(
'-XX:+PrintGCDetails'
'-XX:+PrintGCDateStamps'
'-XX:+PrintHeapAtGC'
'-XX:+PrintTenuringDistribution'
'-XX:+PrintGCApplicationStoppedTime'
@tlasica
tlasica / SleepTimer.py
Created December 14, 2015 19:25
SleepTimer in python, not to sleep to long
class SleepTimer(object):
"""
timer = SleepTime(10)
do_something_for_3_sec()
timer.sleep() # will sleep 7
"""
def __init__(self, how_long):
self.how_long = how_long
self.start_time = datetime.datetime.now()
self.i_have_slept = False
```
class Foo(object):
def __init__(self):
self._init_variables()
def _init_variables(seld):
self._x = 4
```
@tlasica
tlasica / install cassandra-driver 3.0 rc1
Created November 13, 2015 17:59
Install cassandra-driver 3.0.0 rc
export DRIVER_FILE=3.0.0rc1.tar.gz
export DRIVER_DIR=python-driver-3.0.0rc1
sudo pip uninstall cassandra-driver -y
wget https://github.com/datastax/python-driver/archive/$DRIVER_FILE
tar xzf $DRIVER_FILE
cd $DRIVER_DIR
sudo python setup.py install --no-extensions