Skip to content

Instantly share code, notes, and snippets.

@ralphotowo
ralphotowo / letsencrypt-webroot-apache.md
Created June 23, 2017 20:33 — forked from daronco/letsencrypt-webroot-apache.md
Letsencrypt with webroot on Apache

Config Apache with /etc/apache2/conf-available/le.conf:

Alias /.well-known/acme-challenge/ "/var/www/html/.well-known/acme-challenge/"
<Directory "/var/www/html/">
    AllowOverride None
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    Require method GET POST OPTIONS
</Directory>
@ralphotowo
ralphotowo / README.md
Created October 1, 2017 15:57 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@ralphotowo
ralphotowo / convert-to-ssh.sh
Created October 11, 2017 15:12 — forked from bhagyas/convert-to-ssh.sh
Convert BitBucket HTTPS to SSH
#/bin/bash
#-- Author: Bhagya Silva (https://about.me/bhagyas)
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
#-- based on original code from : https://gist.github.com/m14t/3056747
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
@ralphotowo
ralphotowo / Git push deployment in 7 easy steps.md
Created October 16, 2017 20:05 — forked from thomasfr/Git push deployment in 7 easy steps.md
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@ralphotowo
ralphotowo / gist:7d6f85cefaf129a89448a37b506c16c6
Created January 24, 2018 22:34 — forked from hroling/gist:85f36e86d48285f08161
Apache 2.4 SSL config for A+ on SSLLabs.com
OS: Ubuntu 14.04 LTS, Apache 2.4.7, OpenSSL 1.0.1f
SSL Labs: A+ (RSA2048, SHA256 certificate)
Certificate: 100%
Protocol Support: 95%
Key Exchange: 90%
Cipher Strength: 90%
#### In the SSL.CONF file
SSLCipherSuite AES256+EECDH:AES256+EDH:AES128+EECDH:AES128+EDH

How to download your Udemy course videos using youtube-dl

$ youtube-dl --list-extractors | grep udemy

Steps

  1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
  2. Login into udemy website, save the cookie from chrome using Chrome (Cookie.txt)[1] export extension. Save it to file udemy-cookies.txt
  3. Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {path_to_cookies_file} with respective paths.
$ youtube-dl {course_link} --cookies {path_to_cookies_file}
@ralphotowo
ralphotowo / raspberry_auto.sh
Last active July 5, 2018 11:06
Raspberry Pi Auto-launch Video Loop
#!/bin/bash
sudo apt-get update && sudo apt-get install omxplayer -y
AUTOSTART_FILE=/home/pi/.config/lxsession/LXDE-pi/autostart
# echo "@point-rpi" >> $AUTOSTART_FILE
echo "@ScITE" >> $AUTOSTART_FILE
echo "@lxterminal -e omxplayer --loop --no-osd /home/pi/autostart.mp4" >> $AUTOSTART_FILE
@ralphotowo
ralphotowo / d7adp72.Dockerfile
Created December 31, 2019 23:21 — forked from Biker93/d7adp72.Dockerfile
Biker Drupal 7 Dockerfile
# docker build -t drupal:d7adp72 -f d7adp72.Dockerfile .
# docker image tag drupal:d7adp72 .../drupal:d7adp72
# docker push .../drupal:d7adp72
FROM php:7.2-apache
# install the PHP extensions we need
RUN set -ex; \
\
if command -v a2enmod; then \
<html prefix="og: http://ogp.me/ns#">
<head>
<title>The Rock (1996)</title>
<meta property="og:title" content="The Rock" />
<meta property="og:type" content="video.movie" />
<meta property="og:url" content="http://www.imdb.com/title/tt0117500/" />
<meta property="og:image" content="http://ia.media-imdb.com/images/rock.jpg" />
<meta property="al:ios:app_store_id" content="342792525" />
<meta property="al:ios:url" content="imdb://title/tt0117500" />
@ralphotowo
ralphotowo / nginx.conf
Created September 14, 2020 01:25 — forked from meanevo/nginx.conf
Nginx dynamic matching document root by host(accessing domain name) /*USE AT YOUR OWN RISK*/
server {
listen 0.0.0.0:80 default_server;
listen [::]:80 default_server;
server_name _;
server_tokens off;
## Document root
set $base_path "/usr/share/nginx";
set $domain_path "${host}";