Skip to content

Instantly share code, notes, and snippets.

View i-amolo's full-sized avatar

Innocent J. Blacius i-amolo

View GitHub Profile
#/!/bin/bash
# update system
yum update -y
# install bind-utils
sudo yum install bind-utils
# Bring repos in
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
@i-amolo
i-amolo / gist:56c4629524928a8359e772e7cb4802cb
Created April 9, 2020 10:16 — forked from wlbr/gist:1685405
Create a git repo with a central repository server.

##Create a git repo with a central repository server.

Step 1: Connect to server, create a new, empty directory there and initialize an empty repository.

$ ssh server.com
Last login ...
Welcome to server.com!
> mkdir myrepo.git 
> cd myrepo.git

> git --bare init

<p th:text="${bean.field + '!' + bean.field}">Static content</p>
th:text="'static part' + ${bean.field}"
th:text="${'static part' + bean.field}"

execute passwd usermname with root user

Expression Utility Objects
Besides these basic objects, Thymeleaf will offer us a set of utility objects that will help us perform common tasks in our expressions.
#dates: utility methods for java.util.Date objects: formatting, component extraction, etc.
#calendars: analogous to #dates, but for java.util.Calendar objects.
#numbers: utility methods for formatting numeric objects.
#strings: utility methods for String objects: contains, startsWith, prepending/appending, etc.
#objects: utility methods for objects in general.
#bools: utility methods for boolean evaluation.
#arrays: utility methods for arrays.
@i-amolo
i-amolo / install-gitolite.sh
Created July 29, 2020 19:33 — forked from grenade/install-gitolite.sh
Install Gitolite and grant yourself access on Fedora / RedHat
# create git user and ssh keys
sudo adduser --system --create-home --shell /bin/bash --comment 'git version control' git
sudo su - git -c 'mkdir -m=700 ~/.ssh'
sudo su - git -c 'ssh-keygen -t rsa -C "git@$(hostname)" -N "" -f ~/.ssh/id_rsa'
sudo su - git -c 'chmod 600 ~/.ssh/id_rsa'
sudo su - git -c 'chmod 644 ~/.ssh/id_rsa.pub'
# install gitolite, set umask and run setup
sudo yum install -y gitolite
sudo sed -i 's/0077/0007/g' /usr/share/gitolite/conf/example.gitolite.rc
@i-amolo
i-amolo / nginx CORS configuration.md
Created August 1, 2020 18:23 — forked from tmkasun/nginx CORS configuration.md
How to configure Nginx to add CORS

This document explain how to

  • Generate SSL self sign certificate with subject alternative names using openssl tool
  • Configure nginx to add CORS OPTION call handler for none-cors endpoints

This gist is mostly for my future references 😄

  • First you need to have openssl configuration file to tell the tool what kind of certificate do you need, Following is a sample certificate file containing two SAN domains
@i-amolo
i-amolo / nginx.conf
Created August 13, 2020 14:23 — forked from v0lkan/nginx.conf
Configuring NGINX for Maximum Throughput Under High Concurrency
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx
@i-amolo
i-amolo / php-soap.php
Created September 7, 2020 06:50 — forked from akalongman/php-soap.php
PHP soap client example
ini_set('soap.wsdl_cache_enabled', 0);
ini_set('soap.wsdl_cache_ttl', 900);
ini_set('default_socket_timeout', 15);
$params = array('param1'=>$param1);
$wsdl = 'http://service_url/method?WSDL';
@i-amolo
i-amolo / accounts.php
Created October 3, 2020 08:54 — forked from iscalfonsoolivares/accounts.php
Getting json data from request with codeigniter
// curl -i -X POST -H 'Content-Type: application/son' -d '{"name": "New item", "year": "2009"}' http://localhost/api/accounts
$this->load->helper("security");
$stream = $this->security->xss_clean( $this->input->raw_input_stream );
$new_account = json_decode(trim($stream), true);
$accounts = array();