Skip to content

Instantly share code, notes, and snippets.

View fthzkrtn's full-sized avatar
🎯
Focusing

fthzkrtn

🎯
Focusing
View GitHub Profile
@fthzkrtn
fthzkrtn / tmux-cheatsheet.markdown
Created October 2, 2015 11:30 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
#!/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"`
@fthzkrtn
fthzkrtn / CouchDriver.py
Created May 30, 2013 15:21
An OOP CouchDB implementation class to save, select, update and remove doc. It is a methodological implementation since I need to write it in my bigger and multi-database dependent project. Wish you enjoy it.
# coding=utf-8
"""
Copyright 2013 Fatih Karatana.
Licensed 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
@fthzkrtn
fthzkrtn / thrift_es.py
Last active December 17, 2015 21:59
A Thrift interface to insert indexes into Elasticsearch with Python client Pyes
#!/usr/bin/python
# coding=utf-8
"""
* A sample to implement index performance ES with Thrift and Pyes
* Copyright (C) 2013 Fatih Karatana
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
@fthzkrtn
fthzkrtn / nav-scroller.js
Last active December 17, 2015 21:49
A simple navigation moving through page scrolling.
/**
* A simple movement script to create a simple attractive navigation
* Copyright (C) 2013 Fatih Karatana
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@fthzkrtn
fthzkrtn / jquery.spin.js
Created August 24, 2012 12:22 — forked from innotekservices/jquery.spin.js
jQuery Plugin for Spin.js
/*
You can now create a spinner using any of the variants below:
$("#el").spin(); // Produces default Spinner using the text color of #el.
$("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el.
$("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color).
$("#el").spin({ ... }); // Produces a Spinner using your custom settings.
$("#el").spin(false); // Kills the spinner.