Skip to content

Instantly share code, notes, and snippets.

View melekhine's full-sized avatar

Igor A. Melekhine melekhine

View GitHub Profile
@melekhine
melekhine / main.go
Last active November 22, 2021 19:45
Write lines to a text file
package main
import (
"fmt"
"os"
)
// Sentence will be wrote as line in file
type Sentence string
@melekhine
melekhine / golangci.yaml
Last active November 12, 2021 07:30 — forked from cristaloleg/golangci.yaml
golangci-lint config (work from box version)
---
linters:
disable:
- cyclop
- depguard
- dogsled
- dupl
- errname
- errorlint
- exhaustivestruct
@melekhine
melekhine / nginx-tls.conf
Last active December 20, 2020 02:27 — forked from gavinhungry/nginx-tls.conf
Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating, for 2020
#
# Name: nginx-tls.conf
# Auth: Igor A. Melekhine <igor.melekhine@constssk.com>
# Auth: Gavin Lloyd <gavinhungry@gmail.com>
# Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Enables HTTP/2, PFS, HSTS and OCSP stapling. Configuration options not related
# to SSL/TLS are omitted here.
#
# Example: https://www.ssllabs.com/ssltest/analyze.html?d=constssk.com
@melekhine
melekhine / search.go
Last active March 14, 2020 17:37
Count words on webpages. Usage: echo http://golang.org | go run search.go
package main
import (
"bufio"
"bytes"
"fmt"
"io"
"net/http"
"net/url"
"os"
@melekhine
melekhine / osxpdf.md
Created February 14, 2020 16:17
OSX PDF operations

Merge pdf by Quartz

/System/Library/Automator/Combine\ PDF\ Pages.action/Contents/Resources/join.py --output all.pdf *.pdf

Compress PDF via GostScript

gs -q -dNOPAUSE -dBATCH -dSAFER -dPDFA=2 -dPDFACompatibilityPolicy=1 -dSimulateOverprint=true -sDEVICE=pdfwrite -dCompatibilityLevel=1.3 -dPDFSETTINGS=/screen -dEmbedAllFonts=true -dSubsetFonts=true -dAutoRotatePages=/None -dColorImageDownsampleType=/Bicubic -dColorImageResolution=150 -dGrayImageDownsampleType=/Bicubic -dGrayImageResolution=150 -dMonoImageDownsampleType=/Bicubic -dMonoImageResolution=15 -sOutputFile=./output.pdf ./input.pdf

@melekhine
melekhine / pdfopt.sh
Created February 28, 2019 11:46
pdf optimisation
gs -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -dPDFSETTINGS=/-"screen" -dCompatibilityLevel=1.4 -sOutputFile="mel.pdf" "mel.pdf"
@melekhine
melekhine / docker-cleanup.sh
Created September 22, 2016 00:13
Docker: Remove all images and containers
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)

Keybase proof

I hereby claim:

  • I am awsom82 on github.
  • I am awsom82 (https://keybase.io/awsom82) on keybase.
  • I have a public key whose fingerprint is 2B59 BDCD D826 5395 D43C D669 1795 4546 78EE E96F

To claim this, I am signing this object: