Skip to content

Instantly share code, notes, and snippets.

View stephenajulu's full-sized avatar
👋
Hello!

Stephen Ajulu stephenajulu

👋
Hello!
View GitHub Profile
@stephenajulu
stephenajulu / readme.md
Created August 21, 2022 10:56
web server on linux

Install a webserver on Linux in 15 minutes

Let's install a containerized web server stack on Linux! That will also deploy an intrusion prevention system with fail2ban, obtain trusted https certificates and a database server to install a WordPress blog.

We will use the free and open-source software Nginx, Docker, and WordPress.

Nginx: Project Homepage: Documentation:

Docker:

alias lsfull='ls --color=always -rthla'
alias ls='ls --color=always -a'
alias rm='rm -i'
alias rmdir='rm -ri'
alias copytoclipboard="xclip -sel c < "
alias userlogout="gnome-session-quit"
alias tetris="tetris-thefenriswolf.tetris"
alias compress_png="optipng "
alias compress_jpg="jpegoptim "
alias compress_gif="gifsicle --batch --optimize "
@stephenajulu
stephenajulu / hugosharebuttons.html
Created June 14, 2021 11:14
Simple Share Buttons for Hugo
<!--from https://www.buttons.social-->
<a href="https://www.facebook.com/sharer/sharer.php?u={{ .Permalink }}&quote={{ .Title }}%20-%20{{ .Site.Title }}" target="_blank" title="Share on Facebook" style="display:inline-block;vertical-align:middle;width:2em;height:2em;border-radius:50%;box-shadow:.1em .1em 0.5em rgba(0,0,0,.3);background:#3b5998;">
<svg style="display:block;fill:#fff;height:44%;margin:28% auto;" viewBox="0 -256 864 1664">
<path transform="matrix(1,0,0,-1,-95,1280)" d="M 959,1524 V 1260 H 802 q -86,0 -116,-36 -30,-36 -30,-108 V 927 H 949 L 910,631 H 656 V -128 H 350 V 631 H 95 v 296 h 255 v 218 q 0,186 104,288.5 104,102.5 277,102.5 147,0 228,-12 z" />
</svg>
</a>
<a href="https://twitter.com/intent/tweet/?text={{ .Title }}&amp;url={{ .Permalink }}&via=stephenajulu&amp;hashtags={{ .Params.tags }}" target="_blank" title="Tweet on Twitter" style="display:inline-block;vertical-align:middle;width:2em;height:2em;border-radius:50%;box-shadow:.1em .1em 0.5em rgba(0,0,0,.3);background:#1b95e0;"
@stephenajulu
stephenajulu / hugo-on-android.md
Created August 5, 2020 02:24 — forked from bep/hugo-on-android.md
Run Hugo on an Android phone

First install Termux

Then there are two options:

Build from source

Open the Termux terminal on your Android device and copy-and-paste the commands listed below and hit ENTER:

@stephenajulu
stephenajulu / write.rb
Created July 25, 2020 19:40 — forked from garrettdimon/write.rb
A Ruby script to facilitate starting to write a new Jekyll post and automatically do all the things related to preparing that.
#!/usr/bin/env ruby
require 'optparse'
require 'ostruct'
require 'pp'
class Article
attr_accessor :options, :file
@stephenajulu
stephenajulu / commit.sh
Created July 25, 2020 19:38 — forked from cybertramp/commit.sh
write hugo post script and commit script
#! /bin/bash
# =============================
#
# Hugo fast commit script
#
# Created 19.09.23(paran_son@outlook.com)
#
# =============================
@stephenajulu
stephenajulu / jekyll-bash-new-post
Created July 25, 2020 19:37 — forked from pibby/jekyll-bash-new-post
This bash script will setup a new Jekyll blog post in Markdown and open it for editing in Sublime Text 2
#!/bin/bash
# Katie Harron - @pibby
# This bash script will setup a new Jekyll blog post in Markdown and open it for editing in Sublime Text 2
echo "Post Title: "
read title
echo "Post Description: "
read desc
echo "Post Tags: "
read tags
@stephenajulu
stephenajulu / newpost.rb
Created July 25, 2020 19:37 — forked from al3x/newpost.rb
Handy new post script for Jekyll blogs or similar
#!/usr/bin/env ruby
unless ARGV[0]
puts 'Usage: newpost "the post title"'
exit(-1)
end
date_prefix = Time.now.strftime("%Y-%m-%d")
postname = ARGV[0].strip.downcase.gsub(/ /, '-')
post = "/Users/al3x/src/al3x.github.com/_posts/#{date_prefix}-#{postname}.textile"
@stephenajulu
stephenajulu / jekyll-new-post-advanced
Created July 25, 2020 19:36 — forked from aamnah/jekyll-new-post-advanced
Bash script to create new Jekyll posts
#!/bin/bash
# About: Bash script to create new Jekyll posts
# Author: @AamnahAkram
# URL: https://gist.github.com/aamnah/f89fca7906f66f6f6a12
# Description: This is a more advanced version of the script which can
# - take options
# - has color coded status messages
# - improved code
# - lowercase permalinks
# - usage message
@stephenajulu
stephenajulu / wordpress_importer.rb
Created July 25, 2020 06:59 — forked from stammy/wordpress_importer.rb
Import a WordPress database and generate markdown files for Jekyll
# View my Jekyll blog http://paulstamatiou.com and my jekyll migration post http://paulstamatiou.com/how-to-wordpress-to-jekyll/
#
#
# based on the import script by icebreaker, which is based on mojombo's
# https://github.com/mojombo/jekyll/blob/master/lib/jekyll/migrators/wordpress.rb
# https://gist.github.com/303570
# edited to rewrite image URLs to use my CloudFront URL
require 'rubygems'
require 'sequel'