Skip to content

Instantly share code, notes, and snippets.

View MaximShepelev's full-sized avatar

Maxim Shepelev MaximShepelev

  • Bostongene
  • A galaxy far far away
View GitHub Profile
@Kartones
Kartones / postgres-cheatsheet.md
Last active June 26, 2024 18:01
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@StefanWallin
StefanWallin / README.md
Last active January 15, 2022 06:22 — forked from konklone/ssl.rules
nginx ssl config with multiple SNI vhosts and A+ SSL Labs score as of 2014-11-05

Configuring nginx for SSL SNI vhosts

Gotchas

Remarks

  • My version of konklones SSL config does not have SPDY support(my nginx+openssl does not support it)
  • You need a default ssl server (example.org-default.conf).
  • Some SSL-options have to be unique across your instance, so it's easier to have them in a common file(ssl.conf).
@DominikSerafin
DominikSerafin / 01PostgreSQLSnippets.md
Last active November 10, 2021 18:37
PostgreSQL Snippets
@igorcosta
igorcosta / elastic_cheat_sheet.md
Created January 6, 2017 00:42 — forked from quantizor/elastic_cheat_sheet.md
Elastic Cheat Sheet
@heiswayi
heiswayi / repo-reset.md
Created February 5, 2017 01:32
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active June 26, 2024 18:43
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@andyvanee
andyvanee / .ssh_config
Last active November 30, 2023 04:19
Fix unix_listener too long for Unix domain socket
Host *
ControlPath ~/.ssh/control/%C
ControlMaster auto
@grimzy
grimzy / git-pull-all
Created September 15, 2017 02:15
Git pull all remote branches
#!/usr/bin/env bash
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
@paraita
paraita / squid.ssl.conf
Last active November 10, 2021 16:40
Squid 3.5.0.4 http+https basic auth + ssl bump
# #### pre-requisites ####
# I use the following Dockerfile for Squid:
# https://hub.docker.com/r/jamesyale/squid-sslbump/ to deploy the proxy
# Replace the existing /etc/squid/squid.ssl.conf with this file
# Create the users credentials with htpasswd (yum install httpd-tools)
# htpasswd [-c] /etc/squid/squidusers username
# -с is to create a new file, not to change the existing file
# Use the following command to test the user/pass:
# /usr/lib64/squid3/basic_ncsa_auth /etc/squid/squidusers
# provide <user> <password> at the prompt, for example:
@bgauduch
bgauduch / multiple-repository-and-identities-git-configuration.md
Last active June 25, 2024 13:22
Git config with multiple identities and multiple repositories

Setup multiple git identities & git user informations

/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine 😉

Setup multiple git ssh identities for git

  • Generate your SSH keys as per your git provider documentation.
  • Add each public SSH keys to your git providers acounts.
  • In your ~/.ssh/config, set each ssh key for each repository as in this exemple: