Skip to content

Instantly share code, notes, and snippets.

View malex984's full-sized avatar
😎
looking forward to my new job

Oleksandr Motsak malex984

😎
looking forward to my new job
View GitHub Profile
@malex984
malex984 / install_cygwin_sshd.txt
Created May 27, 2021 19:28 — forked from roxlu/install_cygwin_sshd.txt
Installing CYGWIN + SSHD for remote access through SSH on windows
Installing CYGWIN with SSH
1) Download cygwin setup.exe from http://www.cygwin.com
- Execute setup.exe
- Install from internet
- Root directory: `c:\cygwin` + all users
- Local package directory: use default value
- Select a mirror to download files from
- Select these packages:
- editors > xemacs 21.4.22-1
- net > openssh 6.1-p
@malex984
malex984 / git-deployment.md
Created January 28, 2021 11:17 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@malex984
malex984 / cpp_links.txt
Last active September 3, 2020 21:06
some c++ links
@malex984
malex984 / clean_code.md
Created August 25, 2020 19:13 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@malex984
malex984 / www.sh
Last active August 25, 2020 11:27
run a simple HTTP server using python 2 or 3 via command line using bash script
#!/bin/bash
### purpose: run simple HTTP server in both Python2 and Python3
### note: set PYTHON and ARGS environment variables for control the behaviour
export PORT=${PORT:-8000} # open http://localhost:8000/
export ARGS=${ARGS:-${PORT}}
export PYTHON=${PYTHON:-python}
echo "Running HTTP Server via [${PYTHON}]: "
${PYTHON} -VV -V --version || exit $?
@malex984
malex984 / UDPSocket.cs
Created November 8, 2019 18:25 — forked from darkguy2008/UDPSocket.cs
Simple C# UDP server/client in 56 lines
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace UDP
{
public class UDPSocket
{
private Socket _socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
@malex984
malex984 / sample_app.py
Created April 23, 2019 20:21
Sample module / application
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# encoding: utf-8
# coding: utf-8
"""
Sample cli application
"""
@malex984
malex984 / multiple-deploy-keys-multiple-private-repos-github-ssh-config.md
Created December 15, 2018 16:52 — forked from gubatron/multiple-deploy-keys-multiple-private-repos-github-ssh-config.md
How to configure multiple deploy keys for different private github repositories on the same computer without using ssh-agent

Let's say alice is a github.com user, with 2 or more private repositories repoN. For this example we'll work with just two repositories named repo1 and repo2

https://github.com/alice/repo1

https://github.com/alice/repo2

You need to be to pull from these repositories without entering a passwords probably on a server, or on multiple servers. You want to perform git pull origin master for example, and you want this to happen without asking for a password.

@malex984
malex984 / humble_bundle_download.py
Created February 19, 2018 11:18 — forked from achidlow/humble_bundle_download.py
Download all the books in a humble bundle.
"""
Script to download all the books in a humble bundle.
May work for other resources, but don't have anything to test against.
To use, run from the directory you want to download the books in.
Pass the "game" key as the first argument (look in the URL of your normal download page).
To restrict to certain formats, pass them as extra positional arguments on the command line.
Example:
python humble_bundle_download abcdef12345 mobi pdf
@malex984
malex984 / humble_bundle_file_downloader.js
Created February 19, 2018 11:13 — forked from tlc/humble_bundle_file_downloader.js
Download HumbleBundle book bundles easier. Puts 'curl' statements on the page for you to copy.
/* 11/27/2017 - Tweaked for a page redesign.
* 1/6/2018 - Handle videos in book bundle.
*/
var pattern = /(MOBI|EPUB|PDF( ?\(H.\))?|CBZ)$/i;
var pattern2 = /(Download)$/;
var nodes = document.getElementsByTagName('a');
var downloadCmd = '';
for (i in nodes) {
var a = nodes[i];
if (a && a.text && pattern.test(a.text.trim())) {