Skip to content

Instantly share code, notes, and snippets.

View ihor-lev's full-sized avatar
😎

Ihor Kysylevych ihor-lev

😎
View GitHub Profile
@ihor-lev
ihor-lev / Dockerfile
Created December 14, 2022 10:02 — forked from feltnerm/Dockerfile
Docker + MySQL + `lower_case_table_names=1`
FROM mysql
ADD my.cnf /etc/mysql/my.cnf
CMD ["mysqld", "--datadir=/var/lib/mysql", "--user=mysql"]
@ihor-lev
ihor-lev / network-tuning.conf
Created November 7, 2022 12:39 — forked from pensierinmusica/network-tuning.conf
Linux sysctl configuration file for NginX
## Place this file in "/etc/sysctl.d/network-tuning.conf" and
## run "sysctl -p" to have the kernel pick the new settings up
# Avoid a smurf attack
net.ipv4.icmp_echo_ignore_broadcasts = 1
# Turn on protection for bad icmp error messages
net.ipv4.icmp_ignore_bogus_error_responses = 1
# Turn on syncookies for SYN flood attack protection
@ihor-lev
ihor-lev / generate-mongo-tls.md
Last active November 2, 2022 12:27 — forked from achesco/generate-mongo-ssl.md
Generate self-signed SSL certificates for MongoDb server and client

Notes

  • CNs are important
  • -days 3650
  • SSL is deprecated in MongoDB in favour of TLS

Make PEM containig a public key certificate and its associated private key

openssl req -newkey rsa:2048 -new -x509 -days 3650 -nodes -subj '/C=US/ST=Massachusetts/L=Bedford/O=Personal/OU=Personal/[email protected]/CN=localhost' -out mongodb-cert.crt -keyout mongodb-cert.key
@ihor-lev
ihor-lev / tweet.js
Created October 27, 2020 17:13 — forked from jaredpalmer/tweet.js
send-tweet.js
/*
* Code snippet for posting tweets to your own twitter account from node.js.
* You must first create an app through twitter, grab the apps key/secret,
* and generate your access token/secret (should be same page that you get the
* app key/secret).
* Uses oauth package found below:
* https://github.com/ciaranj/node-oauth
* npm install oauth
* For additional usage beyond status updates, refer to twitter api
* https://dev.twitter.com/docs/api/1.1
@ihor-lev
ihor-lev / gist:b27031c358ec737720010111cc8966b4
Created September 29, 2020 13:09 — forked from Bouke/gist:11261620
Multiple Python installations on OS X

Previous versions used homebrew to install the various versions. As suggested in the comments, it's better to use pyenv instead. If you are looking for the previous version of this document, see the revision history.

$ brew update
$ brew install pyenv
$ pyenv install 3.5.0
$ pyenv install 3.4.3
$ pyenv install 3.3.6
$ pyenv install 3.2.6
$ pyenv install 2.7.10

$ pyenv install 2.6.9

[options]
#
# WARNING:
# If you use the Odoo Database utility to change the master password be aware
# that the formatting of this file WILL be LOST! A copy of this file named
# /etc/odoo/openerp-server.conf.template has been made in case this happens
# Note that the copy does not have any first boot changes
#-----------------------------------------------------------------------------
# Odoo Server Config File - TurnKey Linux
@ihor-lev
ihor-lev / curl.md
Created June 5, 2020 11:02 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@ihor-lev
ihor-lev / app.component.ts
Created March 30, 2020 08:19 — forked from abarrak/app.component.ts
Dynamically set page title based on active route in Angular 6+ .. (Corrected & Simplified Version)
import { Component, OnInit } from '@angular/core';
import { TitleService } from './shared/title/title.service';
@Component({
selector: 'ny-app',
templateUrl: './app.component.html',
styles: [],
})
export class AppComponent implements OnInit {