Skip to content

Instantly share code, notes, and snippets.

View boniface's full-sized avatar
🏠
Working from home

Boniface Kabaso boniface

🏠
Working from home
  • Hashcode (Z) Limited
  • Lusaka, Zambia
View GitHub Profile
@boniface
boniface / SimpleDemoGA.java
Created March 30, 2019 06:50 — forked from Vini2/SimpleDemoGA.java
A simple implementation of a genetic algorithm
import java.util.Random;
/**
*
* @author Vijini
*/
//Main class
public class SimpleDemoGA {
package main
import "fmt"
type Node struct {
ipAddress string
ports int
name string
next *Node
}
@boniface
boniface / add_node_at_position.go
Created October 26, 2020 16:27
Add at Position
package main
import "fmt"
type Node struct {
ipAddress string
ports int
name string
next *Node
}
@boniface
boniface / add_node.go
Created October 26, 2020 16:26
Add to Node
package main
import "fmt"
type Node struct {
ipAddress string
ports int
name string
next *Node
}
package main
import "fmt"
type Node struct {
ipAddress string
ports int
name string
next *Node
}
@boniface
boniface / schematics.txt
Created January 3, 2020 03:54
Angular & NGRX Schematics
1) CREATE: SERVICE EXAMPLE
===================================
ng g s roles/services/roles --skipTests -d
2) INTERFACE EXAMPLE:
======================
ng g i roles/models/role model --skipTests -d
3) COMPONENT EXAMPLE
@boniface
boniface / playdocker.sh
Created July 30, 2017 11:52
Docker Play deploy
dockerCommands := Seq(
Cmd("FROM", "anapsix/alpine-java:jdk8"),
Cmd("MAINTAINER", maintainer.value),
Cmd("WORKDIR", "/opt/docker"),
Cmd("ADD", "/opt /opt"),
ExecCmd("RUN", "chown", "-R", "daemon:daemon", "."),
Cmd("USER", "daemon"),
ExecCmd("ENTRYPOINT", "bin/hashbot"),
ExecCmd("CMD", "")
)
@boniface
boniface / gist:54100063a0be4046bee945424bc0cb99
Created July 8, 2019 13:40 — forked from luckydev/gist:b2a6ebe793aeacf50ff15331fb3b519d
Increate max no of open files limit in Ubuntu 16.04/18.04 for Nginx
# maximum capability of system
user@ubuntu:~$ cat /proc/sys/fs/file-max
708444
# available limit
user@ubuntu:~$ ulimit -n
1024
# To increase the available limit to say 200000
user@ubuntu:~$ sudo vim /etc/sysctl.conf
@boniface
boniface / nginx_build.sh
Last active July 8, 2019 13:11
Build Custom Nginx 1.16.0 From Source on Ubuntu 18.04 LTS
./configure --prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--modules-path=/usr/lib/nginx/modules \
--conf-path=/etc/nginx/nginx.conf \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--user=nginx --group=nginx \
@boniface
boniface / tomcat8.sh
Created November 8, 2014 18:02
Tomcat 8 startup Scrpt for Ubuntu
#Create Group
# groupadd tomcat
# useradd -g tomcat -d /usrlocal/tomcat8 tomcat
# usermod -G www-data tomcat
# chown tomcat:tomcat /usrlocal/tomcat8 -R
# vim /etc/init.d/tomcat
#!/bin/sh