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
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 / 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 / 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 {
@boniface
boniface / clean-up-boot-partition-ubuntu.md
Created April 29, 2018 20:39 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@boniface
boniface / network-tweak.md
Created March 11, 2018 13:54 — forked from mustafaturan/network-tweak.md
Linux Network Tweak for 2 million web socket connections

Sample config for 2 million web socket connection

    sysctl -w fs.file-max=12000500
    sysctl -w fs.nr_open=20000500
    # Set the maximum number of open file descriptors
    ulimit -n 20000000

    # Set the memory size for TCP with minimum, default and maximum thresholds 
 sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'