Skip to content

Instantly share code, notes, and snippets.

View prashanthpai's full-sized avatar

Prashanth Pai prashanthpai

  • CodeRabbit
View GitHub Profile
@spikebike
spikebike / client.go
Created March 29, 2012 01:13
TLS server and client
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)
@jordanorelli
jordanorelli / client.go
Created May 7, 2012 17:16
rpc server example in go
package main
import (
"bufio"
"log"
"net/rpc"
"os"
)
func main() {
@portante
portante / TableOfSwiftObjServerAPIMarshalling.txt
Last active December 17, 2015 08:18
Table of actions taken in Swift swift/obj/server.py module for the ObjectController for all HTTP methods. Each action is representative of the steps taken to validate a request up to the point where a DiskFile object is instantiated.
Operations | POST | PUT | GET | HEAD | DELETE | REPLICATE
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
split_path | split_path | split_path | split_path | split_path | split_path
validate_device_partition | validate_device_partition | validate_device_partition | validate_device_partition | validate_device_partition | validate_device_partition
X-timestamp check | X-timestamp check | | | X-timestamp check |
| check_object_creation | | | |
Delete-at check
@portante
portante / TableOfSwiftObjServerParameterUsage.txt
Last active December 17, 2015 09:18
Table of Swift Object Server parameter usage for device, partition, account, container and obj values. It does not include the device/partition validation code.
Parameter
Operations | POST | PUT | GET | HEAD | DELETE | REPLICATE
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
device | mount_check | mount_check | mount_check | mount_check | mount_check | mount_check
| DiskFile | DiskFile | DiskFile | DiskFile | DiskFile |
| | Log-transfer-rate | | | |
| delete_at_update | delete_at_update | | | delete_at_update |
| | contain
@willurd
willurd / web-servers.md
Last active May 25, 2026 16:38
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@jhass
jhass / dump_socket.sh
Last active June 11, 2024 13:15
Capture unix socket to pcap file with socat and tshark
#!/bin/bash
# Parameters
socket="/run/foo.sock"
dump="/tmp/capture.pcap"
# Extract repetition
port=9876
source_socket="$(dirname "${socket}")/$(basename "${socket}").orig"
@audreyfeldroy
audreyfeldroy / pypi-release-checklist.md
Last active April 9, 2026 05:34
My PyPI Release Checklist
  • Update HISTORY.md
  • Commit the changes:
git add HISTORY.md
git commit -m "Changelog for upcoming release 0.1.1."
  • Update version number (can also be minor or major)
bumpversion patch
package main
// Restorer holds a function that can be used
// to restore some previous state.
type Restorer func()
// Restore restores some previous state.
func (r Restorer) Restore() {
r()
}
@denji
denji / golang-tls.md
Last active April 14, 2026 13:12 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@vmarmol
vmarmol / client.go
Created February 9, 2015 23:21
Simple Go-based HTTP streaming via HTTP and websockets.
package main
import (
"encoding/json"
"flag"
"io"
"net/http"
"github.com/golang/glog"
"golang.org/x/net/websocket"