Skip to content

Instantly share code, notes, and snippets.

View avkosme's full-sized avatar
👨‍💻
in k8s clouds

Andrei Kostiuchenko avkosme

👨‍💻
in k8s clouds
View GitHub Profile
openssl s_client -showcerts -connect server.edu:443 </dev/null 2>/dev/null|openssl x509 -outform PEM >mycertfile.pem
# For big dumps:
mysqldump -h <host> -u <user> -p --net_buffer_length=1M --quick <database> <table> > <dump>.sql
@avkosme
avkosme / split-copy.py
Created January 12, 2019 06:49
Copy files split a folder by size
import os
import subprocess
from shutil import copyfile
def main():
src = '/tmp/src'
dest = '/tmp/dest'
size_dir = 190
nmap --script ssl-enum-ciphers -p 443 example.org
$ git rm --cached giant_file
# Stage our giant file for removal, but leave it on disk
Commit this change using --amend -CHEAD:
$ git commit --amend -CHEAD
# Amend the previous commit with your change
# Simply making a new commit won't work, as you need
# to remove the file from the unpushed history as well
set -a; source ~/example.env; set +a
$ dig @resolver1.opendns.com ANY myip.opendns.com +short
curl -s http://whatismyip.akamai.com/
# local_settings.py
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': '/tmp/debug.log',
@avkosme
avkosme / ssh permissions key
Created September 25, 2019 07:52
ssh permissions key
chmod 700 ~/.ssh
chmod 600 ~/.ssh/*
docker-compose -f docker-compose-test.yml run --rm --service-ports --use-aliases app