Skip to content

Instantly share code, notes, and snippets.

View calufa's full-sized avatar

Carlos calufa

View GitHub Profile
@calufa
calufa / Delete Solr 3.x Indexes
Last active August 29, 2015 14:01
Delete Solr 3.x Indexes
# http://wiki.apache.org/solr/FAQ#How_can_I_delete_all_documents_from_my_index.3F
# http://wiki.apache.org/solr/UpdateXmlMessages#Updating_a_Data_Record_via_curl
curl http://localhost:8983/solr/some-index/update?commit=true -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>'
@calufa
calufa / How to push changes to github
Last active August 29, 2015 14:01
How to push changes to github
# to add all the changes do
git add ./
# now you need to commit the changes
git commit -am "some text explaining the changes"
# lastly we push the changes to github
git push origin master
curl -X POST -H 'Content-Type: application/json' 'https://key:pass@chloes-shop.myshopify.com/admin/orders.json' -d '{"order": {"line_items": [{"variant_id": 1309367936,"quantity": 1 }]}}'
git fetch --all
git reset --hard origin/master
import time
def parse_log(logger, data):
event = {}
event["msg_title"] = str(time.time())
event["timestamp"] = int(time.time())
event["msg_text"] = str(time.time())
event["alert_type"] = "INFO"
event["event_type"] = "java-collection-1"
{
"id": "f8b41a44e3ce0f6c8ffce5aab5abb73ac5ad042dcb7a6a1210525a4104e8c0f1",
"type": "INFO",
"formattedTime": "16:21:18",
"branch": "master",
"path": "Global.onRequest:23",
"data": "-method: public static play.mvc.Result controllers.Customization.read(int)",
"process": "java -Xms512M -Xmx1536M -Xss1M -XX:ReservedCodeCacheSize=192m -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=512M -Dhttp.netty.maxInitialLineLength=10000000 -Dfile.encoding=UTF-8 -Dplay.version=2.2.6 -Dplay.home=\/root\/play-2.2.6\/framework -Dsbt.boot.properties=\/root\/play-2.2.6\/framework\/sbt\/sbt.boot.properties -Dsbt.scala.version=2.10.3 -jar \/root\/play-2.2.6\/framework\/sbt\/sbt-launch.jar run 7000",
"time": 1464106878257
}
# scala install
wget www.scala-lang.org/files/archive/scala-2.11.7.deb
sudo dpkg -i scala-2.11.7.deb
# sbt installation
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 642AC823
sudo apt-get update
sudo apt-get install sbt
@calufa
calufa / install.sh
Last active June 27, 2016 22:31 — forked from tzi/install.sh
WeasyPrint install on a clean Ubuntu
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
sudo apt-get install libxml2-dev libxslt-dev libffi-dev libcairo2-dev libpango1.0-dev python-dev python-pip
sudo pip install WeasyPrint
04e3837e24d2e2822c6e5d263dec2ca24866474ced4f2cdded46560ff9b6cbf2
1f2293824b1ba4e835ddf9eac68925bc597fc6eaca3927280b24f61be95f1180
5650d96f8e40a56d6908f732ba58056a228686ab68346cd50755b97929a165da
ee43ddb1d9b89a07ba41ae2653c8b8ca53c9a945d5f3f5b120fe700c649de8a0
f28b4aba3e65d5efb6dad0a44206d682a7b9a4e1e670e2ef10eeff1aa881ee5a
99b38b5ed52403301f2d163f378c258df00160261ee08569db246a40beeae01c
9d343fb2038dc273e71e44a483ba2b1d3f955237b0908382f7821e1137a65ab5
171f210d98233b5007678a9c7487fd19ad15644da9dc88e24db76ba833dcf15b
688b0c5d309a4cdab8ecd60b88246315bed029c7b42f5b2374212cc821b983aa
9d6f77c44c63093813ca45c245f31508244f80c3df588ac6a41ab7e67c048627
dogsled
dupl
gofmt
goimports
misspell
nakedret
stylecheck
unconvert
unparam
whitespace