Skip to content

Instantly share code, notes, and snippets.

@wmgodyak
wmgodyak / gist:9f989506f1e3a980d88d382a4c5b3ff5
Created February 13, 2019 11:15 — forked from sgergely/gist:3793166
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@wmgodyak
wmgodyak / Instructions.sh
Created January 16, 2019 12:37 — forked from GhazanfarMir/Instructions.sh
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
@wmgodyak
wmgodyak / wp-multisite.htaccess
Created May 4, 2018 09:07
redirect from http to https custom domain in wordpress multisite example
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^publikom\.se$ [OR]
RewriteCond %{HTTP_HOST} ^www\.publikom\.se$
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
git rm -r --cached .
git add .
git commit -m "fixing .gitignore"
@wmgodyak
wmgodyak / letsencrypt_2017.md
Created March 21, 2018 20:50 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

@wmgodyak
wmgodyak / deploy.php
Created November 26, 2017 20:45 — forked from freekmurze/deploy.php
A sample deploy.php file that can be used with Deployer (http://deployer.in)
<?php
/*
* Define the servers
*/
server('production-web', '<your server url>')
->path('<path to the project on your server>')
->user('<user on the server>')
->pubKey();
/*
@wmgodyak
wmgodyak / jb_install_update.sh
Created September 13, 2017 14:22 — forked from zabidok/jb_install_update.sh
Install or update jetbrains products like PhpStorm, WebStorm, IntelliJ Idea, PyCharm, CLion, ReSharper on Ubuntu and fix problems with non latin hotkeys in gui java application
#!/bin/bash
# installation jetbrains
j_url="https://data.services.jetbrains.com/products/download"
tmp_dir="$HOME/tmp_jb"
install_dir="/opt"
if [ "$(whoami)" != "root" ]
then
echo "Sorry, you are not root."
exit 1
fi
@wmgodyak
wmgodyak / gist:b0d7b1f0d0b6b0c88ae1182a0de1546a
Created July 17, 2017 10:27 — forked from adamstac/gist:7462202
Install and configure Sendmail on Ubuntu

Install and configure Sendmail on Ubuntu

This should help you get Sendmail installed with basic configuration on Ubuntu.

  1. If sendmail isn't installed, install it: sudo apt-get install sendmail
  2. Configure /etc/hosts file: nano /etc/hosts
  3. Make sure the line looks like this: 127.0.0.1 localhost yourhostname
  4. Run Sendmail's config and answer 'Y' to everything: sudo sendmailconfig
  5. Restart apache sudo service apache2 restart
@wmgodyak
wmgodyak / gist:c79b18fc46a476ba1cc7
Created December 17, 2015 09:37 — forked from davisford/gist:5039064
git clone into non-empty directory

Let's say you start a project locally, and do some editing.

$ mkdir -p ~/git/foo && cd ~/git/foo
$ touch NEWFILE

Now you decide you want to create a new github repo and track it, but the directory is non-empty so git won't let you clone into it. You can fix this, thusly: