| Command | |
|---|---|
| start new | tmux |
| start new with session name | tmux new -s myname |
| attach | tmux a # (or at, or attach) |
| attach to named: | tmux a -t myname |
| list sessions | tmux ls |
Using JSON in Postgres by examples. The beuaty to be some schema-less over a schema-full database and still be as fast as a NoSQL document based database.
- Download and install: Docker Toolbox
- Open Docker Quickstart Terminal
- Start a new postgres container:
docker run --name my-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Siraj Guide | |
| # Learn_Blockchain_in_2_months | |
| This is the code for "Learn Blockchain in 2 Months" by Siraj Raval on Youtube | |
| ## Overview | |
| This is the code for [this]() video on Youtube by Siraj Raval on Learning Blockchain in 2 Months. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| In some cases that your HDFS fails and you need to recreate the OpenTSDB schema on HBase. To remove the tables use the commands below. | |
| ``` | |
| root@hb-node4:/# hbase zkcli | |
| ls /hbase | |
| [replication, meta-region-server, rs, splitWAL, backup-masters, table-lock, flush-table-proc, region-in-transition, online-snapshot, master, running, recovering-regions, draining, namespace, hbaseid, table] | |
| rmr /hbase/table/tsdb | |
| rmr /hbase/table/tsdb-uid | |
| rmr /hbase/table/tsdb-meta | |
| rmr /hbase/table/tsdb-tree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd /home/tim/VirtualBox\ VMs/ | |
| mv proxydev2_1351794515 tmp | |
| mkdir proxydev2_1351794515 | |
| sudo mount -t tmpfs -o size=10G tmpfs /home/tim/VirtualBox\ VMs/proxydev2_1351794515 | |
| cp -a tmp/* proxydev2_1351794515/ | |
| # go back to vagrant directory and `vagrant up` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from Crypto.Cipher import AES | |
| import base64 | |
| import os | |
| # the block size for the cipher object; must be 16, 24, or 32 for AES | |
| BLOCK_SIZE = 32 | |
| # the character used for padding--with a block cipher such as AES, the value | |
| # you encrypt must be a multiple of BLOCK_SIZE in length. This character is | |
| # used to ensure that your value is always a multiple of BLOCK_SIZE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # https://httpd.apache.org/docs/2.2/misc/password_encryptions.html | |
| HTPASSWD=$1 | |
| USERNAME=$2 | |
| PASSWORD=$3 | |
| ENTRY=`cat $HTPASSWD | grep "^$USERNAME:"` | |
| HASH=`echo $ENTRY | cut -f 2 -d :` | |
| SALT=`echo $HASH | cut -f 3 -d $` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Async Tornado S3 uploader with AWS4 sign. | |
| https://gist.github.com/stalkerg/63bad3ea49be6268df49 | |
| Edited by @nanvel 2015-07-24 | |
| Usage example: | |
| .. code-block:: python |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| # Copyright 2011-2013 Everything.me. All rights reserved. | |
| # | |
| # Redistribution and use in source and binary forms, with or without modification, are | |
| # permitted provided that the following conditions are met: | |
| # | |
| # 1. Redistributions of source code must retain the above copyright notice, this list of | |
| # conditions and the following disclaimer. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import hashlib, hmac, mimetypes, os, time | |
| from base64 import b64encode, b64decode | |
| from calendar import timegm | |
| from datetime import datetime | |
| from email.utils import formatdate | |
| from urllib import quote | |
| from tornado.gen import coroutine, Return | |
| from tornado.httpclient import AsyncHTTPClient, HTTPError |
NewerOlder