Skip to content

Instantly share code, notes, and snippets.

View artickl's full-sized avatar
:octocat:
Never say never!

Artem Zavyalov artickl

:octocat:
Never say never!
View GitHub Profile
@artickl
artickl / pdf-to-gray.sh
Last active August 19, 2024 15:56
PDF Gray Scale Size reduction (~6.5Mb to 0.8Mb)
# https://superuser.com/questions/104656/convert-a-pdf-to-greyscale-on-the-command-line-in-floss/164857#164857
gs \
-sOutputFile=output.pdf \
-sDEVICE=pdfwrite \
-sColorConversionStrategy=Gray \
-dProcessColorModel=/DeviceGray \
-dCompatibilityLevel=1.4 \
-dNOPAUSE \
-dBATCH \
@artickl
artickl / nginx-sites-available-ip
Created March 13, 2024 19:06
NGINX My IP Page
# simple way to show public IP address of the client
# anyone can access it in the browser (like https://ip.example.com)
# or can be used in some scripting (like "curl ip.example.com")
# simply on NGINX functionality without any kind of additional tools or plugins
# just place this nginx config to /etc/nginx/sites-available/ip
# make a link in /etc/nginx/sites-enabled/ ($ ln /etc/nginx/sites-available/ip)
# reload nginx ($ service nginx reload)
server {
@artickl
artickl / web-servers.md
Created September 16, 2021 18:04 — forked from willurd/web-servers.md
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
@artickl
artickl / server.py
Created March 24, 2021 22:36 — forked from mdonkers/server.py
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
import logging
class S(BaseHTTPRequestHandler):
@artickl
artickl / face_recognition_extension.py
Last active August 13, 2020 07:17 — forked from rachelhs/face_recognition_extension.py
face recognition extension
#based on https://towardsdatascience.com/a-beginners-guide-to-building-your-own-face-recognition-system-to-creep-out-your-friends-df3f4c471d55
##install:
# pip3 install cmake
# pip3 install face_recognition
# or pip3 install boost & pip --no-cache-dir install face_recognition
# pip3 install numpy
# pip3 install dlib
# pip3 install opencv-python
##