(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:
| #!/bin/bash | |
| # | |
| # PostgreSQL Backup Script Ver 1.0 | |
| # http://autopgsqlbackup.frozenpc.net | |
| # Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com> | |
| # | |
| # This script is based of the AutoMySQLBackup Script Ver 2.2 | |
| # It can be found at http://sourceforge.net/projects/automysqlbackup/ | |
| # | |
| # The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9 |
| #!/bin/bash | |
| # Might as well ask for password up-front, right? | |
| sudo -v | |
| # Keep-alive: update existing sudo time stamp if set, otherwise do nothing. | |
| while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & | |
| # Example: do stuff over the next 30+ mins that requires sudo here or there. | |
| function wait() { |
| ifdef VERBOSE | |
| Q = | |
| E = @true | |
| else | |
| Q = @ | |
| E = @echo | |
| endif | |
| CFILES := $(shell find src -mindepth 1 -maxdepth 4 -name "*.c") | |
| CXXFILES := $(shell find src -mindepth 1 -maxdepth 4 -name "*.cpp") |
| ========================================== ========================================== | |
| TMUX COMMAND WINDOW (TAB) | |
| ========================================== ========================================== | |
| List tmux ls List ^b w | |
| New new -s <session> Create ^b c | |
| Attach att -t <session> Rename ^b , <name> | |
| Rename rename-session -t <old> <new> Last ^b l (lower-L) | |
| Kill kill-session -t <session> Close ^b & |
| def rolling_window(array, window=(0,), asteps=None, wsteps=None, axes=None, toend=True): | |
| """Create a view of `array` which for every point gives the n-dimensional | |
| neighbourhood of size window. New dimensions are added at the end of | |
| `array` or after the corresponding original dimension. | |
| Parameters | |
| ---------- | |
| array : array_like | |
| Array to which the rolling window is applied. | |
| window : int or tuple |
| /Library/PostgreSQL/9.1/bin/pg_dump --host localhost --port 5432 --username <USERNAME> -b -c -E UTF-8 --no-owner --no-privileges --no-tablespaces --clean --schema public -F c -Z 9 -f <BACKUPFILENAME> <DATABASENAME> | |
| /Library/PostgreSQL/9.1/bin/pg_restore --host localhost --port 5432 --username <USERNAME> --dbname <DATABASENAME> --no-owner --no-privileges --no-tablespaces --clean --schema public "<BACKUPFILENAME>" |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <stdlib.h> | |
| #include <pthread.h> | |
| #include <unistd.h> | |
| #include <semaphore.h> | |
| sem_t semaphore; | |
| void threadfunc() { |
| #!/usr/bin/python | |
| # | |
| # K-means clustering using Lloyd's algorithm in pure Python. | |
| # Written by Lars Buitinck. This code is in the public domain. | |
| # | |
| # The main program runs the clustering algorithm on a bunch of text documents | |
| # specified as command-line arguments. These documents are first converted to | |
| # sparse vectors, represented as lists of (index, value) pairs. | |
| from collections import defaultdict |