Skip to content

Instantly share code, notes, and snippets.

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

Boniface Kabaso boniface

🏠
Working from home
  • Zambia
  • Lusaka, Zambia
View GitHub Profile
@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'
@boniface
boniface / kubernets.md
Created February 24, 2018 08:32
Kube installation
@boniface
boniface / latency.txt
Created August 28, 2017 14:47 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@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", "")
)
#!/bin/bash
docker run --name CasDC1SeedOne \
-e WEAVE_CIDR=10.10.10.5/16 \
-e CASSANDRA_CLUSTER_NAME=CPUT \
-e CASSANDRA_DC=DC1 \
-e CASSANDRA_RACK=RC1 \
-e CASSANDRA_ENDPOINT_SNITCH=GossipingPropertyFileSnitch \
-v /data/cassandra/node1:/var/lib/cassandra \
-e CASSANDRA_SEEDS=10.10.10.5,10.10.10.15 \

Advanced Functional Programming with Scala - Notes

Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@boniface
boniface / SBT Proxy
Created August 11, 2016 12:47
SBT Proxy
-XX:MaxPermSize=384M
-Dhttps.proxyHost=10.18.8.9
-Dhttps.proxyPort=3128
-Dhttps.proxyUser=user
-Dhttps.proxyPassword=pass
-Dhttp.proxyHost=10.18.8.9
-Dhttp.proxyPort=3128
-Dhttp.proxyUser=user
-Dhttp.proxyPassword=passwd
@boniface
boniface / dockerbuildbehindproxy.sh
Last active June 13, 2016 13:58
Docker Build Behind a Prroxy
docker build -t bonifacekabaso/cassandrad:2.2.6 \
--build-arg http_proxy="http://[USER]:[PASSWD]@[IP]:[PORT]" \
--build-arg https_proxy="http://[USER]:[PASSWD]@[IP]:[PORT]" \
.
@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