Skip to content

Instantly share code, notes, and snippets.

@umanshield
umanshield / letsencrypt.sh
Last active March 4, 2019 16:34
Letsencrypt ssl cerificate
cd /opt
sudo git clone https://github.com/letsencrypt/letsencrypt
cd /opt/letsencrypt
./letsencrypt-auto --apache -d example.com
./letsencrypt-auto --apache -d example.com -d www.example.com
#После завершения установки сгенерированный сертификат появится в /etc/letsencrypt/live.
#Проверить состояние сертификата можно по следующей ссылке (вместо условного домена укажите своё базовое доменное имя):
apt-get install python-pip
pip install setuptools
@umanshield
umanshield / bash-cheatsheet.sh
Last active January 7, 2018 19:42 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@umanshield
umanshield / add-https.sh
Last active December 21, 2020 13:20
WEB php server centos & ubuntu 16.04
# How can I install SSL on localhost in Ubuntu?
sudo a2enmod ssl
sudo service apache2 restart
sudo mkdir /etc/apache2/ssl
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt
sudo vim /etc/apache2/sites-available/default-ssl.conf
sudo a2ensite default-ssl.conf
sudo service apache2 restart
@umanshield
umanshield / install-comodo-ssl-cert-for-nginx.rst
Created December 4, 2017 23:33 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

--log_gc (Log heap samples on garbage collection for the hp2ps tool.)
type: bool default: false
--expose_gc (expose gc extension)
type: bool default: false
--max_new_space_size (max size of the new generation (in kBytes))
type: int default: 0
--max_old_space_size (max size of the old generation (in Mbytes))
type: int default: 0
--max_executable_size (max size of executable memory (in Mbytes))
type: int default: 0
@umanshield
umanshield / curl.md
Created September 13, 2017 11:29 — 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.

@umanshield
umanshield / total
Last active December 21, 2017 06:24
space
df -lk | awk '/^\//{ SUM += $3 } END { print SUM/2**20 " GiB" }'
df -Ph --local --total | awk '/^total/ {print $3}'
# -d depth folder
du -ch -d 1 .
du -k * | sort -nr | cut -f2 | xargs -d '\n' du -sh
@umanshield
umanshield / BasicAuthControllerProvider.php
Created May 17, 2017 14:26 — forked from brtriver/BasicAuthControllerProvider.php
Simple Basic Auth Controller for Silex.
<?php
namespace Silex\Provider;
use Silex\Application;
use Silex\SilexEvents;
use Silex\ControllerProviderInterface;
use Silex\ControllerCollection;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
@umanshield
umanshield / package.js
Last active December 15, 2017 09:58
webpack2
"build":"webpack src/js/app.js dist/bundle.js",
// minify for prod
"build:prod":"webpack src/js/app.js dist/bundle.js -p
npm -v