Skip to content

Instantly share code, notes, and snippets.

@syberkitten
syberkitten / gist:7d3a1a045c82b2b62ea25382f551facf
Last active June 13, 2023 07:15
Simple Pyenv Usage: Setting Up a Pyenv Virtual Environment with Python and Virtualenv
# Setting Up a Pyenv Virtual Environment with Python 3.10.11
Follow the instructions below to set up a new virtual environment, named "privategpt", utilizing Python 3.10.11 via Pyenv.
## 1. Installing Python 3.10.11 with Pyenv
Enter the command below to install Python 3.10:
```bash
pyenv install 3.10.11
@syberkitten
syberkitten / gist:f3c961d64896106e2a2b
Created December 4, 2014 14:18
ElasticSearch basic Curl API calls
get specific document:
curl -XGET 'http://localhost:9200/php_logging/flv_pl/1'
get specific document:
curl -XGET 'http://localhost:9200/php_logging/flv_pl'
get documents:
curl http://localhost:9200/php_logging/_search?pretty=true&q=*:*
@syberkitten
syberkitten / gist:d22b3579357fce376686
Last active August 29, 2015 14:02
Unescape function - TSSCRIPT
function binary.pow(number,power)
{
local i,base;
if(power==0)
{
number=1;
}
else
{
base=number;
@syberkitten
syberkitten / gist:db7920a80fa898df1cc5
Last active August 29, 2015 14:02
Install Tornado server on CentOS 6 (after you have python installed)
pip install tornado
pip install gevent
pip install requests
pip install raven
tail both tornado files:
@syberkitten
syberkitten / gist:29184ae2c394a62fdf59
Last active August 29, 2015 14:02
Install Python 2.7.x on centOS 6.2 (which has Native 2.6.x)
add development tools:
yum groupinstall "Development tools"
more libraries:
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-deve
get python (might get other version):
wget http://python.org/ftp/python/2.7.7/Python-2.7.7.tar.xz
extract:
var net = require('net');
var clients = [];
net.createServer(function (socket) {
clients.push(socket);
socket.on('data', function (data) {
broadcast(data, socket);
});