-
pg_dump is a nifty utility designed to output a series of SQL statements that describes the schema and data of your database. You can control what goes into your backup by using additional flags.
Backup:pg_dump -h localhost -p 5432 -U postgres -d mydb > backup.sql
Restore:
psql -h localhost -p 5432 -U postgres -d mydb < backup.sql
-h is for host.
-p is for port.
-U is for username.
-d is for database.
This file contains 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 | |
# find all supermicro Java iKVM Viewer windows and resize | |
# them to display all the content | |
# | |
# for reasons that are beyond sanity, this shitty closed source program | |
# sets the min and max window sizes to the same values, making it unresizable | |
# through dragging. | |
# this wouldn't be so bad if it actually resized the window to display all | |
# the content. it constantly resizes based on the resolution of the |
This file contains 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
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Description" : "Create a Route53 Fail Whale failover setup from ELB to S3. You need a preexisting ELB, S3 bucket configured as a Website endpoint, and Hosted Zone.", | |
"Parameters" : { | |
"ELBDnsName" : { | |
"Type" : "String", | |
"Description" : "Your ELB's DNS Name" | |
}, |
This file contains 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 sqlalchemy.ext.compiler import compiles | |
from sqlalchemy.dialects import plugins | |
from sqlalchemy.dialects.mysql.json import JSONIndexType, JSONPathType | |
from sqlalchemy.engine import CreateEnginePlugin | |
from sqlalchemy.sql.elements import BinaryExpression | |
from sqlalchemy.sql import sqltypes | |
from sqlalchemy.sql.operators import \ | |
json_getitem_op, \ | |
json_path_getitem_op |
This file contains 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
#include "stdafx.h" | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <openssl/ssl.h> | |
#include <openssl/err.h> | |
#include <uv.h> | |
#define DEFAULT_PORT 7000 | |
#define DEFAULT_BACKLOG 128 |
The Nginx code style asks for a specific alignment of variables declarations that is strainuous to manually enforce:
size_t slen;
uint32_t hash;
ngx_int_t rc;
const u_char *p;
ngx_shm_zone_t *shm_zone;
ngx_slab_pool_t *shpool;
ngx_rbtree_node_t *node, *sentinel;
ngx_ssl_session_t *sess;
This file contains 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/env bash | |
set -euo pipefail | |
help() { | |
cat <<EOF | |
vmctl [COMMAND] [ARGS] | |
Launch firecracker VMs from configuration templates with networks | |
managed by CNI. VM configuration is stored in $VM_CONFIG_DIR | |
and network configuration is stored in $NET_CONFIG_DIR |
UpgradableRWMutex is an enhanced version of the standard sync.RWMutex. It has the all methods sync.RWMutex with exact same semantics. It gives more methods to give upgradable-read feature.
The new semantics for upgradable-read are as follows:
- Multiple goroutines can get read-lock together with a single upgradable-read-lock.
- Only one goroutine can have a write-lock and no read-lock/upgradable-read-lock can be acquired in this state.
OlderNewer