Skip to content

Instantly share code, notes, and snippets.

View dreampuf's full-sized avatar

Dreampuf dreampuf

View GitHub Profile
@dw
dw / step1.sh
Last active September 27, 2017 03:51
Ansiblol
ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/Users/dmw/.ansible/cp/4e8d7ac1b9 u
'/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
@martinwicke
martinwicke / automobile.ipynb
Last active January 9, 2022 08:14
Estimator demo using Automobile dataset
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@abacaphiliac
abacaphiliac / run-kafka-container.md
Last active January 21, 2024 12:10
Run Kafka Container

Start Kafka service

The following commands will start a container with Kafka and Zookeeper running on mapped ports 2181 (Zookeeper) and 9092 (Kafka).

docker pull spotify/kafka
docker run -d -p 2181:2181 -p 9092:9092 --env ADVERTISED_HOST=kafka --env ADVERTISED_PORT=9092 --name kafka spotify/kafka

Why Spotify?

ADVERTISTED_HOST was set to kafka, which will allow other containers to be able to run Producers and Consumers.

@leonardofed
leonardofed / README.md
Last active April 24, 2024 01:47
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@rgl
rgl / nexus-provision.groovy
Last active June 16, 2023 18:59
provision nexus users that can push or deploy to any repository (e.g. NuGet or Maven)
// see https://books.sonatype.com/nexus-book/3.0/reference/scripting.html
// see https://github.com/sonatype/nexus-book-examples/tree/nexus-3.0.x/scripting/nexus-script-example
import groovy.json.JsonOutput
import org.sonatype.nexus.security.user.UserSearchCriteria
import org.sonatype.nexus.security.authc.apikey.ApiKeyStore
import org.sonatype.nexus.security.realm.RealmManager
import org.apache.shiro.subject.SimplePrincipalCollection
import org.sonatype.nexus.scheduling.TaskScheduler
import org.sonatype.nexus.scheduling.schedule.Daily
@valyala
valyala / README.md
Last active April 19, 2024 13:00
Optimizing postgresql table for more than 100K inserts per second

Optimizing postgresql table for more than 100K inserts per second

  • Create UNLOGGED table. This reduces the amount of data written to persistent storage by up to 2x.
  • Set WITH (autovacuum_enabled=false) on the table. This saves CPU time and IO bandwidth on useless vacuuming of the table (since we never DELETE or UPDATE the table).
  • Insert rows with COPY FROM STDIN. This is the fastest possible approach to insert rows into table.
  • Minimize the number of indexes in the table, since they slow down inserts. Usually an index on time timestamp with time zone is enough.
  • Add synchronous_commit = off to postgresql.conf.
  • Use table inheritance for fast removal of old data:
@Jaza
Jaza / Private-pypi-howto
Last active July 2, 2023 16:24
Guide for how to create a (minimal) private PyPI repo, just using Apache with directory autoindex, and pip with an extra index URL.
*
@jpillora
jpillora / sshd.go
Last active December 17, 2023 16:27
Go SSH server complete example - Read more here https://blog.gopheracademy.com/go-and-ssh/
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client:
@esamson
esamson / .gitignore
Last active April 28, 2019 14:56
systemd service file for sonatype nexus. Put this in `$HOME/.config/systemd/user/nexus.service`. Launch with `systemctl --user start nexus`.
default.target.wants/
nexus
@kchida
kchida / gist:d1c15f3968f4f8272c49
Created July 17, 2014 05:06
etcd vs consul vs ???
- What do Etcd, Consul, and Zookeeper do?
- Service Registration:
- Host, port number, and sometimes authentication credentials, protocols, versions
numbers, and/or environment details.
- Service Discovery:
- Ability for client application to query the central registry to learn of service location.
- Consistent and durable general-purpose K/V store across distributed system.
- Some solutions support this better than others.
- Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state.
- Centralized locking can be based on this K/V store.